I have a subdomain subdomain.mydomain
with two servers server1.subdomain.mydomain
and server2.subdomain.mydomain
running CentOS 5.5. server1
runs a Postfix server for subdomain.mydomain
that acts as a second level SMTP server, i.e., it does relay through another server relay.mydomain
(on a higher level domain mydomain
).
I need to set up another Postfix on server2
to act as a backup server for server1
, so that server2
relays to server1
all mail sent through server2
.
I have been digging through the Postfix documentation site and found a section named Configuring Postfix as primary or backup MX host for a remote site, but it is too brief and not very clear.
How can I set up the Postfix service on server2
to relay to/backup server1
?
What I have understood from the previous link to Postfix documentation is that I have to set up the following:
On server1
(main server)
relay_domains
must be equal torelay.mydomain
transport_maps
must be equal tohash:/etc/postfix/transport
/etc/postfix/transport
must contain the linesubdomaing.mydomain relay:[relay.mydomain]
(and brackets are mandatory for Postfix not to perform MX lookup)
On server2
(backup server)
subdomain.mydomain
must not be listed inmydestination
smtpd_recipient_restrictions
must be equal topermit_mynetworks reject_unauth_destination
relay_recipient_maps
must be equal tohash:/etc/postfix/relay_recipients
/etc/postfix/relay_recipients
must contain a line of the formuser@subdomain.mydomain x
for every mailboxuser
in the system
However, this does not work. When I start the Postfix server on server2
and connect using telnet, Postfix does not send any message (no welcome message and no response to any command).