X-Git-Url: https://git.exim.org/users/jgh/exim.git/blobdiff_plain/059ec3d9952740285fb1ebf47961b8aca2eb1b4a..c09b95966e16e092453cdb797c8048579b3585bd:/src/src/smtp_in.c diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 8bc12debf..755b2bacc 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/smtp_in.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */ +/* $Cambridge: exim/src/src/smtp_in.c,v 1.5.2.2 2004/12/02 16:33:30 tom Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -167,17 +167,18 @@ static smtp_cmd_list *cmd_list_end = #define CMD_LIST_STARTTLS 4 static uschar *protocols[] = { - US"local-smtp", - US"local-esmtp", - US"local-esmtpa", - US"local-esmtps", - US"local-esmtpsa" + US"local-smtp", /* HELO */ + US"local-smtps", /* The rare case EHLO->STARTTLS->HELO */ + US"local-esmtp", /* EHLO */ + US"local-esmtps", /* EHLO->STARTTLS->EHLO */ + US"local-esmtpa", /* EHLO->AUTH */ + US"local-esmtpsa" /* EHLO->STARTTLS->EHLO->AUTH */ }; #define pnormal 0 -#define pextend 1 -#define pauthed 1 /* added to pextend */ -#define pcrpted 2 /* added to pextend */ +#define pextend 2 +#define pcrpted 1 /* added to pextend or pnormal */ +#define pauthed 2 /* added to pextend */ #define pnlocal 6 /* offset to remove "local" */ /* When reading SMTP from a remote host, we have to use our own versions of the @@ -803,8 +804,14 @@ rcpt_count = rcpt_defer_count = rcpt_fail_count = message_size = -1; acl_warn_headers = NULL; queue_only_policy = FALSE; -deliver_freeze = FALSE; /* Can be set by ACL */ -submission_mode = FALSE; /* Can be set by ACL */ +deliver_freeze = FALSE; /* Can be set by ACL */ +#ifdef WITH_CONTENT_SCAN +fake_reject = FALSE; /* Can be set by ACL */ +no_mbox_unspool = FALSE; /* Can be set by ACL */ +#endif +submission_mode = FALSE; /* Can be set by ACL */ +active_local_from_check = local_from_check; /* Can be set by ACL */ +active_local_sender_retain = local_sender_retain; /* Can be set by ACL */ sender_address = NULL; raw_sender = NULL; /* After SMTP rewrite, before qualifying */ sender_address_unrewritten = NULL; /* Set only after verify rewrite */ @@ -1771,6 +1778,9 @@ BOOL drop = rc == FAIL_DROP; uschar *lognl; uschar *sender_info = US""; uschar *what = (where == ACL_WHERE_PREDATA)? US"DATA" : +#ifdef WITH_CONTENT_SCAN + (where == ACL_WHERE_MIME)? US"during MIME ACL checks" : +#endif (where == ACL_WHERE_DATA)? US"after DATA" : string_sprintf("%s %s", acl_wherenames[where], smtp_data); @@ -1782,7 +1792,11 @@ fixed, sender_address at this point became the rewritten address. I'm not sure this is what should be logged, so I've changed to logging the unrewritten address to retain backward compatibility. */ +#ifndef WITH_CONTENT_SCAN if (where == ACL_WHERE_RCPT || where == ACL_WHERE_DATA) +#else +if (where == ACL_WHERE_RCPT || where == ACL_WHERE_DATA || where == ACL_WHERE_MIME) +#endif { sender_info = string_sprintf("F=<%s> ", (sender_address_unrewritten != NULL)? sender_address_unrewritten : sender_address); @@ -2360,7 +2374,7 @@ while (done <= 0) ((sender_host_authenticated != NULL)? pauthed : 0) + ((tls_active >= 0)? pcrpted : 0)] : - protocols[pnormal]) + protocols[pnormal + ((tls_active >= 0)? pcrpted : 0)]) + ((sender_host_address != NULL)? pnlocal : 0); @@ -3031,9 +3045,14 @@ while (done <= 0) smtp_printf("554 Too many recipients\r\n"); break; } - - rc = (acl_smtp_predata == NULL)? OK : - acl_check(ACL_WHERE_PREDATA, NULL, acl_smtp_predata, &user_msg, &log_msg); + + if (acl_smtp_predata == NULL) rc = OK; else + { + enable_dollar_recipients = TRUE; + rc = acl_check(ACL_WHERE_PREDATA, NULL, acl_smtp_predata, &user_msg, + &log_msg); + enable_dollar_recipients = FALSE; + } if (rc == OK) { @@ -3071,7 +3090,7 @@ while (done <= 0) { address_item *addr = deliver_make_addr(address, FALSE); switch(verify_address(addr, NULL, vopt_is_recipient | vopt_qualify, -1, - -1, NULL, NULL, NULL)) + -1, -1, NULL, NULL, NULL)) { case OK: s = string_sprintf("250 <%s> is deliverable", address); @@ -3108,7 +3127,8 @@ while (done <= 0) BOOL save_log_testing_mode = log_testing_mode; address_test_mode = log_testing_mode = TRUE; (void) verify_address(deliver_make_addr(smtp_data, FALSE), smtp_out, - vopt_is_recipient | vopt_qualify | vopt_expn, -1, -1, NULL, NULL, NULL); + vopt_is_recipient | vopt_qualify | vopt_expn, -1, -1, -1, NULL, NULL, + NULL); address_test_mode = FALSE; log_testing_mode = save_log_testing_mode; /* true for -bh */ } @@ -3174,7 +3194,7 @@ while (done <= 0) protocols[pextend + pcrpted + ((sender_host_authenticated != NULL)? pauthed : 0)] : - protocols[pnormal]) + protocols[pnormal + pcrpted]) + ((sender_host_address != NULL)? pnlocal : 0);