diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2005-01-27 10:26:14 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2005-01-27 10:26:14 +0000 |
commit | fe5b5d0bae5dfd455dfded22bd3c0eede07f7288 (patch) | |
tree | 56825748d2807d555196ab9fb417251c6d7b6794 /src | |
parent | f055f31efca6f1beea3fb65a06e16265e481e63e (diff) |
defer_ok was not working if used on a callout with verify=header_sender.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/acl.c | 22 | ||||
-rw-r--r-- | src/src/functions.h | 4 | ||||
-rw-r--r-- | src/src/verify.c | 19 |
3 files changed, 28 insertions, 17 deletions
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 */ |