X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Freceive.c;h=c4fb31ea79bb39c3c0cdee0b897782d9256d376f;hb=8544e77a6ed430f7063162906c449f1353d72e58;hp=529a4e2be75a174c117b3e49b0e24a56abca40a5;hpb=9122af941e5a32c3cbf3b6ac45d93158a77928e3;p=exim.git diff --git a/src/src/receive.c b/src/src/receive.c index 529a4e2be..c4fb31ea7 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/receive.c,v 1.52 2009/11/16 12:47:19 tom Exp $ */ +/* $Cambridge: exim/src/src/receive.c,v 1.55 2010/06/05 11:13:30 pdp Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2007 */ +/* Copyright (c) University of Cambridge 1995 - 2009 */ /* See the file NOTICE for conditions of use and distribution. */ /* Code for receiving a message and setting up spool files. */ @@ -1094,7 +1094,7 @@ 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, @@ -2336,9 +2336,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 +2607,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 */