diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2007-08-29 15:06:47 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2007-08-29 15:06:47 +0000 |
commit | bc64a74dadcd9d2560b84cad283a52e7346d4140 (patch) | |
tree | 3be865dcd40dbc22db63b5d5208b205f4f59c963 | |
parent | 19897d528de779d4d3804fd7d10c235e8b50a53e (diff) |
Fix quoting problem with errors_copy.
-rw-r--r-- | doc/doc-txt/ChangeLog | 6 | ||||
-rw-r--r-- | src/src/moan.c | 4 | ||||
-rw-r--r-- | test/confs/0256 | 4 | ||||
-rw-r--r-- | test/log/0256 | 9 | ||||
-rw-r--r-- | test/mail/0256.abc@def | 31 | ||||
-rw-r--r-- | test/mail/0256.abcd+test.ex+ph10 (renamed from test/mail/0256.abcd) | 0 | ||||
-rw-r--r-- | test/mail/0256.abcd+unknown.domain+"abc@def" | 31 | ||||
-rwxr-xr-x | test/runtest | 10 | ||||
-rw-r--r-- | test/scripts/0000-Basic/0256 | 7 | ||||
-rw-r--r-- | test/stdout/0256 | 6 |
10 files changed, 98 insertions, 10 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 087c67205..9897e8f56 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.529 2007/08/29 14:02:22 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.530 2007/08/29 15:06:47 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -101,6 +101,10 @@ PH/22 Guard against possible overflow in moan_check_errorcopy(). PH/23 POSIX allows open() to be a macro; guard against that. +PH/24 If the recipient of an error message contained an @ in the local part + (suitably quoted, of course), incorrect values were put in $domain and + $local_part during the evaluation of errors_copy. + Exim version 4.67 ----------------- diff --git a/src/src/moan.c b/src/src/moan.c index 0080e57be..1b6d1a97f 100644 --- a/src/src/moan.c +++ b/src/src/moan.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/moan.c,v 1.9 2007/08/29 13:58:57 ph10 Exp $ */ +/* $Cambridge: exim/src/src/moan.c,v 1.10 2007/08/29 15:06:47 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -584,7 +584,7 @@ if (errors_copy == NULL) return NULL; length of the local part. */ localpart = recipient; -domain = Ustrchr(recipient, '@'); +domain = Ustrrchr(recipient, '@'); if (domain == NULL) return NULL; /* should not occur, but avoid crash */ llen = domain++ - recipient; diff --git a/test/confs/0256 b/test/confs/0256 index 669fdb114..99faa1d76 100644 --- a/test/confs/0256 +++ b/test/confs/0256 @@ -11,8 +11,10 @@ gecos_name = CALLER_NAME # ----- Main settings ----- +acl_smtp_rcpt = accept qualify_domain = test.ex -errors_copy = *@* abcd@test.ex +errors_copy = *@* ${quote_local_part::abcd+$domain+$local_part}@test.ex +trusted_users = CALLER # ------ Routers ------ diff --git a/test/log/0256 b/test/log/0256 index aaab9b34d..c04aedc55 100644 --- a/test/log/0256 +++ b/test/log/0256 @@ -2,6 +2,13 @@ 1999-03-02 09:44:33 10HmaX-0005vi-00 ** unknown@test.ex: Unrouteable address 1999-03-02 09:44:33 10HmaY-0005vi-00 <= <> R=10HmaX-0005vi-00 U=EXIMUSER P=local S=sss 1999-03-02 09:44:33 10HmaY-0005vi-00 => CALLER <CALLER@test.ex> R=r1 T=t1 -1999-03-02 09:44:33 10HmaY-0005vi-00 => abcd <abcd@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 10HmaY-0005vi-00 => abcd+test.ex+CALLER <abcd+test.ex+CALLER@test.ex> R=r1 T=t1 1999-03-02 09:44:33 10HmaY-0005vi-00 Completed 1999-03-02 09:44:33 10HmaX-0005vi-00 Completed +1999-03-02 09:44:33 10HmaZ-0005vi-00 <= "abc@def"@unknown.domain U=CALLER P=local-smtp S=sss +1999-03-02 09:44:33 10HmaZ-0005vi-00 ** unknown@test.ex: Unrouteable address +1999-03-02 09:44:33 10HmbA-0005vi-00 <= <> R=10HmaZ-0005vi-00 U=EXIMUSER P=local S=sss +1999-03-02 09:44:33 10HmbA-0005vi-00 => abc@def <"abc@def"@unknown.domain> R=r1 T=t1 +1999-03-02 09:44:33 10HmbA-0005vi-00 => abcd+unknown.domain+"abc@def" <"abcd+unknown.domain+\"abc@def\""@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 10HmbA-0005vi-00 Completed +1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed diff --git a/test/mail/0256.abc@def b/test/mail/0256.abc@def new file mode 100644 index 000000000..22a2ecd35 --- /dev/null +++ b/test/mail/0256.abc@def @@ -0,0 +1,31 @@ +From MAILER-DAEMON Tue Mar 02 09:44:33 1999 +Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz) + id 10HmbA-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 +X-Failed-Recipients: unknown@test.ex +Auto-Submitted: auto-replied +From: Mail Delivery System <Mailer-Daemon@test.ex> +To: "abc@def"@unknown.domain +Subject: Mail delivery failed: returning message to sender +Message-Id: <E10HmbA-0005vi-00@myhost.test.ex> +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +This message was created automatically by mail delivery software. + +A message that you sent could not be delivered to one or more of its +recipients. This is a permanent error. The following address(es) failed: + + unknown@test.ex + Unrouteable address + +------ This is a copy of the message, including all the headers. ------ + +Return-path: <"abc@def"@unknown.domain> +Received: from CALLER by myhost.test.ex with local-smtp (Exim x.yz) + (envelope-from <"abc@def"@unknown.domain>) + id 10HmaZ-0005vi-00 + for unknown@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: <E10HmaZ-0005vi-00@myhost.test.ex> +From: "abc@def"@unknown.domain +Date: Tue, 2 Mar 1999 09:44:33 +0000 + + diff --git a/test/mail/0256.abcd b/test/mail/0256.abcd+test.ex+ph10 index 87ed8a038..87ed8a038 100644 --- a/test/mail/0256.abcd +++ b/test/mail/0256.abcd+test.ex+ph10 diff --git a/test/mail/0256.abcd+unknown.domain+"abc@def" b/test/mail/0256.abcd+unknown.domain+"abc@def" new file mode 100644 index 000000000..22a2ecd35 --- /dev/null +++ b/test/mail/0256.abcd+unknown.domain+"abc@def" @@ -0,0 +1,31 @@ +From MAILER-DAEMON Tue Mar 02 09:44:33 1999 +Received: from EXIMUSER by myhost.test.ex with local (Exim x.yz) + id 10HmbA-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 +X-Failed-Recipients: unknown@test.ex +Auto-Submitted: auto-replied +From: Mail Delivery System <Mailer-Daemon@test.ex> +To: "abc@def"@unknown.domain +Subject: Mail delivery failed: returning message to sender +Message-Id: <E10HmbA-0005vi-00@myhost.test.ex> +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +This message was created automatically by mail delivery software. + +A message that you sent could not be delivered to one or more of its +recipients. This is a permanent error. The following address(es) failed: + + unknown@test.ex + Unrouteable address + +------ This is a copy of the message, including all the headers. ------ + +Return-path: <"abc@def"@unknown.domain> +Received: from CALLER by myhost.test.ex with local-smtp (Exim x.yz) + (envelope-from <"abc@def"@unknown.domain>) + id 10HmaZ-0005vi-00 + for unknown@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: <E10HmaZ-0005vi-00@myhost.test.ex> +From: "abc@def"@unknown.domain +Date: Tue, 2 Mar 1999 09:44:33 +0000 + + diff --git a/test/runtest b/test/runtest index 6a4fb2b51..77fe17a13 100755 --- a/test/runtest +++ b/test/runtest @@ -1,6 +1,6 @@ #! /usr/bin/perl -w -# $Cambridge: exim/test/runtest,v 1.28 2007/07/04 10:37:04 ph10 Exp $ +# $Cambridge: exim/test/runtest,v 1.29 2007/08/29 15:06:47 ph10 Exp $ ############################################################################### # This is the controlling script for the "new" test suite for Exim. It should # @@ -23,7 +23,7 @@ use Socket; # Start by initializing some global variables -$testversion = "4.68 (16-Apr-07)"; +$testversion = "4.68 (23-Aug-07)"; $cf = "bin/cf"; $cr = "\r"; @@ -909,7 +909,7 @@ if (! -e $sf) print "\n"; print "------------ $f -----------\n" if (defined $rf && -s $rf && defined $rsf && -s $rsf); - system("$more $f"); + system("$more '$f'"); } } @@ -1023,7 +1023,7 @@ if (-e $sf) # Do the comparison - return 0 if (system("$cf $mf $sf >test-cf") == 0); + return 0 if (system("$cf '$mf' '$sf' >test-cf") == 0); # Handle comparison failure @@ -1043,7 +1043,7 @@ if (-e $sf) # Update or delete the saved file, and give the appropriate return code. if (-s $mf) - { tests_exit(-1, "Failed to cp $mf $sf") if system("cp $mf $sf") != 0; } + { tests_exit(-1, "Failed to cp $mf $sf") if system("cp '$mf' '$sf'") != 0; } else { tests_exit(-1, "Failed to unlink $sf") if !unlink($sf); } diff --git a/test/scripts/0000-Basic/0256 b/test/scripts/0000-Basic/0256 index 0eefe7485..bdab73b33 100644 --- a/test/scripts/0000-Basic/0256 +++ b/test/scripts/0000-Basic/0256 @@ -2,3 +2,10 @@ exim -odi unknown . **** +exim -odi -bs +mail from:<"abc@def"@unknown.domain> +rcpt to:<unknown@test.ex> +data +. +quit +**** diff --git a/test/stdout/0256 b/test/stdout/0256 new file mode 100644 index 000000000..0058c5ec2 --- /dev/null +++ b/test/stdout/0256 @@ -0,0 +1,6 @@ +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaZ-0005vi-00
+221 myhost.test.ex closing connection
|