Re: [Exim] Bug: Automatic re-routing of domains

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Andreas J Mueller
CC: exim-users
Assumpte: Re: [Exim] Bug: Automatic re-routing of domains
On Sun, 13 Jul 2003, Andreas J Mueller wrote:

> Proposed solution: Exim should ignore differences in the case of
> letters when doing automatic domain re-routing. After all, domains
> are routed case-insensitively.


Patch for 4.20 is below. It doesn't re-route, but it does use the
"official" casing in subsequent RCPT commands.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book



*** exim-4.20/src/routers/dnslookup.c        Mon May 12 14:39:21 2003
--- routers/dnslookup.c Wed Jul 16 15:48:56 2003
***************
*** 292,303 ****


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

  if (Ustrcmp(addr->domain, fully_qualified_name) != 0)
    {
!   rf_change_domain(addr, fully_qualified_name, ob->rewrite_headers, addr_new);
!   return REROUTED;
    }


/* If the yield is HOST_FOUND_LOCAL, the remote domain name either found MX
--- 292,314 ----

/* 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;
!     }
    }


/* If the yield is HOST_FOUND_LOCAL, the remote domain name either found MX