[exim] Re: Routing based on *recipient* IP address

Etusivu
Poista viesti
Vastaa
Lähettäjä: Gandalf Corvotempesta
Päiväys:  
Vastaanottaja: Jeremy Harris
Kopio: exim-users
Aihe: [exim] Re: Routing based on *recipient* IP address
Il giorno gio 26 ott 2023 alle ore 13:11 Jeremy Harris via Exim-users
<exim-users@???> ha scritto:
> If MX-sorting not needed:
>    ${lookup dnsdb{a+=${lookup dnsdb{>: mxh=example.com}}}}


Actually, i'm here, with a custom router.

relay_to_aws:
debug_print = "R: relay_to_aws for $local_part@$domain . Remote IP:
${lookup dnsdb{a+=${lookup dnsdb{>: mxh=$domain}}}}"
driver = manualroute
domains = ! +local_domains
condition = ${lookup {${lookup dnsdb{a+=${lookup dnsdb{>:
mxh=$domain}}}}}iplsearch{/etc/exim4/route_to_aws}{yes}{no}}
route_data = ${lookup {${lookup dnsdb{a+=${lookup dnsdb{>:
mxh=$domain}}}}}iplsearch{/etc/exim4/route_to_aws}}
transport = remote_smtp
same_domain_copy_routing = yes
no_more

With single-mx domains, it works. But it crash trying to resolve the
condition for any domains with multiple MXs
As you suggested, i think i have to use forany condition somewhere.

But how can I use a single lookup (and not 2 like in the code above),
merging route_data and condition ? From the condition can I set a
variable to use with route_data ?
I didn't find anything in this regard.

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/