Author: Cyborg Date: To: exim-users Subject: Re: [exim] Re-routing mail to the secondary MX server
Am 12.01.22 um 16:02 schrieb Dmitriy Matrosov via Exim-users: > Hi.
>
> Is it possible to re-route certain mails on the primary server (with
> lowest MX priority)
> to the secondary (the one with highest priority)?
>
> My use case is if the recipient is not found on the primary server,
> try to deliver a message to the secondary server (which is controlled
> by another person).
>
> Thanks.
>
SMTP Server are backupservers, with the same address setup.
Your primary should take the mail and send it to the second server, or,
easier: use a subdomain for the secondserver and his addresses, as any
subdomain can have it's own MX entry. Example:
domain.com. IN MX 0 mx.domain.com
berlin.domain.com. IN MX 0 mx.berlin.domain.com
If you want one @domain.com with two distinct servers, take it on any
of them and reroute it :
for your secondary
secondmx:
driver = manualroute
domains = +local_domains
condition = ... your condition for a message to your primary server...
transport = remote_smtp
route_data = mx.primary.domain.com
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
for your primary
secondmx:
driver = manualroute
domains = +local_domains
condition = ... your condition for a message to your secondary server...
transport = remote_smtp
route_data = mx.secondary.domain.com
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
Each one should stand BEFORE the "dnslookup"-router in it's version of
your exim.conf, depending on the server it is on.