Files
ElyOffice/tasks/reviews/C12.1-r3.md
T
ZacharyZhang-NYandClaude Opus 5.5 9f47b94714 C12.1: ely-mail-engine connects over IMAP, POP3 and SMTP
TLS or STARTTLS with the system trust store; password and XOAUTH2
logins keep the server's words on refusal. IMAP and POP3 are written
in the engine (imap-proto parses IMAP replies): async-imap dropped
NO/BAD on LIST and FETCH and lost BYE text, async-pop kept dot
stuffing and logged passwords. SMTP runs its own transaction with
RFC 5321 mailbox checks, full dot transparency, SMTPUTF8 and RSET.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 16:53:53 -04:00

1.9 KiB

FAIL

  1. crates/ely-mail-engine/src/imap.rs:68 — [P2] Quoted LIST mailbox names retain their wire escapes. imap-proto's quoted-string parser returns the escaped interior, so a server listing the folder a"b as "a\"b" makes mailboxes() return a name containing an extra backslash. Passing that returned name to fetch() escapes it again in EXAMINE and addresses a different folder, preventing retrieval from the listed folder. Backslashes are similarly doubled. Decode quoted-string escapes at the response boundary, preserving literal mailbox contents unchanged, and cover LIST-to-fetch round trips for both representations (RFC 3501 string syntax). Reproduced on Windows and Linux: imap_list_decodes_quoted_mailbox_names and imap_fetch_from_a_listed_quoted_mailbox_uses_its_name; literal-name control passes. Evidence: .work/c12.1-r3-windows-probe.log, .work/c12.1-r3-linux-probe.log.

  2. crates/ely-mail-engine/src/smtp.rs:85 — [P2] SMTPUTF8 is checked only for envelope addresses, ignoring internationalized message headers. With ASCII sender and recipients but Subject: 您好, the engine omits SMTPUTF8 from MAIL even when advertised. When the server does not advertise it, the engine still transmits the UTF-8 header and can return Ok(()). This violates RFC 6531 §3.2 and §3.4 and can make otherwise supported internationalized messages fail submission or subsequent relay. Include the message's SMTPUTF8 requirement in the send contract and capability check, reject unsupported messages before MAIL, and add the parameter when required; test ASCII envelopes with UTF-8 headers against both capability responses. Reproduced on Windows and Linux: smtp_utf8_header_requests_smtputf8_with_ascii_envelope and smtp_utf8_header_refused_without_smtputf8; the two probe logs above.