X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Froute.c;h=324de2ab8800c0bcb91dcce5789473cec67f28ea;hb=6f0c431a792c79870266913600a71f3be21ee620;hp=f80256e3e82f4128b06e973bcea1aafd3592ca1e;hpb=322050c2d9e83d10f046da71aa2cd9cc5a355b0b;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/route.c b/src/src/route.c index f80256e3e..324de2ab8 100644 --- a/src/src/route.c +++ b/src/src/route.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/route.c,v 1.11 2006/10/09 14:36:25 ph10 Exp $ */ +/* $Cambridge: exim/src/src/route.c,v 1.14 2009/11/16 19:50:37 nm4 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2006 */ +/* Copyright (c) University of Cambridge 1995 - 2009 */ /* See the file NOTICE for conditions of use and distribution. */ /* Functions concerned with routing, and the list of generic router options. */ @@ -825,6 +825,7 @@ check_router_conditions(router_instance *r, address_item *addr, int verify, { int rc; uschar *check_local_part; +unsigned int *localpart_cache; /* Reset variables to hold a home directory and data from lookup of a domain or local part, and ensure search_find_defer is unset, in case there aren't any @@ -885,12 +886,17 @@ if ((rc = route_check_dls(r->name, US"domains", r->domains, &domainlist_anchor, caseful local part, so that +caseful can restore it, even if this router is handling local parts caselessly. However, we can't just pass cc_local_part, because that doesn't have the prefix or suffix stripped. A bit of massaging is -required. */ +required. Also, we only use the match cache for local parts that have not had +a prefix or suffix stripped. */ if (addr->prefix == NULL && addr->suffix == NULL) + { + localpart_cache = addr->localpart_cache; check_local_part = addr->cc_local_part; + } else { + localpart_cache = NULL; check_local_part = string_copy(addr->cc_local_part); if (addr->prefix != NULL) check_local_part += Ustrlen(addr->prefix); @@ -899,7 +905,7 @@ else } if ((rc = route_check_dls(r->name, US"local_parts", r->local_parts, - &localpartlist_anchor, addr->localpart_cache, MCL_LOCALPART, + &localpartlist_anchor, localpart_cache, MCL_LOCALPART, check_local_part, &deliver_localpart_data, !r->caseful_local_part, perror)) != OK) return rc;