From: Philip Hazel Date: Thu, 27 Jan 2005 10:26:14 +0000 (+0000) Subject: defer_ok was not working if used on a callout with verify=header_sender. X-Git-Tag: exim-4_50~19 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fe5b5d0bae5dfd455dfded22bd3c0eede07f7288;p=exim.git defer_ok was not working if used on a callout with verify=header_sender. --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index ad25d718a..799999e70 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.74 2005/01/26 14:52:08 ph10 Exp $ +$Cambridge: 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 ------------------------------------------- @@ -346,6 +346,11 @@ Exim version 4.50 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 + ---------------------------------------------------- See the note above about the 4.44 and 4.50 releases. diff --git a/src/src/acl.c b/src/src/acl.c index f7a551b74..47c4f86a2 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/acl.c,v 1.17 2005/01/12 15:41:27 ph10 Exp $ */ +/* $Cambridge: 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 @@ message if giving out verification details. */ 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 diff --git a/src/src/functions.h b/src/src/functions.h index eb8789030..ef780f261 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/functions.h,v 1.9 2005/01/04 10:00:42 ph10 Exp $ */ +/* $Cambridge: 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 @@ extern int verify_address(address_item *, FILE *, int, int, int, int, 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*, diff --git a/src/src/verify.c b/src/src/verify.c index 8b8e32973..dedc39fdc 100644 --- a/src/src/verify.c +++ b/src/src/verify.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/verify.c,v 1.13 2005/01/14 10:25:33 ph10 Exp $ */ +/* $Cambridge: 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 @@ Arguments: 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 @@ Returns: result of the verification attempt: OK, FAIL, or DEFER; 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 @@ for (i = 0; i < 3; i++) 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 */