feat(smtp): replace CID references in HTML with attachment preview URLs - #346
Open
Powerhamster wants to merge 2 commits into
Open
feat(smtp): replace CID references in HTML with attachment preview URLs#346Powerhamster wants to merge 2 commits into
Powerhamster wants to merge 2 commits into
Conversation
parseEmail already strips angle brackets from Content-ID at parse time (handler.go:322), so the test's expected value was wrong. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HTP5juELjuCdbVECrKVMSs
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.
Summary
cid:in HTML emails are now replaced with attachment preview URLs (/api/smtp/attachments/{eventUUID}/preview/{attachmentUUID}), so embedded images render correctly in the UI instead of showing brokencid:references.Content-IDare mapped from CID to their preview URL and substituted into the parsed HTML body during SMTP message handling.Test plan
go test ./modules/smtp/...— addedTestParseEmail_InlineAttachmentWithCID,TestReplaceCIDReferences, andTestReplaceCIDReferences_NoCIDcovering CID parsing and replacement, including the no-CID case.