Friday, February 19, 2010

Configuring Postfix as backup MX host

SkyHi @ Friday, February 19, 2010

Overview

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 ...

Email is delivered to the backup MX host and queued there ....

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.

Setup of a primary 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 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.backup2.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




REFERENCE
http://www.akadia.com/services/postfix_mx_backup.html