Skip to content

feat(email): add bounded decoded body views - #85

Merged
chaliy merged 3 commits into
mainfrom
feat/decoded-email-views
Nov 26, 2026
Merged

chaliy merged 3 commits into
mainfrom
feat/decoded-email-views

Conversation

@chaliy

@chaliy chaliy commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Add email::extract_body for provider-decoded text/HTML alternatives, returning clean/full views and reversible UTF-8 omission spans. Only trailing quotes and exact mobile signatures are hidden; forwarded and interleaved replies remain intact. Text stays plain text; HTML fallback uses the existing extractor. Input, output, line-count and deadline limits include preservation shortcuts and empty bodies.

Require url >= 2.5.9 to clear RUSTSEC-2026-0592 found during validation. Refresh both lockfiles. No version bump or binding API changes.

Why

Inbox integrations need concise previews without synthesizing MIME or losing normalized context. Cleanup is neither authentication nor a prompt-injection verdict.

Before / After

Before: decoded alternatives had no clean/full body API.

After, cargo run -p markkit --features email --example email_body prints:

Clean: Yes, please.
Preserved quoted_history: On Monday Alice wrote:
> Should we reschedule?

Validation: just pre-pr passed; email-only tests passed without HTML; 17 doctests passed; native Python import/extraction and DOCX CLI smoke passed; just publish-dry-run verified packaging without uploading. A failing regression reproduced the forwarded-body limit bypass before the fix.

Risk

Medium: untrusted email processing. Full normalized content is preserved; no network or attachment fetch. Plain-text views must be rendered as text. Existing EML and binding APIs are unchanged.

The baseline scheduled Fuzz run fails in the Markdown oracle and XLS memory handling, outside these email paths. No fuzz policy was relaxed. PR and merge-commit shipping checks must pass.

Checklist

  • Tests added or updated
  • Backward compatibility considered

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@chaliy
chaliy merged commit c7cf1e4 into main Nov 26, 2026
15 checks passed
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