BulkMTA

BulkMTA is fast, performance oriented commercial Mail Transfer Agent (MTA)

SYNOPSIS

bulkmta [ option ... ]


DESCRIPTION

The bulkmta command implements outgoing MTA server. Using smart techniques such as connecting to multiple domain MX at once, rotating IP addresses, using internal FAST DNS resolver, BulkMTA excells in email service provider (ESP) deliverability.


LICENSING

BulkMTA has commercial and free version. Free version is limited to 5 mails / minute for each domain. To upgrade your free version run bulkmta with --register flag and send output to sales@bitsteer.com


EMAIL SUBMISSION INTERFACES

BulkMTA supports multiple email submission interfaces. 1. Outgoing Email submission interface 2. RPC Interface 3. Pickup directory interface

EMAIL INTERFACE

Email interface is used as common email queue submission interface and honours all commands that outgoing MTA supports, such as HELO, EHLO, MAIL_FROM ..

PICKUP DIRECTORY INTERFACE

Pickup directory interface uses files to submit data to email queue. Files are submitted to Configuration defined location and are quite similar to PowerMTA files. ``` XMRG FROM: <{{.MAILFROM}}> verp XDFN randomtext="{{.RANDOM1}}" randomtext2="{{.RANDOM2}}" MAILFROM="{{.MAILFROM}}" MAILTO="{{.MAILTO}}" X-HEADER CAMPAIGNID: <{{.CAMPAIGNID}}> X-HEADER MAILID: <{{.MAILID}}> X-HEADER SRCDOMAIN: <{{.SRCDOMAIN}}> RCPT TO:<{{.MAILTO}}> XPRT 1 LAST Mime-Version: 1.0 Date: [date] From: "Contact" <[MAILFROM]> Reply-To: "Contact" <[MAILTO]> Subject: Test Emailfsdasa To: <[to]>

This is a test [randomtext] email. Do not use this [randomtext2] unless you know what you're doing. . ` ```

RPC INTERFACE

RPC submission interface uses HTTP PUT for email queue submission.

Example using command curl ` curl -i -XPUT localhost:8787/loademail -d '{ "From":"test@test.com", "To":"test@gmail.com", "Body":"From: <test@test.com>\nSubject: test\nThis is the body message!", "Headers":{"CAMPAIGN_ID":"1","MAIL_ID":"7"} }


DKIM SIGNING

BulkMTA has option to sign email files with DKIM. Keys for each domain are determined from DOMAIN_SOURCE configuration parameter. Generate dkim key with openssl command and put in appropriate place.

openssl genrsa -out domain.key 2048 openssl req -new -key server.key -out server.csr openssl x509 -req -days 700 -in server.csr -signkey server.key -out server.crt cat server.crt server.key > server.pem


LOGGING

Logging in BulkMTA can be sent to multiple destinations, like file or elasticsearch. In case of logging custom headers you should set

X-HEADER-$HEADER

and append it to log file information with LOG_HEADERS configuration parameter.

BulkMTA supports multiple logging interfaces: 1. File logging interface 2. ElasticSearch Logging interface

FILE LOGGING INTERFACE

File logging interface is used as most simple form of logging that logs all delivered / failed mail details to log file.

With logging interface following information is logged: - time in format 2006-01-02 15:02:00 - source ip address - email unique identifier - remote ip address - remote address port - source domain - destination domain - dsn code - smtp status message

Additional details can be logged with LOG_HEADERS configuration parameter.

Files are logged in format account.log_DATE

ELASTICSEARCH LOGGING INTERFACE

ElasticSearch is fast NOSQL database used for storing BulkMTA log files. Search speed is order of magnitude faster than logging to MySQL or similar SQL databases.

With logging interface following information is logged: - time time in format 2006-01-2 15:02:00 - srcip , source ip address - destip , remote ip address - destport , remote address port - destdomain , destination domain - srcdomain , source domain - mailfrom mail , from address - mail_to , mail to address - attempt , attempt number N to deliver file - statuscode , SMTP status code

Additional details can be logged with LOG_HEADERS configuration parameter.


CONFIGURATION PARAMETERS

The following /etc/bulkmta/settings.json configuration settings are available

DNS_SERVERS
DNS_TIMEOUT (2s)
DNS_MAX_RESOLVERS (15)
CONNECTIVITY_CHECK (www.google.com:80)
FLUSH_PERIOD (5s)
FLUSH_CLEANUP_PERIOD (30s)
FLUSH_MAX_MEM_USAGE (1048576)
FLUSH_LOG_DIR (/var/spool/bulkmta/queue)
FLUSH_BUFFER_SIZE (500)
SMTP_EHLO_FALLBACK (bmta)
SMTP_TIMEOUT_CONNECT (10s)
SMTP_TIMEOUT_INACTIVE (30s)
SMTP_TIMEOUT_READ ( 10s)
SMTP_TIMEOUT_WRITE ( 10s)
SMTP_CONNECTION_BUFFER_SIZE (1000)
SMTP_MAX_CONCURRENT_DOMAINS (50)
SMTP_MAX_MX_PER_DOMAIN (2)
SMTP_MAX_SRCIP_PER_MX (2)
SMTP_CONNECTIONS_PER_SRCIP_MX (2)
SMTP_RETRY_MAX_ATTEMPTS (4)
SMTP_RETRY_BACKOFFS ([10,20,30,60,120,600,3600])
SMTP_HEART_BEAT_PERIOD (10s)
SMTP_BACKOFF_MIN (5s)
SMTP_BACKOFF_MAX (20s)
SMTP_DOMAIN_DST_RATE_FALLBACK (360)
SMTP_DOMAIN_SRC_RATE_FALLBACK (-1)
TESTFILE_ACTIVE (false)
TESTFILE_DOMAINS ([])
STORAGE_INPUT_DIR (/var/spool/bulkmta/storage_data)
STORAGE_OUTPUT_ERROR_DIR ( /var/spool/bulkmta/storage_error)
DOMAIN_DESTINATION ( null )
DOMAIN_SOURCE ( null )
INPUT_RPC_ENABLED ( true )
INPUT_RPC_PORT ( 8787 )
INPUT_SMTP_ENABLED ( true )
INPUT_SMTP_LISTEN_INTERFACE ( 0.0.0.0:10025)
INPUT_SMTP_MAX_SIZE (131072 )
INPUT_SMTP_MAX_CLIENTS ( 100 )
INPUT_SMTP_TIMEOUT ( 60s )
LOG_HEADERS ( ["CAMPAIGN_ID","SRC_DOMAIN","MAIL_ID"] )
ACCOUNT_ES_HOST ("")
ACCOUNT_ES_PORT ( 0 )
ACCOUNT_LOG_PATH ( /var/log/bulkmta/account.log )

FILES