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

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Gandalf Corvotempesta
Date:  
À: Jasen Betts
CC: exim-users
Sujet: [exim] Re: Routing based on *recipient* IP address
Il giorno ven 27 ott 2023 alle ore 10:10 Jasen Betts via Exim-users
<exim-users@???> ha scritto:
> Yes, in your config use the dnslookup router for that smarthost use ignore_target_hosts with an
> inverted host list ( that is put a ! in front of it )
>
> hostlist iran_ips = .....
>
>  iram_mx:
>    driver=dnslookup
>    ignore_target_hosts = ! +iran_ips
>    route_data=address_of_your_smarthost
>    transport = iran_smarthost


SOLVED!
this is the solution (seems to work):

Google MX : routed normally

# exim -bt test@???
R: relay_to_aws for test@???
R: dnslookup for test@???
test@???
  router = dnslookup, transport = remote_smtp
  host gmail-smtp-in.l.google.com      [2a00:1450:400c:c0c::1a] MX=5
  host gmail-smtp-in.l.google.com      [108.177.15.27]          MX=5
  host alt1.gmail-smtp-in.l.google.com [2a00:1450:4013:c16::1b] MX=10
  host alt1.gmail-smtp-in.l.google.com [142.250.153.27]         MX=10
  host alt2.gmail-smtp-in.l.google.com [2a00:1450:4025:c03::1a] MX=20
  host alt2.gmail-smtp-in.l.google.com [142.251.9.27]           MX=20
  host alt3.gmail-smtp-in.l.google.com [2a00:1450:4010:c1c::1b] MX=30
  host alt3.gmail-smtp-in.l.google.com [142.250.150.27]         MX=30
  host alt4.gmail-smtp-in.l.google.com [2404:6800:4003:c00::1b] MX=40
  host alt4.gmail-smtp-in.l.google.com [74.125.200.26]          MX=40


Cuban MX: routed via AWS:

# exim -bt test@???
R: relay_to_aws2 for test@???
test@???
router = relay_to_aws, transport = remote_smtp_aws


relay_to_aws:
debug_print = "R: relay_to_aws for $local_part@$domain"
driver = dnslookup
ignore_target_hosts = ! +gce_blocked_ips
domains = ! +local_domains
transport = remote_smtp_aws


remote_smtp_aws:
debug_print = "T: remote_smtp_aws for $local_part@$domain"
driver = smtp

connect_timeout = 5s
hosts = XXX.XXX.XXX.XXX
hosts_override

--
## 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/