diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2005-05-31 10:58:18 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2005-05-31 10:58:18 +0000 |
commit | 2a4be8f93bd41c49707fe5e6ce2d782b709b551c (patch) | |
tree | 3b0ad2daf521f0a31aca3f66aaeb04d799b7409e /src | |
parent | 7d50add39dc49d96962759c4376004cd2280ebe6 (diff) |
Add "fullpostmaster" to check <postmaster> without a domain, if the
domained version fails.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/acl.c | 7 | ||||
-rw-r--r-- | src/src/macros.h | 4 | ||||
-rw-r--r-- | src/src/verify.c | 28 |
3 files changed, 33 insertions, 6 deletions
diff --git a/src/src/acl.c b/src/src/acl.c index a96e2d188..08c69c679 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/acl.c,v 1.35 2005/05/25 09:58:16 fanf2 Exp $ */ +/* $Cambridge: 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 @@ while ((ss = string_nextinlist(&list, &sep, big_buffer, big_buffer_size)) 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) { diff --git a/src/src/macros.h b/src/src/macros.h index 9ab6f0295..55fdd846d 100644 --- a/src/src/macros.h +++ b/src/src/macros.h @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/macros.h,v 1.13 2005/05/10 10:19:11 ph10 Exp $ */ +/* $Cambridge: 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 @@ enum { v_none, v_sender, v_recipient, v_expn }; #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 */ diff --git a/src/src/verify.c b/src/src/verify.c index abdb5facc..e346cf986 100644 --- a/src/src/verify.c +++ b/src/src/verify.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/verify.c,v 1.17 2005/05/24 08:15:02 tom Exp $ */ +/* $Cambridge: 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 @@ Arguments: 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 @@ for (host = host_list; host != NULL && !done; host = host->next) 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 @@ for (host = host_list; host != NULL && !done; host = host->next) 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 @@ Arguments: 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 |