Files
inbuxa-server/crates/imap-proto
jcoffey-dev 9d369845e9 IMAP: mailbox names with line breaks no longer split a response
JMAP Mailbox/set only trimmed a new name, so a name could hold CR, LF or
other control characters. IMAP sessions that enabled IMAP4rev2 or
UTF8=ACCEPT wrote that name into LIST, LSUB, STATUS and ACL responses as
a quoted string with the CR/LF left raw, so the rest of the name was read
as a new server response. Any signed-in user could forge responses such
as "* 1 EXPUNGE" in their own mail app and, through a shared folder, in
the IMAP sessions of everyone the folder is shared with. IMAP CREATE and
RENAME accepted the same names when sent as a literal.

JMAP Mailbox/set, IMAP CREATE and RENAME, and folders created by a Sieve
fileinto now refuse names containing control characters. A quoted string
that holds CR or LF, such as a name stored before this change, is now
sent as a literal, so it can never end a response line.

Test: on main a mailbox named "x\r\n* 1 EXPUNGE" was created over JMAP
and an IMAP4rev2 LIST returned a separate "* 1 EXPUNGE" line, and the
LIST writer put the raw CR/LF inside quotes. Now the JMAP create is
refused, CREATE and RENAME answer NO, and the writer sends a literal.
2026-11-09 07:34:58 -07:00
..
2026-10-18 13:51:24 -07:00