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

トップ ページ
このメッセージを削除
このメッセージに返信
著者: David Woodhouse
日付:  
To: exim-dev
CC: Simon Arlott
古いトピック: Re: [exim-dev] RFC2821 Section 5 - automatic address rewriting
題目: Re: [exim-dev] RFC2821 Section 5 - automatic address rewriting
On Tue, 2006-11-07 at 14:13 +0000, Philip Hazel wrote:
> 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.


Hm, that patch (http://git.exim.org/exim-src.git/commitdiff/ef2e6e24)
isn't sufficient -- it'll still follow a CNAME once.

We want to limit the 'fully_qualified_name' thing to _only_ completing
domain names when they were unqualified, and _never_ set it to the
target of a symlink.

Something like this, perhaps... although I'm not sure this'll do the
right thing when you use an unqualified CNAME. It should be setting
fully_qualified_name to the _label_ of the CNAME, not the target.

diff --git a/src/dns.c b/src/dns.c
index 8d5f08c..072f4fb 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -701,13 +701,7 @@ for (i = 0; i < 10; i++)

   if (i == 0 && fully_qualified_name != NULL)
     {
-    if (cname_rr.data != NULL)
-      {
-      if (Ustrcmp(cname_rr.name, *fully_qualified_name) != 0 &&
-          cname_rr.name[0] != '*')
-        *fully_qualified_name = string_copy_dnsdomain(cname_rr.name);
-      }
-    else if (type_rr.data != NULL)
+    if (type_rr.data != NULL)
       {
       if (Ustrcmp(type_rr.name, *fully_qualified_name) != 0 &&
           type_rr.name[0] != '*')



-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@???                              Intel Corporation