(a) Allow an empty sender to be matched against a lookup in an address list.
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Fri, 12 Nov 2004 15:03:40 +0000 (15:03 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Fri, 12 Nov 2004 15:03:40 +0000 (15:03 +0000)
Previously the only cases considered were a regular expression, or an
empty pattern.

(b) Fixed typo in the FAQ ("prefix" should have been "local_part_prefix").

doc/doc-src/FAQ.src
doc/doc-txt/ChangeLog
src/ACKNOWLEDGMENTS
src/src/match.c

index a90f03586a14f9c464d82f7a00302c642f64b423..3d5c1a44494647ff511e831ff7bd6714c9cad764 100644 (file)
@@ -1,4 +1,4 @@
-## $Cambridge: exim/doc/doc-src/FAQ.src,v 1.4 2004/11/12 14:42:04 nm4 Exp $
+## $Cambridge: exim/doc/doc-src/FAQ.src,v 1.5 2004/11/12 15:03:40 ph10 Exp $
 ##
 ## This file is processed by Perl scripts to produce an ASCII and an HTML
 ## version. Lines starting with ## are omitted. The markup used with paragraphs
 ##
 ## This file is processed by Perl scripts to produce an ASCII and an HTML
 ## version. Lines starting with ## are omitted. The markup used with paragraphs
@@ -2756,7 +2756,7 @@ A0413: Setting \skip_syntax_errors\ on the redirect router causes syntax
            driver = accept
            check_local_user
            transport = local_delivery
            driver = accept
            check_local_user
            transport = local_delivery
-           prefix = real-
+           local_part_prefix = real-
 
        before the \%redirect%\ router that handles \(.forward)\ files. This will
        do an ordinary local delivery without \(.forward)\ processing, if the
 
        before the \%redirect%\ router that handles \(.forward)\ files. This will
        do an ordinary local delivery without \(.forward)\ processing, if the
index 3b001000ce9f8aca134110113b2f40aba3492f2c..dba38e56f4577119228dd2b8775b12c66b4c3dc2 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.26 2004/11/12 12:01:52 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.27 2004/11/12 15:03:40 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -104,6 +104,15 @@ Exim version 4.44
 
 28. Installed the latest version of exipick from John Jetmore.
 
 
 28. Installed the latest version of exipick from John Jetmore.
 
+29. In an address list, if the pattern was not a regular expression, an empty
+    subject address (from a bounce message) matched only if the pattern was an
+    empty string. Non-empty patterns were not even tested. This was the wrong
+    because it is perfectly reasonable to use an empty address as part of a
+    database query. An empty address is now tested by patterns that are
+    lookups. However, all the other forms of pattern expect the subject to
+    contain a local part and a domain, and therefore, for them, an empty
+    address still always fails if the pattern is not itself empty.
+
 
 Exim version 4.43
 -----------------
 
 Exim version 4.43
 -----------------
index 91a0cf0667441cf083659519f0c4caec25bcecdd..e6af9f53ec6be306085921736303351cb59ae9b3 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.4 2004/11/10 14:15:20 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.5 2004/11/12 15:03:40 ph10 Exp $
 
 EXIM ACKNOWLEDGEMENTS
 
 
 EXIM ACKNOWLEDGEMENTS
 
@@ -90,8 +90,9 @@ John Dalbec               Patch for quota_warn_threshold bug
 Vivek Dasmohapatra        Suggested patch for CRL support
 Andrew Doran              Patch for NetBSD configuration files
                           Patch for ifreq alignment and size problems
 Vivek Dasmohapatra        Suggested patch for CRL support
 Andrew Doran              Patch for NetBSD configuration files
                           Patch for ifreq alignment and size problems
-Michael Deutschman        Suggested patch for treating bind() failure like connect()
+Michael Deutschmann       Suggested patch for treating bind() failure like connect()
                           Patch for $sender_data and $recipient_data
                           Patch for $sender_data and $recipient_data
+                          Suggested patch for null address match lookup bug 
 Oliver Eikemeier          Patch to skip Received: if expansion is empty
                           Patch for "eqi"
 Nico Erfurth              Fix for bug in ${readfile}
 Oliver Eikemeier          Patch to skip Received: if expansion is empty
                           Patch for "eqi"
 Nico Erfurth              Fix for bug in ${readfile}
index 9d2a1c0bd892b120557f9c582332b3c9018dd0d3..eb54f232a3ca48f14c1e6ccfb4d9ef55c67610ba 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/match.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/match.c,v 1.2 2004/11/12 15:03:40 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -932,32 +932,24 @@ error = error;  /* Keep clever compilers from complaining */
 DEBUG(D_lists) debug_printf("address match: subject=%s pattern=%s\n",
   subject, pattern);
 
 DEBUG(D_lists) debug_printf("address match: subject=%s pattern=%s\n",
   subject, pattern);
 
-/* Handle a regular expression, which must match the entire incoming address. */
+/* Handle a regular expression, which must match the entire incoming address. 
+This may be the empty address. */
 
 if (*pattern == '^')
   return match_check_string(subject, pattern, cb->expand_setup, TRUE,
     cb->caseless, FALSE, NULL);
 
 
 if (*pattern == '^')
   return match_check_string(subject, pattern, cb->expand_setup, TRUE,
     cb->caseless, FALSE, NULL);
 
-/* If the subject is the empty string, the only pattern it can match (other
-than a regular expression) is the empty pattern. */
-
-if (*subject == 0) return (*pattern == 0)? OK : FAIL;
-
-/* Find the domain in the subject */
-
-sdomain = Ustrrchr(subject, '@');
-
-/* Handle the case of a pattern that is just a lookup. Skip over possible
-lookup names (letters, digits, hyphens). Skip over a possible * or *@ at
-the end. Then we must have a semicolon for it to be a lookup. */
+/* Handle a pattern that is just a lookup. Skip over possible lookup names
+(letters, digits, hyphens). Skip over a possible * or *@ at the end. Then we
+must have a semicolon for it to be a lookup. */
 
 for (s = pattern; isalnum(*s) || *s == '-'; s++);
 if (*s == '*') s++;
 if (*s == '@') s++;
 
 
 for (s = pattern; isalnum(*s) || *s == '-'; s++);
 if (*s == '*') s++;
 if (*s == '@') s++;
 
-/* If it is a straight lookup, do a lookup for the whole address. Partial
-matching doesn't make sense here, so we ignore it, but write a panic log entry.
-However, *@ matching will be honoured. */
+/* If it is a straight lookup, do a lookup for the whole address. This may be 
+the empty address. Partial matching doesn't make sense here, so we ignore it,
+but write a panic log entry. However, *@ matching will be honoured. */
 
 if (*s == ';')
   {
 
 if (*s == ';')
   {
@@ -968,6 +960,16 @@ if (*s == ';')
     valueptr);
   }
 
     valueptr);
   }
 
+/* For the remaining cases, an empty subject matches only an empty pattern, 
+because other patterns expect to have a local part and a domain to match 
+against. */
+
+if (*subject == 0) return (*pattern == 0)? OK : FAIL;
+
+/* Find the subject's domain */
+
+sdomain = Ustrrchr(subject, '@');
+
 /* If the pattern starts with "@@" we have a split lookup, where the domain is
 looked up to obtain a list of local parts. If the subject's local part is just
 "*" (called from retry) the match always fails. */
 /* If the pattern starts with "@@" we have a split lookup, where the domain is
 looked up to obtain a list of local parts. If the subject's local part is just
 "*" (called from retry) the match always fails. */