mirror of
https://github.com/spartanz51/tutabridge.git
synced 2026-06-24 10:54:32 +02:00
d07b0bd9113bc60e2e66639709ea7ecaded0272b
The IMAP server was hardcoding BODYSTRUCTURE to a single \"text/html\" entry regardless of the cached envelope. Thunderbird parses the body itself and survived that, but stricter IMAP clients use BODYSTRUCTURE as the source of truth for whether a message has files to save — so multipart messages were rendering with no attachment hints anywhere. New module `mail::bodystructure` walks the cached RFC 2822 (reusing the parser helpers — now `pub(super)` for sibling access), produces a parenthesised RFC 3501 §7.4.2 structure with one entry per MIME part, and propagates Content-Disposition so attachment parts carry their filename. Single-part bodies still emit the previous shape verbatim (no behaviour change for the common case). Eight unit tests cover the happy path (text/html), multipart/mixed with a PDF attachment (asserts `MIXED`, `BOUNDARY`, type/subtype, disposition + filename), nested `multipart/alternative` inside `multipart/mixed` (real-world MUAs), and the helpers (count_lines, quoted, build_params, missing boundary).
Languages
Rust
89.5%
TypeScript
5.9%
CSS
2.5%
Python
1.2%
Shell
0.7%
Other
0.1%