ph10 2005/05/31 11:58:18 BST
Modified files:
exim-doc/doc-txt ChangeLog NewStuff
exim-src/src acl.c macros.h verify.c
exim-test-orig/AutoTest/confs 437
exim-test-orig/AutoTest/scripts 437
exim-test-orig/AutoTest/stderr 437
exim-test-orig/AutoTest/stdout 437
Log:
Add "fullpostmaster" to check <postmaster> without a domain, if the
domained version fails.
Revision Changes Path
1.146 +3 -0 exim/exim-doc/doc-txt/ChangeLog
1.48 +5 -0 exim/exim-doc/doc-txt/NewStuff
1.36 +5 -0 exim/exim-src/src/acl.c
1.14 +1 -1 exim/exim-src/src/macros.h
1.18 +24 -2 exim/exim-src/src/verify.c
1.4 +2 -0 exim/exim-test-orig/AutoTest/confs/437
1.3 +27 -0 exim/exim-test-orig/AutoTest/scripts/437
1.7 +41 -0 exim/exim-test-orig/AutoTest/stderr/437
1.3 +24 -0 exim/exim-test-orig/AutoTest/stdout/437
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -r1.145 -r1.146
--- ChangeLog 25 May 2005 20:32:44 -0000 1.145
+++ ChangeLog 31 May 2005 10:58:18 -0000 1.146
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.145 2005/05/25 20:32:44 tom Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.146 2005/05/31 10:58:18 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -57,6 +57,9 @@
TK/04 Added simple SPF lookup method in EXPERIMENTAL_SPF. See NewStuff for
details. Thanks to Chris Webb <chris@???> for the patch!
+
+PH/07 Added "fullpostmaster" verify option, which does a check to <postmaster>
+ without a domain if the check to <postmaster@domain> fails.
Exim version 4.51
Index: NewStuff
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- NewStuff 25 May 2005 20:33:28 -0000 1.47
+++ NewStuff 31 May 2005 10:58:18 -0000 1.48
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.47 2005/05/25 20:33:28 tom Exp $
+$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.48 2005/05/31 10:58:18 ph10 Exp $
New Features in Exim
--------------------
@@ -246,6 +246,11 @@
are supported.
Patch submitted by Chris Webb <chris@???>.
+
+PH/02 There's a new verify callout option, "fullpostmaster", which first acts
+ as "postmaster" and checks the recipient <postmaster@domain>. If that
+ fails, it tries just <postmaster>, without a domain, in accordance with
+ the specification in RFC 2821.
Version 4.51
Index: acl.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/acl.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- acl.c 25 May 2005 09:58:16 -0000 1.35
+++ acl.c 31 May 2005 10:58:18 -0000 1.36
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/acl.c,v 1.35 2005/05/25 09:58:16 fanf2 Exp $ */
+/* $Cambridge: exim/exim-src/src/acl.c,v 1.36 2005/05/31 10:58:18 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1512,6 +1512,11 @@
else if (strcmpic(opt, US"use_postmaster") == 0)
verify_options |= vopt_callout_recippmaster;
else if (strcmpic(opt, US"postmaster") == 0) pm_mailfrom = US"";
+ else if (strcmpic(opt, US"fullpostmaster") == 0)
+ {
+ pm_mailfrom = US"";
+ verify_options |= vopt_callout_fullpm;
+ }
else if (strncmpic(opt, US"mailfrom", 8) == 0)
{
Index: macros.h
===================================================================
RCS file: /home/cvs/exim/exim-src/src/macros.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- macros.h 10 May 2005 10:19:11 -0000 1.13
+++ macros.h 31 May 2005 10:58:18 -0000 1.14
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/macros.h,v 1.13 2005/05/10 10:19:11 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/macros.h,v 1.14 2005/05/31 10:58:18 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -602,7 +602,7 @@
#define vopt_is_recipient 0x0002
#define vopt_qualify 0x0004
#define vopt_expn 0x0008
-#define vopt_callout_postmaster 0x0010 /* during callout */
+#define vopt_callout_fullpm 0x0010 /* full postmaster during callout */
#define vopt_callout_random 0x0020 /* during callout */
#define vopt_callout_no_cache 0x0040 /* disable callout cache */
#define vopt_callout_recipsender 0x0080 /* use real sender to verify recip */
Index: verify.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/verify.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- verify.c 24 May 2005 08:15:02 -0000 1.17
+++ verify.c 31 May 2005 10:58:18 -0000 1.18
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/verify.c,v 1.17 2005/05/24 08:15:02 tom Exp $ */
+/* $Cambridge: exim/exim-src/src/verify.c,v 1.18 2005/05/31 10:58:18 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -128,6 +128,7 @@
options the verification options - these bits are used:
vopt_is_recipient => this is a recipient address
vopt_callout_no_cache => don't use callout cache
+ vopt_callout_fullpm => if postmaster check, do full one
vopt_callout_random => do the "random" thing
vopt_callout_recipsender => use real sender for recipient
vopt_callout_recippmaster => use postmaster for recipient
@@ -563,7 +564,8 @@
new_address_record.result = ccache_reject;
}
- /* Do postmaster check if requested */
+ /* Do postmaster check if requested; if a full check is required, we
+ check for RCPT TO:<postmaster> (no domain) in accordance with RFC 821. */
if (done && pm_mailfrom != NULL)
{
@@ -577,10 +579,29 @@
smtp_read_response(&inblock, responsebuffer,
sizeof(responsebuffer), '2', callout) &&
+ /* First try using the current domain */
+
+ ((
smtp_write_command(&outblock, FALSE,
"RCPT TO:<postmaster@%.1000s>\r\n", addr->domain) >= 0 &&
smtp_read_response(&inblock, responsebuffer,
- sizeof(responsebuffer), '2', callout);
+ sizeof(responsebuffer), '2', callout)
+ )
+
+ ||
+
+ /* If that doesn't work, and a full check is requested,
+ try without the domain. */
+
+ (
+ (options & vopt_callout_fullpm) != 0 &&
+ smtp_write_command(&outblock, FALSE,
+ "RCPT TO:<postmaster>\r\n") >= 0 &&
+ smtp_read_response(&inblock, responsebuffer,
+ sizeof(responsebuffer), '2', callout)
+ ));
+
+ /* Sort out the cache record */
new_domain_record.postmaster_stamp = time(NULL);
@@ -791,6 +812,7 @@
These ones are used by do_callout() -- the options variable
is passed to it.
+ vopt_callout_fullpm => if postmaster check, do full one
vopt_callout_no_cache => don't use callout cache
vopt_callout_random => do the "random" thing
vopt_callout_recipsender => use real sender for recipient
Index: 437
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/confs/437,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- 437 27 Jan 2005 10:26:14 -0000 1.3
+++ 437 31 May 2005 10:58:18 -0000 1.4
@@ -38,6 +38,8 @@
!verify = sender/callout=1s,random
deny hosts = 10.0.0.6
!verify = sender/callout=postmaster_mailfrom=pmsend@???
+ deny hosts = 10.0.0.9
+ !verify = sender/callout=fullpostmaster
accept
check_data:
Index: 437
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/scripts/437,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 437 27 Jan 2005 10:26:15 -0000 1.2
+++ 437 31 May 2005 10:58:18 -0000 1.3
@@ -429,4 +429,31 @@
.
QUIT
****
+# Test full postmaster check
+0
+server 1225
+220 Server ready
+HELO
+250 OK
+MAIL FROM
+250 OK
+RCPT TO
+250 OK
+RSET
+250 OK
+MAIL FROM
+250 OK
+RCPT TO
+550 NOT OK
+RCPT TO
+250 OK
+QUIT
+250 OK
+****
+0
+really exim -d-all+verify -v -bs -oMa 10.0.0.9
+MAIL FROM:<ok@otherhost9>
+RCPT TO:<z@???>
+QUIT
+****
no_msglog_check
Index: 437
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stderr/437,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- 437 6 Apr 2005 10:06:14 -0000 1.6
+++ 437 31 May 2005 10:58:18 -0000 1.7
@@ -828,3 +828,44 @@
LOG: smtp_connection MAIN
SMTP connection from root closed by QUIT
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
+Exim version x.yz uid=0 gid=0 pid=pppp D=40000001
+Lookups: lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz dnsdb dsearch ldap ldapdn ldapm mysql passwd pgsql testdb
+Fixed never_users: 0
+configuration file is /source/exim4/AutoTest/confs/437
+log selectors = xxxxxxxx xxxxxxxx
+cwd=/source/exim4/AutoTest 11 args: /source/exim4/AutoTest/exim -DEXIM_PATH=/source/exim4/AutoTest/exim -DDIR=/source/exim4/AutoTest -DCALLER=ph10 -C /source/exim4/AutoTest/confs/437 -d-all+verify -v -bs -oMa 10.0.0.9
+trusted user
+admin user
+LOG: smtp_connection MAIN
+ SMTP connection from root
+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Verifying ok@otherhost9
+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Considering ok@otherhost9
+Attempting full verification using callout
+callout cache: no domain record found
+callout cache: no address record found
+interface=NULL port=1225
+Connecting to 127.0.0.1 [127.0.0.1]:1225 ... connected
+ SMTP<< 220 Server ready
+ SMTP>> HELO myhost.test.ex
+ SMTP<< 250 OK
+ SMTP>> MAIL FROM:<>
+ SMTP<< 250 OK
+ SMTP>> RCPT TO:<ok@otherhost9>
+ SMTP<< 250 OK
+ SMTP>> RSET
+ SMTP<< 250 OK
+ SMTP>> MAIL FROM:<>
+ SMTP<< 250 OK
+ SMTP>> RCPT TO:<postmaster@otherhost9>
+ SMTP<< 550 NOT OK
+ SMTP>> RCPT TO:<postmaster>
+ SMTP<< 250 OK
+ SMTP>> QUIT
+wrote callout cache domain record:
+ result=1 postmaster=1 random=0
+wrote positive callout cache address record
+LOG: smtp_connection MAIN
+ SMTP connection from root closed by QUIT
+>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
Index: 437
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/437,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 437 27 Jan 2005 10:26:15 -0000 1.2
+++ 437 31 May 2005 10:58:18 -0000 1.3
@@ -140,6 +140,10 @@
354 Enter message, ending with "." on a line by itself
250 OK id=10HmaY-0005vi-00
221 myhost.test.ex closing connection
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 OK
+250 Accepted
+221 myhost.test.ex closing connection
******** SERVER ********
Listening on port 1225 ...
@@ -387,4 +391,24 @@
250 OK
RCPT TO:<abcd@???>
*sleep 2
+End of script
+Listening on port 1225 ...
+Connection request from [127.0.0.1]
+220 Server ready
+HELO myhost.test.ex
+250 OK
+MAIL FROM:<>
+250 OK
+RCPT TO:<ok@otherhost9>
+250 OK
+RSET
+250 OK
+MAIL FROM:<>
+250 OK
+RCPT TO:<postmaster@otherhost9>
+550 NOT OK
+RCPT TO:<postmaster>
+250 OK
+QUIT
+250 OK
End of script