Skip to content

Remove Original-Recipient and Final-Recipient fields from MDNs - #8645

Merged
link2xt merged 2 commits into
mainfrom
link2xt/remove-mdn-original-recipient
Sep 3, 2026
Merged

Remove Original-Recipient and Final-Recipient fields from MDNs#8645
link2xt merged 2 commits into
mainfrom
link2xt/remove-mdn-original-recipient

Conversation

@link2xt

@link2xt link2xt commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

There are two commits, first removes Original-Recipient which was used incorrectly. Second removes Final-Recipient, which is formally required by RFC, but was not set correctly too and is not used anyway.
This is part of #8572, i was looking into why mimefactory still needs to know the "primary" address even with #8619

Commit messages copy-pasted below for convenience:


According to
https://datatracker.ietf.org/doc/html/rfc8098#section-3.2.3 Original-Recipient field values in MDNs MUST NOT be included if the information about original recipient is not available. Original recipient may be obtained from ORCPT parameter of SMTP envelope or from Original-Recipient header which MTAs are expected to convert Original-Recipient to.

The way we have been using Original-Recipient field is not correct. Technically we should look for Original-Recipient header on the message when downloading it from IMAP
and then copy the value into MDN,
but simply assuming it is never there is more correct than always assuming it is the same as our current address.

I also grepped for Original-Recipient
and removed it together with Reporting-UA from the tests. Orignal-Recipient is now only left in NDN (bounce messages) test data, there it is correct as this field is added by MTAs that have direct access to ORCPT parameter.


This Final-Recipient was not set to the correct value anyway.
We could query the database and find out via imap table
which transport we have received the message on,
but it is not worth the effort as the field is not practically used
and cannot be relied on as old versions still send incorrect value.

This removes one call to get_primary_self_addr()
to make it easier to remove the concept of the "primary"
address eventually.

@link2xt
link2xt force-pushed the link2xt/remove-mdn-original-recipient branch from 5fc0e69 to 35fffe8 Compare September 1, 2026 18:05
@link2xt link2xt changed the title feat: remove Original-Recipient field from MDNs fix: remove Original-Recipient field from MDNs Sep 1, 2026
@link2xt

This comment was marked as outdated.

@link2xt
link2xt marked this pull request as ready for review September 1, 2026 18:19
@link2xt
link2xt marked this pull request as draft September 1, 2026 18:32
@link2xt
link2xt force-pushed the link2xt/remove-mdn-original-recipient branch from 7ede343 to 30ccb96 Compare September 1, 2026 18:41
@link2xt
link2xt marked this pull request as ready for review September 1, 2026 18:46
@link2xt link2xt changed the title fix: remove Original-Recipient field from MDNs Remove Original-Recipient and Final-Recipient fields from MDNs Sep 1, 2026
According to
<https://datatracker.ietf.org/doc/html/rfc8098#section-3.2.3>
Original-Recipient field values in MDNs MUST NOT be included
if the information about original recipient is not available.
Original recipient may be obtained from ORCPT parameter
of SMTP envelope or from Original-Recipient header
which MTAs are expected to convert Original-Recipient to.

The way we have been using Original-Recipient field is not correct. 
Technically we should look for Original-Recipient header
on the message when downloading it from IMAP
and then copy the value into MDN,
but simply assuming it is never there is more correct
than always assuming it is the same as our current address.

I also grepped for Original-Recipient
and removed it together with Reporting-UA from the tests.
Orignal-Recipient is now only left in NDN (bounce messages) test data,
there it is correct as this field is added by MTAs
that have direct access to ORCPT parameter.
This Final-Recipient was not set to the correct value anyway.
We could query the database and find out via `imap` table
which transport we have received the message on,
but it is not worth the effort as the field is not practically used
and cannot be relied on as old versions still send incorrect value.

This removes one call to get_primary_self_addr()
to make it easier to remove the concept of the "primary"
address eventually.
@link2xt
link2xt force-pushed the link2xt/remove-mdn-original-recipient branch from 30ccb96 to c1258c2 Compare September 3, 2026 00:40
@Hocuri
Hocuri self-requested a review September 3, 2026 15:53
@link2xt
link2xt merged commit a516829 into main Sep 3, 2026
30 checks passed
@link2xt
link2xt deleted the link2xt/remove-mdn-original-recipient branch September 3, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants