-2

Diagram

As in the diagram I attached, I have 2 mail relay servers (ap03.net and ap04.net) configured pointed to same smtp server.

ap03.net and ap04.net have identical configurations both are running postfix and all hosts are pointed to primary mail relay server ap03.net

MX record on DNS only pointed to smtp.net mail server

How do I configure ap04.net relay server as backup when ap03.net primary relay got down?

Michael Dodd
  • 10,102
  • 12
  • 51
  • 64
Padme
  • 1
  • 2

1 Answers1

0

In your DNS zone file you need to specify multiple MXs - the one with the lowest number should be your ap03.net server...

MX      10  ap03.net
MX      15  ap04.net      

Then you need to configure postfix on ap04.net to transport the mail to the next MX. Unfortunately how to do this depends on your exact configuration - are you using text files for mapping users/domains, is it coming from a set of mysql db tables, etc.

Flat files, act as MX for all addresses on your domain - https://www.howtoforge.com/postfix_backup_mx#-configuring-postfix-on-mxexamplecom . Note that this means that anything undeliverable (address doesn't exist on ap03.net) will bounce from ap04.net IF ap03.net is unavailable.

With mysql backend and virtual users, only acting as backup mx for addresses that exist... http://www.somerandomstuff.com/2010/04/26/backup-mx-with-postfix-mysql/ - be sure to read the note at the bottom of this page regarding recipient lists on a backup MX ....

ivanivan
  • 2,155
  • 2
  • 10
  • 11
  • Thanks it helps a lots, by putting the MX recode its identity which Relay Server is up and running, great it's working fine. But in above case all the host servers relayhost pointed to ap03.net(in postfix relayhost=ap03.net) what do I want to configure is when the ap03.net goes down, all the host servers should use ap04.net as a mail relay – Padme Jan 29 '17 at 02:18
  • I send email to you from my desktop. My client connects to my mail server, sends the message. My mail server looks up your domain, and attempts to deliver to MX with lowest number (highest priority). If that doesn't work, it tries the next highest and so on. So if ap03 is down, it will go to ap04. When it arrives at ap04, ap04 will start to attempt to deliver it to ap03, waiting a long while and retrying if needed.... is this not what you want to have happen? – ivanivan Jan 29 '17 at 02:58
  • Thank for help, actual i just wanna to configure HA relay server not SMTP server, i have found a solution btw thanks a lot for help – Padme Jan 31 '17 at 11:37