mirror of
https://github.com/apple/swift-nio-imap
synced 2026-11-28 05:14:27 +00:00
`EncodedMailbox(mailbox: "x] x\r\n* BYE")` was written verbatim inside the bare URL of `[REFERRAL …]`, injecting a response; likewise `EncodedUser`, `EncodedAuthenticationType`, `EncodedSearch`, `EncodedSection`. RFC 5092: `enc-user`/`enc-auth-type = 1*achar`, `enc-mailbox`/ `enc-search`/`enc-section = 1*bchar`. Each type's public `var` and labelled init become `init?(_:)`, literals trap, `String.init` reads. One helper validates by character class and `pct-encoded` triplet, and uppercases hex digits as the parser does, so values round-trip.