Add another MX record on the domain DNS with a priority different (e.g. 10) from the main server (zero).


Set up the server and install Postfix.

sudo apt update && sudo apt upgrade -y
sudo apt install postfix -y

Choose Internet Site.

Enter the server’s name

Edit /etc/postfix/

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
relay_domains =
myhostname =
mydestination = $myhostname, localhost, localhost.localdomain,
maximal_queue_lifetime = 10d
relay_recipient_maps = hash:/etc/postfix/relay_recipients

Create or edit /etc/postfix/relay_recipients accordingly:

[email protected] OK
[email protected] OK OK

Create the relay_recipients.db and restart Postfix’ service.

sudo postmap /etc/postfix/relay_recipients
sudo systemctl restart postfix

Optionally add the SSL/TLS certificate at /etc/postfix/

smtpd_tls_security_level = may # or use encrypt to enforce 
smtpd_tls_protocols = !SSLv2, !SSLv3 !TLSv1
smtpd_tls_loglevel = 1

Restart Postfix.

sudo systemctl restart postfix

On the PRIMARY SERVER add the IP of the secondary on the file /etc/postfix/

smtp_fallback_relay = []:25

On the SECONDARY SERVER add the IP of the primary on the /etc/postfix/

mynetworks = [::ffff:]/104 [::1]/128

Restart both services:

sudo systemctl restart postfix