[exim-dev] Unexpected RFC 1123 address canonicalization

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Florian Weimer
Data:  
Para: exim-dev
Asunto: [exim-dev] Unexpected RFC 1123 address canonicalization
This one is really confusing.

The documentation says:

| One situation in which Exim does not automatically rewrite a domain is when it
| is the name of a CNAME record in the DNS. The older RFCs suggest that such a
| domain should be rewritten using the "canonical" name, and some MTAs do this.
| The new RFCs do not contain this suggestion.


The code says:

| /* If the original domain name has been changed as a result of the host lookup,
| set up a child address for rerouting and request header rewrites if so
| configured. Then yield REROUTED. However, if the only change is a change of
| case in the domain name, which some resolvers yield (others don't), just change
| the domain name in the original address so that the official version is used in
| RCPT commands. */
| 
| if (Ustrcmp(addr->domain, fully_qualified_name) != 0)
|   {
|   if (strcmpic(addr->domain, fully_qualified_name) == 0)
|     {
|     uschar *at = Ustrrchr(addr->address, '@');
|     memcpy(at+1, fully_qualified_name, Ustrlen(at+1));
|     }
|   else
|     {
|     rf_change_domain(addr, fully_qualified_name, ob->rewrite_headers, addr_new);
|     return REROUTED;
|     }
|   }


A test says:

fw@x-1:~$ /usr/sbin/exim4 -bt mailman@???
mailman@???
    <-- mailman@???
  router = dnslookup, transport = remote_smtp_ext
  host ss.vix.com [2001:559:8000:cb::2] 
  host ss.vix.com [24.104.150.2]        
fw@x-1:~$ 


Or, with debugging:

19:32:30 22717 calling dnslookup router
19:32:30 22717 dnslookup router called for ratelimits@???
19:32:30 22717 domain = lists.redbarn.org
19:32:30 22717 DNS lookup of lists.redbarn.org (MX) succeeded
19:32:30 22717 CNAME found: change to ss.vix.com
19:32:30 22717 DNS lookup of ss.vix.com (MX) gave NO_DATA
19:32:30 22717 returning DNS_NODATA
19:32:30 22717 DNS lookup of lists.redbarn.org (AAAA) succeeded
19:32:30 22717 2001:559:8000:cb::2 in "0.0.0.0/8 : 10.0.0.0/8 : 127.0.0.0/8 : 172.16.0.0/12 : 192.168.0.0/16"? no (end of list)
19:32:30 22717 DNS lookup of ss.vix.com (A) succeeded
19:32:30 22717 24.104.150.2 in "0.0.0.0/8 : 10.0.0.0/8 : 127.0.0.0/8 : 172.16.0.0/12 : 192.168.0.0/16"? no (end of list)
19:32:30 22717 Configured local interface: address=127.0.0.1
19:32:30 22717 Configured local interface: address=192.168.17.3
19:32:30 22717 Configured local interface: address=87.106.162.201
19:32:30 22717 Configured local interface: address=172.17.135.3
19:32:30 22717 fully qualified name = ss.vix.com
19:32:30 22717 ss.vix.com 2001:559:8000:cb::2 mx=-1 sort=-731
19:32:30 22717 ss.vix.com 24.104.150.2 mx=-1 sort=-336
19:32:30 22717 domain changed to ss.vix.com
19:32:30 22717 rewriting header lines
19:32:30 22717 re-routed to ratelimits@???
19:32:30 22717 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
19:32:30 22717 Considering ratelimits@???

The configuration has no rewrite rules and no funky routers.

I think the key point here is that lists.redbarn.org has no MX
records, after resolving the alias:

; <<>> DiG 9.7.3 <<>> lists.redbarn.org mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8366
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;lists.redbarn.org.             IN      MX


;; ANSWER SECTION:
lists.redbarn.org.      171641  IN      CNAME   ss.vix.com.


;; AUTHORITY SECTION:
vix.com.                2441    IN      SOA     ns.lah1.vix.com. hostmaster.vix.com. 2012062116 3600 1800 604800 3600


;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Jun 24 19:34:42 2012
;; MSG SIZE rcvd: 114