MailSuite Pro documentation

Setting up backup MX server


Backup MX or secondary MX server usually keeps messages in a queue waiting for the primary server to become available. If main server is online, the Backup MX will reject messages to prevent delivering SPAM to the main server. The Backup MX server acts as a store and forward mail server.

All the files mentioned below are available for download as a single ZIP file:

Update configuration files

Download exim.cnf configuration file and put it instead of original file at the following location:


The Backup MX server needs to know the fully qualified name of your host, and you can specify it in this file. If it is unset, the server uses uname() system function to obtain the host name.

You may setup it in exim.cnf file at line 6:

primary_hostname =

Download the deliver_to and relay_domains configuration files and put them at the following locations:


The above files should have user and group afterlogic with permission 0644.

Now you have to specify the mail server domain names at /opt/afterlogic/etc/exim/relay_domains configuration file, fill it with all domains that you want to have relayed:

# relay mail for this list of domains

Next, setup routing rules at /opt/afterlogic/etc/exim/deliver_to configuration file:

# Deliver this domain to Host

with all domains that you want to have relayed with their IP addresses.

Restart Exim

Restart Exim server:

sudo /opt/afterlogic/etc/init.d/exim.rc restart

Create DNS records

Create A record for your backup MX server, for example:    7200    IN      A

Next, create MX record for your domain with lower priority:   7200    IN      MX      0   7200    IN      MX      20

Check retry rules

The default rules are stored at /opt/afterlogic/etc/exim.cnf configuration file at line ~503:

# retry and timeout settings
# Retry..       every 10 mins for 2 hours
# Then..        every hour for 24 hours
# Finally..     every 6 hours for 5 days
# Domain         Error     Retry..      Then..     Finally..
    *            *         F,2h,10m;    F,24h,1h;  F,7d,6h

The retry rules control how often Exim tries to deliver messages that cannot be delivered at the first attempt to the main server. For more information, see the following URL:

Check Backup MX Server

First, disable your main mail server:

sudo /opt/afterlogic/etc/init.d/exim.rc stop

Send a mail to your mail server from external email account, it should be accepted. To be sure, you may check Exim's mail log at Backup MX server at the following location:


After you've done that enable your mail server:

sudo /opt/afterlogic/etc/init.d/exim.rc start

The mail should be delivered in a hour to the main server.