C12.2: read and write MIME by the tree

The reader walks the MIME tree with its container context: alternative
picks versions, related finds its root by start, attached multiparts
stay whole, digest children are messages. Nesting deeper than 64
levels, counting enclosed messages, is refused, and over-deep parse
results are taken apart iteratively so dropping them cannot overflow
the stack. Composite parts with a Content-ID are cid targets.

The writer keeps attachment parameters and Content-IDs, writes
multipart and message attachments unencoded, and makes its own
Message-ID. SMTP adds BODY=8BITMIME for 8-bit bodies and SMTPUTF8
when any header block at any depth is 8-bit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-19 17:35:05 -04:00
1 parent 9f47b94714
commit fe90221c11
23 files changed
+1672 -136

No files matched your search

+2
View File
@@ -58,6 +58,8 @@ security-framework = "3.7"
objc2-pdf-kit = { version = "0.3", default-features = false, features = ["PDFDocument", "PDFPage", "objc2-app-kit"] }
imap-proto = "0.17"
nom = "8"
mail-builder = { version = "1.0", default-features = false }
mail-parser = { version = "0.11", features = ["full_encoding"] }
mail-send = { version = "0.6", default-features = false, features = ["ring", "tls12"] }
rcgen = "0.14"
rustls = { version = "0.23", default-features = false, features = ["ring", "tls12", "std"] }