ph10 2004/11/12 15:03:40 GMT
Modified files:
exim-doc/doc-src FAQ.src
exim-doc/doc-txt ChangeLog
exim-src ACKNOWLEDGMENTS
exim-src/src match.c
Added files:
exim-test-orig/AutoTest/confs 592
exim-test-orig/AutoTest/scripts 592
exim-test-orig/AutoTest/stdout 592
Log:
(a) Allow an empty sender to be matched against a lookup in an address list.
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").
Revision Changes Path
1.5 +1 -1 exim/exim-doc/doc-src/FAQ.src
1.27 +9 -0 exim/exim-doc/doc-txt/ChangeLog
1.5 +2 -1 exim/exim-src/ACKNOWLEDGMENTS
1.2 +18 -16 exim/exim-src/src/match.c
1.1 +24 -0 exim/exim-test-orig/AutoTest/confs/592 (new)
1.1 +8 -0 exim/exim-test-orig/AutoTest/scripts/592 (new)
1.1 +6 -0 exim/exim-test-orig/AutoTest/stdout/592 (new)
Index: FAQ.src
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-src/FAQ.src,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FAQ.src 12 Nov 2004 14:42:04 -0000 1.4
+++ FAQ.src 12 Nov 2004 15:03:40 -0000 1.5
@@ -1,4 +1,4 @@
-## $Cambridge: exim/exim-doc/doc-src/FAQ.src,v 1.4 2004/11/12 14:42:04 nm4 Exp $
+## $Cambridge: exim/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
@@ -2756,7 +2756,7 @@
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
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ChangeLog 12 Nov 2004 12:01:52 -0000 1.26
+++ ChangeLog 12 Nov 2004 15:03:40 -0000 1.27
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.26 2004/11/12 12:01:52 ph10 Exp $
+$Cambridge: exim/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
-------------------------------------------
@@ -103,6 +103,15 @@
support for a long time. Removed HAVE_SYS_VFS_H.
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
Index: ACKNOWLEDGMENTS
===================================================================
RCS file: /home/cvs/exim/exim-src/ACKNOWLEDGMENTS,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ACKNOWLEDGMENTS 10 Nov 2004 14:15:20 -0000 1.4
+++ ACKNOWLEDGMENTS 12 Nov 2004 15:03:40 -0000 1.5
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-src/ACKNOWLEDGMENTS,v 1.4 2004/11/10 14:15:20 ph10 Exp $
+$Cambridge: exim/exim-src/ACKNOWLEDGMENTS,v 1.5 2004/11/12 15:03:40 ph10 Exp $
EXIM ACKNOWLEDGEMENTS
@@ -90,8 +90,9 @@
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
+ 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}
Index: match.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/match.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- match.c 7 Oct 2004 10:39:01 -0000 1.1
+++ match.c 12 Nov 2004 15:03:40 -0000 1.2
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/match.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/match.c,v 1.2 2004/11/12 15:03:40 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -932,32 +932,24 @@
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 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++;
-/* 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 == ';')
{
@@ -967,6 +959,16 @@
return match_check_string(subject, pattern, -1, FALSE, cb->caseless, FALSE,
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
Index: 592
====================================================================
# Exim test configuration 592
# Macros are set externally in order to get the path
# of the Exim that is being tested, and the directory
# in which the test data lives.
exim_path = EXIM_PATH
primary_hostname = myhost.test.ex
spool_directory = DIR/spool
# ----- Main settings -----
acl_smtp_mail = check_mail
# ----- ACLs -----
begin ACL
check_mail:
accept senders = testdb;<$sender_address>
# End
Index: 592
====================================================================
0 address list matching an empty address
exim -bs
helo x.y.z
mail from:<>
rset
mail from:<x@y>
quit
****
Index: 592
====================================================================
220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
250 myhost.test.ex Hello ph10 at x.y.z
250 OK
250 Reset OK
250 OK
221 myhost.test.ex closing connection