Fail-over or load-balancing of mail servers

High availability and load balancing

If you’re thinking about implementing a fail-over or load-balancing solution for your infrastructure, to ensure quality of service for your messaging and increase the availability of your architecture, this article should be of interest to you.

An obvious solution for setting up such a system is to use features native to the SMTP protocol, and more specifically to the management of MX fields in the DNS that manage your domains.

So to set up high availability between 2 servers ‘server1.domain.tld’ and ‘server2.domain.tld’, in theory it would be enough to configure two MXs with different priorities. If the main server is ‘server1’, you could have a configuration like :

IN MX 10 server1.domain.tld
IN MX 500 server2.domain.tld

However, in the real world, ‘server2’ will still receive traffic (mostly spam) even when ‘server1’ responds correctly. This means that both servers must be able to handle the emails properly. In this case, you might as well opt for a load-balancing architecture.
Load balancing can also be implemented by specifying identical weights for both priorities, and setting MX parameters as follows:

IN MX 10 server1.domain.tld
IN MX 10 server2.domain.tld

Or by playing with priorities if one server can handle more traffic than the other (without losing sight of the fact that both servers must be able to handle all the traffic), by setting MX as follows:

IN MX 10 server1.domain.tld
IN MX 15 server2.domain.tld

These high-availability or load-balancing functions can also be implemented via a box or specific software. In most cases, a virtual IP address is used. This IP will correspond to the host name specified in the MX field, and will transfer e-mails to one or more servers, depending on the configuration of the box or operating system.
You can also use the features offered by your e-mail protection service. In particular, ALTOSPAM enables filtered emails to be sent to multiple mail servers, either in fail-over or load-balancing mode.

ALTOSPAM ensures high availability of the upstream messaging service by systematically proposing the installation of two SMTP filtering relays, and can also send the flow to a set of mail servers on the customer’s premises. Or, as some customers do, multiple Internet connections transmitting to a single or multiple mail servers, to make their email infrastructure independent of any operator downtime.

In all the above cases, both servers must be able to handle the back-office emails correctly.


In order to set up the best possible architecture, we invite our customers to contact us to discuss this together. There are often several possible configurations, each with its own advantages and disadvantages. Don’t hesitate to contact us to discuss your requirements.

Test Altospam’s solutions!

Thousands of companies, CTOs, CIOs, CISOs and IT managers already trust us to protect their e-mail against phishing, spear phishing, ransomware, …