Re: [Exim] Falling Back

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Philip Hazel
Datum:  
To: bhoc
CC: exim-users
Betreff: Re: [Exim] Falling Back
On Fri, 4 Jan 2002 bhoc@??? wrote:

> We have a VPN (not directly connected to the internet) with three
> locations. Each location has an ADSL connection to the internet. On each
> location exim is sitting and waits for mail which it then forwards to the
> central mailserver (using the domainlist router). Works like a charm.
> I am playing with a fallback strategy to get our mail out should one of the
> three ADSL connections be unavailable for some time. Basically what I did
> was adding a fallback_hosts entry to the remote_smtp transport.
> Unfortunately it also falls back if the remote smtp is unavailable or the
> connection times out. It should only use the fallback_host if the link goes
> down. How could I do that? Else I risk a mail loop between my three exims.


You need some way of telling Exim when the link is down. It has no
inbuilt way of distinguishing between different kinds of failure to
connect. (Your link being down and a link somewhere else along the
route to the remote host being down will both look like "connection
failed" to Exim.)

If you can arrange, for example, for some file to exist when the link is
up and not when the link is down (or vice versa), you could use this to
switch between two different transports, one with fallback_hosts set and
the other without. In your router you'd put something like this:

transport = ${if exists{/some/file}{remote_smtp1}{remote_smtp2}}

> Then, I noticed that fallback_hosts needs a DNS entry to resolve - just
> putting the name into the hosts file does not work. Is this by design?
> Would adding a 'byname' tag help?


No, because fallback_hosts is handled in the transport. You need to add
gethostbyname to the transport.

> PS: exim rocks. really.


Thanks.

Philip

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.