Auteur: Ted Cooper Date: À: exim-users Sujet: Re: [exim] Exim - Force ignore of fatal errors from smarthosts
On 13/04/11 06:34, Michael da Silva Pereira wrote: > I was wondering if somebody has found a solution for what I am trying to do,
> currently I have a few ISP connections into my office, handled by my router
> with automatic switch over if one fails etc..
>
> Each ISP has it's own SMTP server, and there is no way for my mail server to
> know which ISP link is currently active.
I've had a situation like this before but I found the solution outside
of Exim since changing the behaviour of SMTP based on return codes not
implemented, or even a good idea.
The solution I came up with was to use the gateway/firewall to redirect
the internal SMTP connections to a different host based on which route
was current up and being used. The internal server used a dummy external
SMTP server as its smart host server.
eg
Internal server attempts to send mail to KNOWN external IP address
specifically configured to DEFER all SMTP connections from this server
on all outside IP addresses. This extra precaution is in the event that
something mis-configured, no mail is lost. The external server sends SMS
alerts if it gets such an attempt.
Router, using current known state of connections, uses DNAT (sry, Linux
gateways ftw) to direct the connection to the required ISP SMTP relay.
The DNS name doesn't really matter at this point.
Connection goes through to whatever ISP is currently connected.
Caveats: This does not work if the target ISP SMTP relays have any kind
of SMTP AUTH.
As a possible alternate to this to overcome the caveat, you can drop the
packets heading to the wrong ISP at the gateway and use a
file/dblookup/voodoo to tell Exim to use a particular transport/router
based on that condition.