In short: I need to setup backup MX server, which will queue messages it receives for later delivery through original MX, AND it must only accept messages for mailboxes which will be listed in $some_file.
Details: mail system on main mail server - let's say its mx.example.com - is set up like this:
- LDAP for authentication and storing mail
- Postfix as MTA
- dovecot, amavisd-new and milter-greylist.
So idea with $some_file is:
- parse LDAP database to get domains list and mailboxes list with output in $some_file
How it should be done according to some people:
- When main mx.example.com is not available due to some reason, backup MX backup.example.com starts accepting mail for delivery (MX record priorities come in handy) and put it in queue, but only for domains/mailboxes listed in $some_file
- After mx.example.com is back online, queue formed on backup.example.com is transferred to former MX to be processed.
So this is where I scratch my head and start googling how to do this, but no luck so far.
Questions that I'd love to get answers on or at least receive some hints (maybe links to some articles?):
- Is it at all possible to perform such a setup of backup MX?
- Which MTA can do things I described: postfix, sendmail, exim?
- If so, how?
I understand that on backup MX I'll need to have at least same greylisting setup as on main MX to prevent spam.
We have a different, much (?) easier in realization setup for backup MX, where such sort of relaying is done using sendmail with option in sendmail.cf:
# Hosts for which relaying is permitted ($=R) FR-o /etc/mail/relay-domains %[^\#]
where relay-domains contains list of domains allowed to relay mail to main MX. But I'm very curios if you can provide answers and some help. Thank you in advance.