Skip to content

[MT-23016] Resolve inline CID images safely in HTML previews#35

Closed
kyrylo-yevdokymov wants to merge 2 commits into
mainfrom
codex/mt-23016-inline-cid-images
Closed

[MT-23016] Resolve inline CID images safely in HTML previews#35
kyrylo-yevdokymov wants to merge 2 commits into
mainfrom
codex/mt-23016-inline-cid-images

Conversation

@kyrylo-yevdokymov

@kyrylo-yevdokymov kyrylo-yevdokymov commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What & why

Fixes MT-23016, a sub-task of MT-22849.

Browsers cannot resolve MIME cid: references directly. The preview now maps known content IDs in HTML URL attributes and CSS url() values to the existing attachment-part endpoint. Matching is intentionally limited to URL contexts so visible message text is never rewritten.

Impact

Inline images render in the HTML preview and popout while HTML Source remains unchanged.

Verification

  • npm test — 67 tests passed
  • npm run lint — 0 errors; 4 existing warnings
  • npm run build — passed
  • git diff --check main...codex/mt-23016-inline-cid-images — passed

Kyrylo Yevdokymov and others added 2 commits July 13, 2026 13:24
Emails embed inline images as MIME parts referenced via cid: URLs
(RFC 2392), which browsers cannot resolve, so the HTML tab's preview
iframe rendered them as broken icons. The backend already serves part
bytes by part_id with the original Content-Type, and the message JSON
carries content_id for inline parts + attachments — nothing rewrote
the references.

Rewrite cid:<content-id> refs to origin-absolute part URLs before
handing the HTML to MessagePreview (absolute so they also resolve in
the blob:-based "open in new tab" popout). The HTML Source tab keeps
the original markup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d0502ad-44a1-4bca-9557-0533d61e3144

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kyrylo-yevdokymov

Copy link
Copy Markdown
Contributor Author

Replaced by #41 using the repository-standard fix/mt-23016-inline-cid-images branch.

@kyrylo-yevdokymov
kyrylo-yevdokymov deleted the codex/mt-23016-inline-cid-images branch July 13, 2026 10:35
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