Postfix as backup MX host configure
Postfix as backup MX host
The backup MX host must accept and queue mails, if the primary mailhost is down for a certain domain. To have a high degree of availability the backup MX host must be located outside the backed up domain. You can setup the backup MX host as a primary or secondary mx for a remote site.
The primary mailhost is down ...
![](https://caylakpenguen.files.wordpress.com/2020/09/22f03-postfix_backup_mx1.gif)
Email is delivered to the backup MX host and queued there ....
![](https://caylakpenguen.files.wordpress.com/2020/09/9451d-postfix_backup_mx2.gif)
After the primary mailhost is up and running again, email is delivered from the backup MX host to the primary mailhost and stored in the local mailboxes.
![](https://caylakpenguen.files.wordpress.com/2020/09/7a724-postfix_backup_mx3.gif)
Setup of a primary mx host for a remote site
IN MX 10 mail1.backup1.com.
IN MX 20 mail2.backup2.com.
All email for the remote site is delivered to the primary mx host: mail1.backup1.com.
Postfix Configuration on backup1.com:
/etc/postfix/main.cf:
relay_domains = $mydestination the.backed-up.domain.name
smtpd_recipient_restrictions = permit_mynetworks
check_relay_domains
/etc/postfix/main.cf:
transport_maps = hash:/etc/postfix/transport
/etc/postfix/transport:
the.backed-up.domain.name smtp:[their.mail.host.name]
Setup of a secondary mx host for a remote site
DNS entry on the remote site:
IN MX 10 mail1.backup1.com.
IN MX 20 mail2.backup2.com.
All email for the remote site is delivered to the secondary mx host: mail2.backup.com.
Postfix Configuration on backup2.com:
/etc/postfix/main.cf:
relay_domains = $mydestination the.backed-up.domain.name
smtpd_recipient_restrictions = permit_mynetworks
check_relay_domains
Kaynak: https://www.akadia.com/services/postfix_mx_backup.html