X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/9122af941e5a32c3cbf3b6ac45d93158a77928e3..c4ceed07f17f67af7d96e7fd27c92eb374e62e19:/src/src/receive.c diff --git a/src/src/receive.c b/src/src/receive.c index 529a4e2be..378bb8f3a 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -1,10 +1,8 @@ -/* $Cambridge: exim/src/src/receive.c,v 1.52 2009/11/16 12:47:19 tom Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2007 */ +/* Copyright (c) University of Cambridge 1995 - 2012 */ /* See the file NOTICE for conditions of use and distribution. */ /* Code for receiving a message and setting up spool files. */ @@ -1094,13 +1092,16 @@ return TRUE; DO_MIME_ACL: /* make sure the eml mbox file is spooled up */ -mbox_file = spool_mbox(&mbox_size); +mbox_file = spool_mbox(&mbox_size, NULL); if (mbox_file == NULL) { /* error while spooling */ log_write(0, LOG_MAIN|LOG_PANIC, "acl_smtp_mime: error while creating mbox spool file, message temporarily rejected."); Uunlink(spool_name); unspool_mbox(); +#ifdef EXPERIMENTAL_DCC + dcc_ok = 0; +#endif smtp_respond(US"451", 3, TRUE, US"temporary local problem"); message_id[0] = 0; /* Indicate no message accepted */ *smtp_reply_ptr = US""; /* Indicate reply already sent */ @@ -1180,6 +1181,9 @@ else if (rc != OK) { Uunlink(spool_name); unspool_mbox(); +#ifdef EXPERIMENTAL_DCC + dcc_ok = 0; +#endif if (smtp_handle_acl_fail(ACL_WHERE_MIME, rc, user_msg, log_msg) != 0) *smtp_yield_ptr = FALSE; /* No more messsages after dropped connection */ *smtp_reply_ptr = US""; /* Indicate reply already sent */ @@ -2336,9 +2340,11 @@ if (msgid_header == NULL && } } - /* Add the header line */ + /* Add the header line + * Resent-* headers are prepended, per RFC 5322 3.6.6. Non-Resent-* are + * appended, to preserve classical expectations of header ordering. */ - header_add_at_position(FALSE, NULL, FALSE, htype_id, + header_add_at_position(!resents_exist, NULL, FALSE, htype_id, "%sMessage-Id: <%s%s%s@%s>\n", resent_prefix, message_id_external, (*id_text == 0)? "" : ".", id_text, id_domain); } @@ -2605,13 +2611,15 @@ changes in RFC 2822, this was dropped in November 2003. */ /* If there is no date header, generate one if the message originates locally (i.e. not over TCP/IP) and suppress_local_fixups is not set, or if the submission mode flag is set. Messages without Date: are not valid, but it seems -to be more confusing if Exim adds one to all remotely-originated messages. */ +to be more confusing if Exim adds one to all remotely-originated messages. +As per Message-Id, we prepend if resending, else append. +*/ if (!date_header_exists && ((sender_host_address == NULL && !suppress_local_fixups) || submission_mode)) - header_add_at_position(FALSE, NULL, FALSE, htype_other, "%sDate: %s\n", - resent_prefix, tod_stamp(tod_full)); + header_add_at_position(!resents_exist, NULL, FALSE, htype_other, + "%sDate: %s\n", resent_prefix, tod_stamp(tod_full)); search_tidyup(); /* Free any cached resources */ @@ -3012,14 +3020,29 @@ else appears in the expanded list. */ if (seen_items != NULL) { + uschar *seen_item = NULL; + uschar seen_item_buf[256]; uschar *seen_items_list = seen_items; - if (match_isinlist(item, - &seen_items_list,0,NULL,NULL,MCL_STRING,TRUE,NULL) == OK) + int seen_this_item = 0; + + while ((seen_item = string_nextinlist(&seen_items_list, &sep, + seen_item_buf, + sizeof(seen_item_buf))) != NULL) + { + if (Ustrcmp(seen_item,item) == 0) + { + seen_this_item = 1; + break; + } + } + + if (seen_this_item > 0) { DEBUG(D_receive) debug_printf("acl_smtp_dkim: skipping signer %s, already seen\n", item); continue; } + seen_items = string_append(seen_items,&seen_items_size,&seen_items_offset,1,":"); } @@ -3087,6 +3110,9 @@ else Uunlink(spool_name); #ifdef WITH_CONTENT_SCAN unspool_mbox(); +#endif +#ifdef EXPERIMENTAL_DCC + dcc_ok = 0; #endif if (smtp_handle_acl_fail(ACL_WHERE_DATA, rc, user_msg, log_msg) != 0) smtp_yield = FALSE; /* No more messsages after dropped connection */ @@ -3126,6 +3152,9 @@ else Uunlink(spool_name); #ifdef WITH_CONTENT_SCAN unspool_mbox(); +#endif +#ifdef EXPERIMENTAL_DCC + dcc_ok = 0; #endif /* The ACL can specify where rejections are to be logged, possibly nowhere. The default is main and reject logs. */ @@ -3459,6 +3488,9 @@ if ((log_extra_selector & LX_tls_certificate_verified) != 0 && if ((log_extra_selector & LX_tls_peerdn) != 0 && tls_peerdn != NULL) s = string_append(s, &size, &sptr, 3, US" DN=\"", string_printing(tls_peerdn), US"\""); +if ((log_extra_selector & LX_tls_sni) != 0 && tls_sni != NULL) + s = string_append(s, &size, &sptr, 3, US" SNI=\"", + string_printing(tls_sni), US"\""); #endif if (sender_host_authenticated != NULL)