Re: [exim] backup servers and self-pointing MX

Top Page
Delete this message
Reply to this message
Author: Andrew C Aitchison
Date:  
To: Julian Bradfield
CC: exim-users
Subject: Re: [exim] backup servers and self-pointing MX
On Mon, 19 Jul 2021, Julian Bradfield via Exim-users wrote:

> I'm not sure of how to achieve the following aim.
>
> 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.)


I would have a router before your dnslookup router which sets up local
email delivery (via procmail) *if* a specific file exists, say
/etc/exim4/DELIVERYMX

To stop FIRST from attempting to deliver when it is in backup mode,
I would have your MX records point at an address which is not the
default address of either machine, but an extra address (aka "interface"
at least on linux) that you bring up on whichever machine is the current
delivery host.

I am not clear whether your home directory is on either FIRST or SECOND
or on a third machine ?

-- 
Andrew C. Aitchison                    Kendal, UK
             andrew@???