Skip to content

feat: remove hidden headers - #8543

Open
link2xt wants to merge 1 commit into
mainfrom
link2xt/slprvxtzlkzr
Open

feat: remove hidden headers#8543
link2xt wants to merge 1 commit into
mainfrom
link2xt/slprvxtzlkzr

Conversation

@link2xt

@link2xt link2xt commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Most importantly, this removes wrapping unencrypted messages into multipart/mixed with a single part.

Closes #8542

@link2xt
link2xt force-pushed the link2xt/slprvxtzlkzr branch from a0ea20e to fbe0a75 Compare August 4, 2026 13:47
@link2xt
link2xt marked this pull request as ready for review August 4, 2026 13:55

@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.

Do we have some mechanisms that prevents "Chat-" headers from being added to unencrypted messages? If not, then probably we need one? Would be bad if there was a bug that a Chat-Broadcast-Secret can be added to unencrypted messages

Comment thread src/mimefactory/mimefactory_tests.rs Outdated
@link2xt
link2xt force-pushed the link2xt/slprvxtzlkzr branch from fbe0a75 to dd88156 Compare August 6, 2026 16:20
@link2xt

link2xt commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Do we have some mechanisms that prevents "Chat-" headers from being added to unencrypted messages? If not, then probably we need one? Would be bad if there was a bug that a Chat-Broadcast-Secret can be added to unencrypted messages

I don't think there is any protection against this. The easiest way will be to check will_be_encrypted in render_headers and not create such headers if the message is not going to be encrypted.

@hpk42 hpk42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me. Am a bit unsure about unencrypted messages. Maybe makes sense to mention in the commit message that unencrypted messages don't have an embedded second Message-Id copy, if i see it correctly.

Comment thread src/mimefactory.rs
Comment on lines -2361 to -2363
debug_assert_ne!(header_name, "from");
debug_assert_ne!(header_name, "message-id");
debug_assert_ne!(header_name, "autocrypt");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

these checks are now gone, right? so in theory someone can push those headers without debug asserts tripping over it.

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.

Remove hidden headers

3 participants