eximconf: fix IPv4-only sending
authorAdam D. Barratt <adam@adam-barratt.org.uk>
Sun, 29 Sep 2019 14:11:20 +0000 (15:11 +0100)
committerAdam D. Barratt <adam@adam-barratt.org.uk>
Sun, 29 Sep 2019 14:11:20 +0000 (15:11 +0100)
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
modules/exim/templates/eximconf.erb

index ac91dbe..d303ba1 100644 (file)
@@ -136,6 +136,7 @@ domainlist google_mxen = aspmx.l.google.com : gmail-smtp-in.l.google.com : \
                          *.aspmx.l.google.com : *.gmail-smtp-in.l.google.com
 
 domainlist single_domain_mx = +google_mxen
+domainlist ipv4_only_domain_mx = +google_mxen
 
 <%- if @is_mailrelay -%>
 # Domains we relay for; that is domains that aren't considered local but we 
@@ -154,7 +155,6 @@ tls_crl = /etc/exim4/ssl/ca.crl
 # expensive, you can specify the networks for which a lookup is done, or
 # remove the setting entirely.
 host_lookup = *
-dns_ipv4_lookup = +google_mxen
 
 # If this option is set, then any process that is running as one of the
 # listed users may pass a message to Exim and specify the sender's
@@ -1129,7 +1129,11 @@ dnslookup:
                   {match_domain{$item}{+single_domain_mx}}\
                   {remote_smtp_single_domain}{remote_smtp}\
                }
-  ignore_target_hosts = +reservedaddrs
+  ignore_target_hosts = +reservedaddrs : \
+               ${if forany{${lookup dnsdb{>: mxh=$domain}}}\
+                  {match_domain{$item}{+ipv4_only_domain_mx}}\
+                  {::::/0}{}\
+               }
   no_more
 
 postmasterish: