From: Todd Lyons Date: Wed, 30 Apr 2014 00:07:04 +0000 (-0700) Subject: Merge branch 'master' of ssh://git.exim.org/home/git/exim X-Git-Tag: exim-4_83_RC1~43 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/eea58ada63dde3265728daccc037d3a376b25f45?hp=578897ea8764001d0538b8b645d161524ba1fa4e Merge branch 'master' of ssh://git.exim.org/home/git/exim --- diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 0ecbaac5a..afc15d433 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -4221,6 +4221,20 @@ option sets the IP interface address value. A port number may be included, using the same syntax as for &%-oMa%&. The interface address is placed in &$received_ip_address$& and the port number, if present, in &$received_port$&. +.vitem &%-oMm%&&~<&'message&~reference'&> +.oindex "&%-oMm%&" +.cindex "message reference" "message reference, specifying for local message" +See &%-oMa%& above for general remarks about the &%-oM%& options. The &%-oMm%& +option sets the message reference, e.g. message-id, and is logged during +delivery. This is useful when some kind of audit trail is required to tie +messages together. The format of the message reference is checked and will +abort if the format is invalid. The option will only be accepted if exim is +running in trusted mode, not as any regular user. + +The best example of a message reference is when Exim sends a bounce message. +The message reference is the message-id of the original message for which Exim +is sending the bounce. + .vitem &%-oMr%&&~<&'protocol&~name'&> .oindex "&%-oMr%&" .cindex "protocol, specifying for local message" diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index d4240fa29..172748584 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -100,6 +100,10 @@ TL/09 Bugzilla 609: Add -C option to exiqgrep, specify which exim.conf to use. JH/19 EXPERIMENTAL_OCSP support under GnuTLS. Bug 1459. +TL/10 Bugzilla 1454: New -oMm option to pass message reference to Exim. + Requires trusted mode and valid format message id, aborts otherwise. + Patch contributed by Heiko Schlichting. + Exim version 4.82 ----------------- diff --git a/doc/doc-txt/OptionLists.txt b/doc/doc-txt/OptionLists.txt index 4ad112180..ef6195600 100644 --- a/doc/doc-txt/OptionLists.txt +++ b/doc/doc-txt/OptionLists.txt @@ -714,6 +714,7 @@ provide compatibility with Sendmail. -oMai # Supply authenticated id -oMas # Supply authenticated sender -oMi # Supply interface address +-oMm # Supply message reference -oMr # Supply protocol name -oMs # Supply host name -oMt # Supply ident string diff --git a/src/src/exim.c b/src/src/exim.c index 3ab657fea..fa0cf4940 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -2989,6 +2989,23 @@ for (i = 1; i < argc; i++) else if (Ustrcmp(argrest, "Mi") == 0) interface_address = argv[++i]; + /* -oMm: Message reference */ + + else if (Ustrcmp(argrest, "Mm") == 0) + { + if (!mac_ismsgid(argv[i+1])) + { + fprintf(stderr,"-oMm must be a valid message ID\n"); + exit(EXIT_FAILURE); + } + if (!trusted_config) + { + fprintf(stderr,"-oMm must be called by a trusted user/config\n"); + exit(EXIT_FAILURE); + } + message_reference = argv[++i]; + } + /* -oMr: Received protocol */ else if (Ustrcmp(argrest, "Mr") == 0) received_protocol = argv[++i]; diff --git a/test/scripts/0000-Basic/0040 b/test/scripts/0000-Basic/0040 index 3353ec233..12d675043 100644 --- a/test/scripts/0000-Basic/0040 +++ b/test/scripts/0000-Basic/0040 @@ -1,3 +1,12 @@ # Checking -oMa etc exim -odi -f jc@rome -F 'Julius Caesar' -oMa 1.1.1.1 -oMi 2.2.2.2 -oMr latin -oMs forum.rome -oMt jc44bc userx@test.ex This is a test message. +**** +1 +exim -odi -f jc@rome -F 'Julius Caesar' -oMm 123456-67890-11 -oMt jc44bc userx@test.x +This is a test message. +**** +1 +exim -odi -f jc@rome -F 'Julius Caesar' -oMm 10HmaX-0005vi-00 -oMt jc44bc userx@test.x +This is a test message. +**** diff --git a/test/stderr/0040 b/test/stderr/0040 new file mode 100644 index 000000000..f72bc868b --- /dev/null +++ b/test/stderr/0040 @@ -0,0 +1,2 @@ +-oMm must be a valid message ID +-oMm must be called by a trusted user/config