Re: [exim-dev] RFC2821 Section 5 - automatic address rewriti…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: Simon Arlott
CC: exim-dev
Nouveaux-sujets: Re: [exim-dev] RFC2821 Section 5 - automatic address rewriting
Sujet: Re: [exim-dev] RFC2821 Section 5 - automatic address rewriting
On Mon, 30 Oct 2006, Simon Arlott wrote:

> > 31. ADDRESS REWRITING
> >
> > 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.


> While exim claims not to do rewriting automatically, it does:


Indeed it does. It isn't supposed to. The substantive fix adds just 10
characters; the patch below corrects the comments and adds some
debugging. This patch is also committed in the CVS.

Philip

--
Philip Hazel, University of Cambridge Computing Service.



*** exim-4.63/src/dns.c     Mon Jul 31 15:19:48 2006
--- dns.c    Tue Nov  7 14:07:02 2006
***************
*** 677,688 ****
      else if (rr->type == T_CNAME) cname_rr = *rr;
      }


! /* If a CNAME was found, take the fully qualified name from it; otherwise
! from the first data record, if present. For testing, there is a magic name
! that gets its casing adjusted, because my resolver doesn't seem to pass back
! upper case letters in domain names. */

!   if (fully_qualified_name != NULL)
      {
      if (cname_rr.data != NULL)
        {
--- 677,686 ----
      else if (rr->type == T_CNAME) cname_rr = *rr;
      }


! /* For the first time round this loop, if a CNAME was found, take the fully
! qualified name from it; otherwise from the first data record, if present. */

!   if (i == 0 && fully_qualified_name != NULL)
      {
      if (cname_rr.data != NULL)
        {
***************
*** 712,717 ****
--- 710,717 ----
      cname_rr.data, (DN_EXPAND_ARG4_TYPE)data, 256);
    if (datalen < 0) return DNS_FAIL;
    name = data;
+   
+   DEBUG(D_dns) debug_printf("CNAME found: change to %s\n", name);
    }       /* Loop back to do another lookup */


/*Control reaches here after 10 times round the CNAME loop. Something isn't