PP/01 Unbreak heimdal_gssapi, broken in 4.92.
+JH/29 Fix DSN Final-Recipient: field. Previously it was the post-routing
+ delivery address, which leaked information of the results of local
+ forwarding. Change to the original envelope recipient address, per
+ standards.
+
Exim version 4.92
-----------------
+/************************************************/
+
+static void
+print_dsn_addr_action(FILE * f, address_item * addr,
+ uschar * action, uschar * status)
+{
+address_item * pa;
+
+if (addr->dsn_orcpt)
+ fprintf(f,"Original-Recipient: %s\n", addr->dsn_orcpt);
+
+for (pa = addr; pa->parent; ) pa = pa->parent;
+fprintf(f, "Action: %s\n"
+ "Final-Recipient: rfc822;%s\n"
+ "Status: %s\n",
+ action, pa->address, status);
+}
+
+
/*************************************************
* Deliver one message *
*************************************************/
if (addr_dsntmp->dsn_orcpt)
fprintf(f,"Original-Recipient: %s\n", addr_dsntmp->dsn_orcpt);
- fprintf(f, "Action: delivered\n"
- "Final-Recipient: rfc822;%s\n"
- "Status: 2.0.0\n",
- addr_dsntmp->address);
+ print_dsn_addr_action(f, addr_dsntmp, US"delivered", US"2.0.0");
if (addr_dsntmp->host_used && addr_dsntmp->host_used->name)
fprintf(f, "Remote-MTA: dns; %s\nDiagnostic-Code: smtp; 250 Ok\n\n",
for (addr = handled_addr; addr; addr = addr->next)
{
host_item * hu;
- fprintf(fp, "Action: failed\n"
- "Final-Recipient: rfc822;%s\n"
- "Status: 5.0.0\n",
- addr->address);
+
+ print_dsn_addr_action(fp, addr, US"failed", US"5.0.0");
+
if ((hu = addr->host_used) && hu->name)
{
fprintf(fp, "Remote-MTA: dns; %s\n", hu->name);
for ( ; addr_dsndefer; addr_dsndefer = addr_dsndefer->next)
{
- if (addr_dsndefer->dsn_orcpt)
- fprintf(f, "Original-Recipient: %s\n", addr_dsndefer->dsn_orcpt);
- fprintf(f, "Action: delayed\n"
- "Final-Recipient: rfc822;%s\n"
- "Status: 4.0.0\n",
- addr_dsndefer->address);
+ print_dsn_addr_action(f, addr_dsndefer, US"delayed", US"4.0.0");
+
if (addr_dsndefer->host_used && addr_dsndefer->host_used->name)
{
fprintf(f, "Remote-MTA: dns; %s\n",
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|callpager
+Final-Recipient: rfc822;page+userx@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|callpager
+Final-Recipient: rfc822;page+ux@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|cat
+Final-Recipient: rfc822;filter-pipe@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;/tmp/junk
+Final-Recipient: rfc822;filter-file@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv
+Final-Recipient: rfc822;pipe@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv
+Final-Recipient: rfc822;prefixed+pipe@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv
+Final-Recipient: rfc822;pipe-suffixed@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv
+Final-Recipient: rfc822;prefixed+pipe-suffixed@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv
+Final-Recipient: rfc822;pipe@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: delayed
-Final-Recipient: rfc822;|/non/existing/file
+Final-Recipient: rfc822;userx@test.ex
Status: 4.0.0
Action: delayed
Reporting-MTA: dns; the.local.host.name
Action: delayed
-Final-Recipient: rfc822;|/non/existing/file
+Final-Recipient: rfc822;userx@test.ex
Status: 4.0.0
Action: delayed
Reporting-MTA: dns; the.local.host.name
Action: delayed
-Final-Recipient: rfc822;|/non/existing/file
+Final-Recipient: rfc822;userx@test.ex
Status: 4.0.0
Action: delayed
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;WASabc@x.y.zWAS
+Final-Recipient: rfc822;"abc@x.y.z"@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;unknown@test.ex
+Final-Recipient: rfc822;forwarder@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;unknown@test.ex
+Final-Recipient: rfc822;forwarder@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv $recipients
+Final-Recipient: rfc822;system-filter
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv $recipients
+Final-Recipient: rfc822;system-filter
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv $recipients
+Final-Recipient: rfc822;system-filter
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv $recipients
+Final-Recipient: rfc822;system-filter
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;hbounce@test.ex
+Final-Recipient: rfc822;useryx@test.ex
Status: 5.0.0
Action: failed
-Final-Recipient: rfc822;bounce@test.ex
+Final-Recipient: rfc822;userxx@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: delayed
-Final-Recipient: rfc822;/no/such/file
+Final-Recipient: rfc822;file@test.ex
Status: 4.0.0
Action: delayed
-Final-Recipient: rfc822;defer@test.ex
+Final-Recipient: rfc822;userxy@test.ex
Status: 4.0.0
Action: delayed
-Final-Recipient: rfc822;hdefer@test.ex
+Final-Recipient: rfc822;useryy@test.ex
Status: 4.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;/a/b/c
+Final-Recipient: rfc822;/a/b/c@no.test.ex
Status: 5.0.0
Action: failed
-Final-Recipient: rfc822;|/p/q/r
+Final-Recipient: rfc822;|/p/q/r@no.test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv
+Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv@yes.test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;/a/b/c
+Final-Recipient: rfc822;/a/b/c@no.test.ex
Status: 5.0.0
Action: failed
-Final-Recipient: rfc822;|/p/q/r
+Final-Recipient: rfc822;|/p/q/r@no.test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; the.local.host.name
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv
+Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv@yes.test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; myhost.test.ex
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv $thisaddress $1
+Final-Recipient: rfc822;system-filter
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; myhost.test.ex
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv $1
+Final-Recipient: rfc822;system-filter
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; myhost.test.ex
Action: failed
-Final-Recipient: rfc822;|TESTSUITE/aux-fixed/showenv $thisaddress $1
+Final-Recipient: rfc822;redking@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; mail.test.ex
Action: failed
-Final-Recipient: rfc822;userx-extra
+Final-Recipient: rfc822;restrict-userx@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; mail.test.ex
Action: failed
-Final-Recipient: rfc822;inbox
+Final-Recipient: rfc822;restrict-userx@test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Reporting-MTA: dns; myhost.test.ex
Action: failed
-Final-Recipient: rfc822;|/bin/echo "Some pipe output"
+Final-Recipient: rfc822;userx@myhost.test.ex
Status: 5.0.0
--NNNNNNNNNN-eximdsn-MMMMMMMMMM