My setup is that I have two mail servers, call them FIRST and SECOND.
Their exim configurations are almost identical, with one difference
conditioned upon the presence of /etc/exim4/BACKUPMX .
Normally, the MXes are FIRST with priority 10, and SECOND with
priority 20.
FIRST takes mail for the hosted domains and delivers it through
procmail to home directories.
SECOND accepts mail for the hosted domains and passes it to the
dnslookup router for delivery - since FIRST has higher priority,
dnslookup doesn't attempt to deliver to the local host.
When, as now, my main server is at risk of disruption, I stop (and
disable at boot) exim on FIRST, sync the home directories to SECOND,
and restart exim on SECOND in main server mode. One DNS change to make
the imap server address point to SECOND instead of FIRST, and I'm
done.
However, I want to be able to get messages generated on FIRST. If I
start exim on FIRST in backup mode, then dnslookup will find FIRST as
the first on the list, so I would have to set self=send to get
delivery; but then it will just send to itself and loop.
Is there a way I can achieve what I want *without* changing all the MX
records for the hosted domains? (Or without rerouting to a special
backup domain, or other such tricks.)