Skip to content

feat(smtp): replace CID references in HTML with attachment preview URLs - #346

Open
Powerhamster wants to merge 2 commits into
buggregator:masterfrom
Powerhamster:feature/smtp-embedded-images
Open

feat(smtp): replace CID references in HTML with attachment preview URLs#346
Powerhamster wants to merge 2 commits into
buggregator:masterfrom
Powerhamster:feature/smtp-embedded-images

Conversation

@Powerhamster

@Powerhamster Powerhamster commented Aug 14, 2026

Copy link
Copy Markdown

Summary

  • Inline images referenced via 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 broken cid: references.
  • Attachments with a Content-ID are mapped from CID to their preview URL and substituted into the parsed HTML body during SMTP message handling.

Test plan

  • go test ./modules/smtp/... — added TestParseEmail_InlineAttachmentWithCID, TestReplaceCIDReferences, and TestReplaceCIDReferences_NoCID covering CID parsing and replacement, including the no-CID case.

Powerhamster and others added 2 commits August 14, 2026 19:28
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
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.

1 participant