Skip to content

feat(email): expand Outlook MSG body and attachment previews - #303

Merged
wybaby168 merged 3 commits into
mainfrom
feature/outlook-msg-complete-preview
Sep 18, 2026
Merged

wybaby168 merged 3 commits into
mainfrom
feature/outlook-msg-complete-preview

Conversation

@wybaby168

@wybaby168 wybaby168 commented Sep 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Complete the existing MSG preview path with Unicode/ANSI and binary HTML decoding, separate To/Cc/Bcc, on-behalf-of sender metadata, local CID/Content-Location images, lazy attachment extraction and embedded MSG previews.
  • Add bounded CFB preflight and MELA/LZFu RTF decompression. Reuse the existing Word/RTF capability through renderNestedBuffer; retain readable text and explicit capability notices when rich rendering is unavailable.
  • Isolate email HTML with an empty-sandbox iframe and restrictive CSP, and fix body/attachment sizing, close/focus behavior, cancellation races and resource disposal.
  • Add generated CFB fixtures, focused tests, a Chromium UI gate, screenshot evidence and bilingual documentation. No runtime dependency, version, lockfile or public core API change.
  • Fix a type error from the merged main baseline: remove the unsupported sourceUrl field from the nested renderNestedBuffer context in email.ts (it is not part of FileRenderContext).

Related issue

N/A: maintainer-requested completion of existing Outlook MSG preview support; no separate tracking issue was supplied.

Change classification

  • User-visible UI or rendering change
  • Non-visual change
  • File-format or renderer behavior
  • Public API, package, Worker, WASM, or deployment-path change

Package verification scripts change; runtime dependencies and public API do not.

Verification

Check Result
pnpm --filter @file-viewer/renderer-email build Pass
pnpm --filter @file-viewer/renderer-email type-check Pass
node --test packages/renderers/email/test/msg.test.mjs Pass — 53 passed, 0 failed
pnpm --filter @file-viewer/renderer-email verify:msg:browser Pass — 34 Chromium assertions, no external requests or page errors

Sample / fixture evidence

  • Fixture generator (repository path): https://github.com/flyfish-dev/file-viewer/blob/feature/outlook-msg-complete-preview/packages/renderers/email/test/fixtures/msg-fixture.mjs
  • packages/renderers/email/test/fixtures/msg-fixture.mjs generates real CFB v3/v4 messages with FAT/DIFAT/MiniFAT, Unicode/ANSI properties, recipient rows, raster CID attachments, compressed RTF and embedded message storage.
  • packages/renderers/email/test/msg.test.mjs includes default-on installed-MsgReader parsing and embedded-MSG extraction/reparse cases.
  • Provenance and limitations: packages/renderers/email/test/fixtures/README.md. These are original Apache-2.0 fixtures using example.test, not customer emails or renamed text files.

Visual evidence

After: real Chromium UI capture, 1180 × 760 viewport, reduced to 900 × 580 for this image. It uses the explicit Reader API fixture, not an Outlook reference image or real-parser end-to-end capture. The browser gate also produces mobile and dark screenshots plus a JSON report.

MSG preview: recipient groups, HTML table, inline image and attachments

Before: the reviewed MSG adapter ignored bodyHtml, treated binary html as a string, grouped all recipients into To, and did not register MSG CID resources or render its RTF body. No matched before screenshot was captured.

Risk and compatibility

  • Affected packages/formats: @file-viewer/renderer-email; MSG parsing and shared EML/MBOX HTML presentation. MBOX remains first-message preview, not a mailbox browser.
  • Compatibility or migration risk: email HTML no longer loads remote tracking images/styles or activates external hyperlinks; body RTF forces external resources and links off regardless of host opt-ins. Full preset already registers Word/RTF; selective installs must add the documented Word renderer/RTF capability for rich RTF. No new runtime dependency. S/MIME/IRM decryption, signature verification, OLE activation and complete Outlook contacts/tasks/calendar behavior are not implemented; no pixel-identical Outlook claim is made.
  • Rollback: revert this focused commit; no data or configuration migration is required.

Checklist

  • I added or updated focused automated coverage, or explained why it is not needed.
  • I updated user-facing documentation or release notes when behavior or API changed, or marked them not applicable.
  • I verified offline/private-deployment paths when changing Worker, WASM, fonts, vendor assets, or URLs. Local inline-image isolation is covered; no new deployment assets are introduced.
  • I did not commit secrets, customer files, private samples, generated caches, or unrelated changes.

wybaby168 and others added 3 commits September 18, 2026 17:20
Decode Unicode/ANSI and binary HTML bodies, preserve recipient groups and
local inline images, add bounded compressed-RTF handling, and reuse the
existing nested-renderer contract for rich text and embedded messages.

Isolate untrusted email HTML and clean up cancelled body/attachment views.
Add deterministic CFB fixtures, parser tests, a Chromium UI gate and docs.

Validation: 48 offline unit checks and 34 Chromium API-fixture checks pass.
Five installed-MsgReader tests and full workspace verification remain pending.
Preserve the newly merged Vue error callback and image rotation changes.
Email files are unchanged from the locally verified blob hashes.
Co-authored-by: Cursor <cursoragent@cursor.com>
@wybaby168
wybaby168 marked this pull request as ready for review September 18, 2026 09:59
@wybaby168
wybaby168 merged commit 10eb500 into main Sep 18, 2026
9 of 12 checks passed
@wybaby168
wybaby168 deleted the feature/outlook-msg-complete-preview branch September 18, 2026 11:51
wybaby168 added a commit that referenced this pull request Sep 19, 2026
* feat(email): expand Outlook MSG body and attachment previews

Decode Unicode/ANSI and binary HTML bodies, preserve recipient groups and
local inline images, add bounded compressed-RTF handling, and reuse the
existing nested-renderer contract for rich text and embedded messages.

Isolate untrusted email HTML and clean up cancelled body/attachment views.
Add deterministic CFB fixtures, parser tests, a Chromium UI gate and docs.

Validation: 48 offline unit checks and 34 Chromium API-fixture checks pass.
Five installed-MsgReader tests and full workspace verification remain pending.

* fix(email): drop unsupported sourceUrl from nested render context
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