Repository navigation
fix(receiving): keep attachment Content-ID when forwarding with passthrough - #129
Merged
AntoniosBarotsis merged 4 commits intoNov 13, 2026
Conversation
… passthrough The passthrough path read the Content-ID header name (get_key) instead of its value, so every inline attachment was re-sent with content_id="Content-ID" and cid: references in the HTML broke. Extract the attachment mapping into a helper, read the value and strip the angle brackets.
Collaborator
|
Thanks! Found a few more edge cases compared to the node implementation so updated those as well, releasing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forwarding an inbound email with
passthroughbreaks inline images.Cause. In
ReceivingSvc::forwardwithpassthrough, the attachmentContent-IDwas read withMailHeader::get_key(), which returns the header name. Every inline attachment was therefore re-sent withcontent_id = "Content-ID", andcid:references in the HTML no longer resolved.Fix. Read the header value with
get_value()and strip the surrounding</>. The attachment mapping moved into a smallpassthrough_attachments(&[u8])helper so it can be unit tested without the network (behaviour otherwise unchanged). Added a CHANGELOG entry.Test.
receiving::test::passthrough_keeps_attachment_content_idbuilds a multipart message withContent-ID: <logo@example.test>and asserts the serialized attachment hascontent_id == "logo@example.test"(red before:"Content-ID").Reproduction
Raw message: a
multipart/mixedpart withContent-Disposition: attachment; filename=logo.pngandContent-ID: <logo@example.test>;cargo test --lib passthrough.This PR was prepared with the assistance of an AI tool (Claude Code).
Summary by cubic
Fixes forwarding inbound emails with
passthroughso inline images keep working.The passthrough path read the
Content-IDheader name instead of its value, so attachments were re-sent withcontent_id = "Content-ID"andcid:references in the HTML no longer resolved.cid:images are kept.Content-Typenameparameter for filenames and allows attachments without a filename.passthrough_contenthelpers with unit tests; bumped to0.35.3and updated the CHANGELOG.Written for commit 8cbc065. Summary will update on new commits.