Skip to content

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

Merged
butschster merged 2 commits into
buggregator:masterfrom
Powerhamster:feature/smtp-embedded-images
Aug 17, 2026
Merged

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

Conversation

@Powerhamster

@Powerhamster Powerhamster commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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
@butschster butschster self-assigned this Aug 17, 2026
@butschster butschster added the module: smtp Affects module: smtp label Aug 17, 2026
@butschster
butschster merged commit 11e2ae3 into buggregator:master Aug 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: smtp Affects module: smtp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants