Repository navigation
feat(receiver): port the email parser to mail-parser 1.0.1 (web 0.62.5) - #588
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
…on guard (#610) Folds Dependabot #592, #590, #587, #585, #586 and #589 (Python SDK dev deps, uuid 1.29, statoss 0.1.1, futures-util 0.3.34, unicode-width 0.2.3, setup-uv 10.3.3). Scoped override moves typescript-eslint's minimatch 10 to 11 (GHSA-g3hv-75wg-m249). The SDK's agent credentials writer refuses prototype-named issuers and unknown slot names and reads entries as own properties (CodeQL js/prototype-polluting-assignment). mail-parser 1.0 (#588) is left for a separate change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
df1d877 to
035caf7
Compare
035caf7 to
1f4ceac
Compare
|
@coderabbitai review |
Action not completed
|
Bumps [mail-parser](https://github.com/stalwartlabs/mail-parser) from 0.11.9 to 1.0.0. - [Release notes](https://github.com/stalwartlabs/mail-parser/releases) - [Changelog](https://github.com/stalwartlabs/mail-parser/blob/main/CHANGELOG.md) - [Commits](https://github.com/stalwartlabs/mail-parser/commits) --- updated-dependencies: - dependency-name: mail-parser dependency-version: 1.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
mail-parser 1.0 is a rewrite with a read-only view API. Port apps/receiver-rs/src/mail/parse.rs to it and move to 1.0.1, which fixes parameters folded after "=" (filename, name, boundary). The stored document keeps its shape and, for ordinary mail, its content: - Attachments are 1.0's RFC 8621 list plus every other leaf that is not text shown in a body. RFC 8621 leaves out an image shown inline in both bodies (Apple Mail's pasted photo) and a text part of an alternative it discards; 0.11 listed both, so they stay listed. - Text and HTML attachments are stored converted to UTF-8 from their charset and a forwarded message as its raw message, as 0.11 stored them. Sizes come from decoded_len() when the bytes are not kept. - A blank Subject or Message-ID stays null (1.0 reads it as ""). Changes that come from 1.0 itself, all fixes: a boundary inside a line no longer ends a part (0.11 cut the text off there); a message that forwards several messages lists each; header names with a space, a control character or a leading colon are no longer read as From or Subject; the last quantum of unpadded base64 is kept; UTF-7 and UTF-16 decode correctly. RFC 8621 edge cases also move: a named text/html alternative after text/plain is an attachment, and a text/plain with Content-Disposition: attachment inside an alternative is too. Checked by running the old and new parser side by side over mail-parser's corpora (309 messages plus mbox and maildir samples) and hand-made Apple Mail, Outlook and attachment messages: everything not listed above is identical, and an 11 MB message parses in about a third of the time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RFC 8621, which mail-parser 1.0 follows, makes a text/html version of a multipart/alternative an attachment when it carries a file name and follows the text/plain one. Mail clients still show it as the message and 0.11 read it as the HTML body, so read it as the HTML body (and do not list it as an attachment) when the HTML body has no HTML otherwise. Content-Disposition: attachment still makes it an attachment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
87be17b to
08c0ee7
Compare
|
@coderabbitai full review |
Action not completed
|
- Keep the named HTML parts as parts, not ids: the HTML body no longer searches every part once per id, and the attachment filter is a binary search. An alternative of 9,990 named HTML parts took 113 ms; it now parses as fast as on 0.11. - When the text body yields no text, convert the named HTML, as for HTML-only mail, so such a message has text and text_from_html. - Changelog: text and HTML parts marked as attachments, or text parts with a file name, are listed as attachments now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dependabot's bump of
mail-parserfrom 0.11.9 to 1.0 did not build: 1.0 is a rewrite with a read-only view API. This PR portsapps/receiver-rs/src/mail/parse.rs, the only user, to it and moves to 1.0.1, which fixes parameters folded after=(filename,name,boundary). It is rebased on main.What the stored email document does
The document's shape stays the same. For ordinary mail its content does too:
Attachments are 1.0's RFC 8621 list plus every other leaf that is not text shown in a body. RFC 8621 leaves out two kinds of part that 0.11 listed:
Both stay listed.
Named HTML alternative: a
text/htmlalternative with aname=after thetext/plainstays the HTML body. RFC 8621 would make it an attachment, but mail clients show it as the message, and so did 0.11.Attachment bytes: text and HTML attachments are stored converted to UTF-8 from their charset, and a forwarded message is stored as its raw message, both as in 0.11.
Sizes: when the bytes are not kept,
decoded_len()gives the size without decoding.Blank fields: a blank
SubjectorMessage-IDstays null. 1.0 reads it as"", which would change the forwarded JSON.Changes 1.0 brings, all fixes
Fr om:,:From:) are no longer read asFromorSubject.text/plainmarkedContent-Disposition: attachmentinside an alternative is now an attachment, and a headers-only root part markedattachmentis listed as an empty attachment.How it was checked
parse.rsran side by side over mail-parser's corpora (309 messages, plus mbox and maildir samples) and hand-made Apple Mail, Outlook,cid:image, forwarded-message, Latin-1 CSV and UTF-16 messages. Everything not listed above came out identical in document, header map and attachment bytes.attachments().cargo test --locked(329 passed),cargo clippy --locked --all-targets -- -D warnings,cargo fmt --check. MSRV 1.98 matches the local toolchain and therust:1.98Docker builder.The web version is 0.62.5 because #616 takes 0.62.4.
🤖 Generated with Claude Code