ph10 2005/01/27 10:26:15 GMT
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src acl.c functions.h verify.c
exim-test-orig/AutoTest/confs 437
exim-test-orig/AutoTest/log 437
exim-test-orig/AutoTest/scripts 437
exim-test-orig/AutoTest/stderr 437
exim-test-orig/AutoTest/stdout 437
Log:
defer_ok was not working if used on a callout with verify=header_sender.
Revision Changes Path
1.75 +5 -0 exim/exim-doc/doc-txt/ChangeLog
1.18 +13 -7 exim/exim-src/src/acl.c
1.10 +1 -1 exim/exim-src/src/functions.h
1.14 +11 -6 exim/exim-src/src/verify.c
1.3 +2 -0 exim/exim-test-orig/AutoTest/confs/437
1.3 +1 -0 exim/exim-test-orig/AutoTest/log/437
1.2 +20 -0 exim/exim-test-orig/AutoTest/scripts/437
1.5 +33 -0 exim/exim-test-orig/AutoTest/stderr/437
1.2 +16 -0 exim/exim-test-orig/AutoTest/stdout/437
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- ChangeLog 26 Jan 2005 14:52:08 -0000 1.74
+++ ChangeLog 27 Jan 2005 10:26:14 -0000 1.75
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.74 2005/01/26 14:52:08 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.75 2005/01/27 10:26:14 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -345,6 +345,11 @@
73. $host_lookup_deferred has been added, to make it easier to detect DEFERs
during host lookups.
+
+74. The defer_ok option of callout verification was not working if it was used
+ when verifying addresses in header lines, that is, for this case:
+
+ verify = header_sender/callout=defer_ok
----------------------------------------------------
Index: acl.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/acl.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- acl.c 12 Jan 2005 15:41:27 -0000 1.17
+++ acl.c 27 Jan 2005 10:26:14 -0000 1.18
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/acl.c,v 1.17 2005/01/12 15:41:27 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/acl.c,v 1.18 2005/01/27 10:26:14 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1207,14 +1207,20 @@
if (verify_header_sender)
{
+ int verrno;
rc = verify_check_header_address(user_msgptr, log_msgptr, callout,
- callout_overall, callout_connect, se_mailfrom, pm_mailfrom, verify_options);
- if (smtp_return_error_details)
- {
- if (*user_msgptr == NULL && *log_msgptr != NULL)
- *user_msgptr = string_sprintf("Rejected after DATA: %s", *log_msgptr);
- if (rc == DEFER) acl_temp_details = TRUE;
- }
+ callout_overall, callout_connect, se_mailfrom, pm_mailfrom, verify_options,
+ &verrno);
+ if (rc != OK)
+ {
+ *basic_errno = verrno;
+ if (smtp_return_error_details)
+ {
+ if (*user_msgptr == NULL && *log_msgptr != NULL)
+ *user_msgptr = string_sprintf("Rejected after DATA: %s", *log_msgptr);
+ if (rc == DEFER) acl_temp_details = TRUE;
+ }
+ }
}
/* Handle a sender address. The default is to verify *the* sender address, but
Index: functions.h
===================================================================
RCS file: /home/cvs/exim/exim-src/src/functions.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- functions.h 4 Jan 2005 10:00:42 -0000 1.9
+++ functions.h 27 Jan 2005 10:26:14 -0000 1.10
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/functions.h,v 1.9 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/functions.h,v 1.10 2005/01/27 10:26:14 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -325,7 +325,7 @@
uschar *, uschar *, BOOL *);
extern int verify_check_dnsbl(uschar **);
extern int verify_check_header_address(uschar **, uschar **, int, int, int,
- uschar *, uschar *, int);
+ uschar *, uschar *, int, int *);
extern int verify_check_headers(uschar **);
extern int verify_check_host(uschar **);
extern int verify_check_this_host(uschar **, unsigned int *, uschar*,
Index: verify.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/verify.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- verify.c 14 Jan 2005 10:25:33 -0000 1.13
+++ verify.c 27 Jan 2005 10:26:14 -0000 1.14
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/verify.c,v 1.13 2005/01/14 10:25:33 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/verify.c,v 1.14 2005/01/27 10:26:14 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1465,6 +1465,7 @@
se_mailfrom mailfrom for verify; NULL => ""
pm_mailfrom sender for pm callout check (passed to verify_address())
options callout options (passed to verify_address())
+ verrno where to put the address basic_errno
If log_msgptr is set to something without setting user_msgptr, the caller
normally uses log_msgptr for both things.
@@ -1476,7 +1477,7 @@
int
verify_check_header_address(uschar **user_msgptr, uschar **log_msgptr,
int callout, int callout_overall, int callout_connect, uschar *se_mailfrom,
- uschar *pm_mailfrom, int options)
+ uschar *pm_mailfrom, int options, int *verrno)
{
static int header_types[] = { htype_sender, htype_reply_to, htype_from };
int yield = FAIL;
@@ -1575,12 +1576,16 @@
last of these will be returned to the user if all three fail. We do not
set a log message - the generic one below will be used. */
- if (new_ok != OK && smtp_return_error_details)
+ if (new_ok != OK)
{
- *user_msgptr = string_sprintf("Rejected after DATA: "
- "could not verify \"%.*s\" header address\n%s: %s",
- endname - h->text, h->text, vaddr->address, vaddr->message);
- }
+ *verrno = vaddr->basic_errno;
+ if (smtp_return_error_details)
+ {
+ *user_msgptr = string_sprintf("Rejected after DATA: "
+ "could not verify \"%.*s\" header address\n%s: %s",
+ endname - h->text, h->text, vaddr->address, vaddr->message);
+ }
+ }
/* Success or defer */
Index: 437
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/confs/437,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 437 5 Nov 2004 16:53:28 -0000 1.2
+++ 437 27 Jan 2005 10:26:14 -0000 1.3
@@ -43,6 +43,8 @@
check_data:
deny hosts = 10.0.0.7
!verify = header_sender/callout=mailfrom=somesender@???
+ deny hosts = 10.0.0.8
+ !verify = header_sender/callout=1s,defer_ok
accept
# ----- Routers -----
Index: 437
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/log/437,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 437 5 Nov 2004 16:53:28 -0000 1.2
+++ 437 27 Jan 2005 10:26:15 -0000 1.3
@@ -15,3 +15,4 @@
1999-03-02 09:44:33 H=[10.0.0.5] U=root sender verify defer for <okok@otherhost51>: Could not complete sender verify callout
1999-03-02 09:44:33 H=[10.0.0.5] U=root F=<okok@otherhost51> temporarily rejected RCPT <z@???>: Could not complete sender verify callout
1999-03-02 09:44:33 10HmaX-0005vi-00 <= ok7@otherhost53 H=[10.0.0.7] U=root P=smtp S=171
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= ok7@otherhost53 H=[10.0.0.8] U=root P=smtp S=171
Index: 437
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/scripts/437,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 437 8 Oct 2004 14:49:53 -0000 1.1
+++ 437 27 Jan 2005 10:26:15 -0000 1.2
@@ -409,4 +409,24 @@
.
QUIT
****
+# Timeout on RCPT for header_sender (defer_ok test)
+0
+server 1225
+220 Server ready
+HELO
+250 OK
+MAIL FROM
+250 OK
+RCPT TO
+*sleep 2
+****
+0
+really exim -d-all+verify -odq -v -bs -oMa 10.0.0.8
+MAIL FROM:<ok7@otherhost53>
+RCPT TO:<z@???>
+DATA
+Reply-To: abcd@???
+.
+QUIT
+****
no_msglog_check
Index: 437
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stderr/437,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- 437 25 Jan 2005 14:16:34 -0000 1.4
+++ 437 27 Jan 2005 10:26:15 -0000 1.5
@@ -769,3 +769,36 @@
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
+trusted user
+admin user
+LOG: smtp_connection MAIN
+ SMTP connection from root
+verifying Reply-To: header address abcd@???
+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Verifying abcd@???
+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Considering abcd@???
+Attempting full verification using callout
+callout cache: found domain record
+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:<abcd@???>
+SMTP timeout
+wrote callout cache domain record:
+ result=1 postmaster=0 random=0
+LOG: MAIN
+ <= ok7@otherhost53 H=[10.0.0.8] U=root P=smtp S=171
+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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 437 8 Oct 2004 14:50:13 -0000 1.1
+++ 437 27 Jan 2005 10:26:15 -0000 1.2
@@ -134,6 +134,12 @@
354 Enter message, ending with "." on a line by itself
250 OK id=10HmaX-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
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaY-0005vi-00
+221 myhost.test.ex closing connection
******** SERVER ********
Listening on port 1225 ...
@@ -371,4 +377,14 @@
250 OK
QUIT
250 OK
+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:<abcd@???>
+*sleep 2
End of script