Repository navigation
feat(email): add bounded decoded body views - #85
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Add
email::extract_bodyfor 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.9to 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_bodyprints:Validation:
just pre-prpassed; email-only tests passed without HTML; 17 doctests passed; native Python import/extraction and DOCX CLI smoke passed;just publish-dry-runverified 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
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.