Skip to content

fix: use correct address in encrypted From header of MDNs - #8746

Closed
link2xt wants to merge 1 commit into
mainfrom
link2xt/mdn-encrypted-from
Closed

link2xt wants to merge 1 commit into
mainfrom
link2xt/mdn-encrypted-from

Conversation

@link2xt

@link2xt link2xt commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

From address is now passed into MimeFactory::from_mdn(), so MimeFactory.from_addr is set correctly.
It is used to build encrypted From header, which is not checked anymore, but should correspond to the outer header.

Follow-up to #8716

EDIT: there is apparently no bug, i created #8748 that makes it obvious that creating QueuedMail for MDN does not use the From address anywhere.

@link2xt
link2xt marked this pull request as ready for review September 24, 2026 13:15
Comment thread src/mimefactory.rs
additional_msg_ids: Vec<String>,
) -> Result<MimeFactory> {
let contact = Contact::get_by_id(context, from_id).await?;
let from_addr = context.get_primary_self_addr().await?;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most interesting part is removal of this get_primary_self_addr(), it is replaced with from_addr passed from outside that is the actual From address.

@link2xt link2xt added the bug Something is not working label Sep 24, 2026
@link2xt
link2xt requested a review from Hocuri September 24, 2026 13:37
@link2xt
link2xt force-pushed the link2xt/mdn-encrypted-from branch from 7a6ff57 to be3deae Compare September 24, 2026 14:26
From address is now passed into MimeFactory::from_mdn(),
so MimeFactory.from_addr is set correctly.
It is used to build encrypted From header,
which is not checked anymore, but should correspond
to the outer header.
@link2xt
link2xt force-pushed the link2xt/mdn-encrypted-from branch from be3deae to 6a876cf Compare September 24, 2026 14:29

@Hocuri Hocuri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to get rid of another use of get_primary_self_addr()

@link2xt link2xt removed the bug Something is not working label Sep 24, 2026
@link2xt

link2xt commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

I'm actually not sure there is a bug that can be tested, we don't use MimeFactory.from_addr to create the inner From header, and for MDNs there should be no Sender header where it might be used.

@link2xt

link2xt commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

I have created #8748 that includes this commit, it is a refactoring that makes it obvious that From address is not used.

@link2xt

link2xt commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

I will close this, I think it is better to squash #8748 into a single commit.

@link2xt link2xt closed this Sep 24, 2026
@link2xt
link2xt deleted the link2xt/mdn-encrypted-from branch September 24, 2026 20:36
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