100 Commits
Author SHA1 Message Date
Daniel Eggert 6b1b196cd6 Use NFC for ModifiedUTF7.encode (#884) 2026-11-13 13:38:17 +01:00
Daniel Eggert b2c94a8bce Only skip an orphaned LF after a response-ending CR (#882) 2026-11-10 17:49:13 +01:00
Daniel Eggert d67ffdf153 Fix encode/parse round-trip bugs (#868)
* Separate LIST from its independent select options

`.listIndependent([.remote], …)` encoded as `LIST(REMOTE) …`.

RFC 5258: `list = "LIST" [SP list-select-opts] SP mailbox SP mbox-or-pat`.

* Keep leading zeros in fractional seconds

`12:34:56.05` parsed as `fraction: 5` and re-encoded as `12:34:56.5`,
changing the value.

RFC 3339: `time-secfrac = "." 1*DIGIT`. `FullTime.fraction` becomes
`FullTime.Fraction`, which stores the digits; `init?(_:)` validates,
literals trap, `String.init` reads.

* Model the RFC 3339 time offset

`;EXPIRE=2025-12-31T23:59:59Z` failed to parse inside a URL: the
parser stopped before `Z`. The encoder never wrote an offset.

RFC 4467: `expire = ";EXPIRE=" date-time`; RFC 3339: `full-time =
partial-time time-offset`, `time-offset = "Z" / time-numoffset`. Adds
the required `FullTime.offset`.

* Encode LIST extended data

`MailboxInfo.extensions` was parsed but never written, so
`* LIST (\Marked) "/" "Fruit" ("CHILDINFO" ("SUBSCRIBED"))` lost
`("CHILDINFO" …)` on re-encode.

RFC 5258: `mailbox-list = … mailbox [SP mbox-list-extended]`.

* Round-trip multi-value LIST option values

`.array(["a", "b"])` encoded as `(("a" "b"))`; the parser rejected both
that and `("a" "b")`: it took the `astring` branch first and could not
backtrack.

RFC 5258: `option-value = "(" option-val-comp ")"`, `option-val-comp =
astring / option-val-comp *(SP option-val-comp) / "(" option-val-comp
")"`. The parser reads a sequence of elements; the encoder writes
several values inside the `option-value` parentheses.

* Validate JMAPACCESS URLs

`.jmapAccess(URL(string: "jmap", relativeTo: base))` encoded as
`JMAPACCESS "jmap -- https://example.com/"` (`URL.description`); `http`
URLs were written though the parser rejects them.

The payload becomes `ResponsePayload.JMAPAccessURL`: `init?(_:)` resolves
against the base and requires `https`, a host, and no escaping inside
`quoted`; `URL.init` reads. The parser uses the same check.

* Make RESETKEY mechanisms require a mailbox

`.resetKey(mailbox: nil, mechanisms: [.internal])` encoded as bare
`RESETKEY`, silently dropping the mechanisms and resetting every key.

RFC 4467: `resetkey = "RESETKEY" [SP mailbox *(SP mechanism)]`. The
payload becomes `Command.ResetKeyScope`: `.allMailboxes` or
`.mailbox(_:mechanisms:)`.

* Hoist a #require the compiler flagged as redundant

* Cite RFC 7162 for SEARCH MODSEQ entry types

The docs described these as RFC 5464 GETMETADATA options, with
GETMETADATA examples. The grammar is RFC 7162 `search-modseq-ext`.

* Fix doc nits

- `ExtendedSearchScopeOptions.content` is a dictionary, not an array.
- `NamespaceDescription` init in the `NamespaceResponse` example needs
  `try` and `responseExtensions:`.
- `TaggedExtensionLabel` example: `SELECT INBOX (CONDSTORE)` parses as
  `.condStore`; use `RELEVANCY`.
- Stray `’` in a parser hint.
2026-11-04 17:41:53 +00:00
Daniel Eggert 9f61149d6d Validate IMAP URL components (#867)
* Validate percent-encoded IMAP URL components

`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.

* Validate URLAUTH tokens

`EncodedAuthenticatedURL(data: "x\r\n* BYE")` was written verbatim at the
end of a URLAUTH URL, injecting a response.

RFC 4467: `enc-urlauth = 32*HEXDIG`. `init(data:)` and the public `var`
become `init?(_:)`; literals trap; `String.init` reads. The parser read
exactly 32 digits, so longer tokens didn't round-trip; it now reads all.

* Add IMAPServer.Host and keep IP-literal brackets

`IMAPServer(host: "h] x\r\n* BYE")` was written verbatim in the bare URL
of `[REFERRAL …]`, injecting a response. `imap://[::1]/` parsed as host
`::1` and re-encoded as `imap://::1/`. A negative port encoded as `:-1`.

RFC 3986: `host = IP-literal / IPv4address / reg-name`. New nested
`IMAPServer.Host` replaces the `String`: `init?(_:)` validates IPv6,
IPvFuture and reg-name (IPv4 is a subset), literals trap. The parser
keeps the brackets, accepts all of reg-name, and validates via `init?`;
its unreachable IPv4 branch is gone. `port` is now `UInt16?`.

* Don't parenthesize URLFETCH responses

`.urlFetch([.init(url: "url", data: nil)])` encoded as
`URLFETCH("url" NIL)`, which our parser rejects.

RFC 4467: `urlfetch-data = "URLFETCH" 1*(SP url-full SP nstring)`. Write
each pair after a space, unparenthesized. Fix fixtures that enshrined
the old output.

* Remove dead URL and date writers

`writeAuthIMAPURLRump`, `writeAuthIMAPURLFull`, `writeRelativeIMAPURL`,
`writeURLFetchType`, `writeInternetMessageDate` and
`writeListSelectBaseOptionQuoted` had no callers outside their own
encode tests, nor did the writers only they reached
(`writeAuthenticatedURL(NetworkMessagePath)`, `writeNetworkPath`,
`writeAbsoluteMessagePath`, `writeIUIDOnly`,
`writeURLMessageSectionOnly`, `writeMessagePathByteRangeOnly`). Delete
them and those tests; parse tests stay.

* Keep a section's trailing slash unless a partial follows

`imap://h/INBOX/;UID=1/;SECTION=1/` parsed with section `1`, so
`EncodedSection("1/")` didn't round-trip: the parser dropped the `/`
even when no `;PARTIAL=` followed it. Drop it only when one does.

* Reject `*` as a URL authentication type

`.type("*")` encoded as `;AUTH=*`, which parses as `.any`; `.type("*x")`
failed to parse, since `*` matched first.

RFC 5092: `iauth = ";AUTH=" ( "*" / enc-auth-type )`. `init?(_:)`
rejects `*`; the parser tries the longer `enc-auth-type` first.
2026-11-04 17:41:53 +00:00
Daniel Eggert 4606da62d2 Validate response text, command tags and namespace delimiters (#866)
* Reject invalid response text when writing

`.no(.init(text: "No mailbox x\r\n* BYE pwned"))` was written verbatim,
injecting an untagged response; likewise tagged, BYE, PREAUTH and
continuation responses.

RFC 9051: `text = 1*(TEXT-CHAR / UTF8-2 / UTF8-3 / UTF8-4)`. `writeText`
now asserts no NUL, CR or LF. Empty stays valid. The parser now accepts
UTF-8 text.

* Add Command.Tag for command and response tags

`TaggedCommand(tag: "A1 NOOP\r\nA2 DELETE INBOX\r\nA3", command: .noop)`
was written verbatim, injecting a command; likewise `APPEND` start.
`TaggedResponse(tag: "* BYE x\r\nA1", …)` injected a response.

RFC 3501: `tag = 1*<any ASTRING-CHAR except "+">`. New `Command.Tag`
replaces the `String` in `TaggedCommand`, `TaggedResponse`, `Response`,
`CommandStreamPart`, `AppendCommand`, `BadCommand` and NIOIMAP's state
machine errors; `init?(_:)` validates, literals trap. The parser already
enforces the production. IMAPCommands converts its numeric tags.

* Validate and escape namespace delimiters

`NamespaceDescription(string: "x", char: "\r\n", …)` wrote a raw CRLF
inside `"…"`, injecting a response. `"\""` encoded as `"""`, and `"\\"`
as `"\"` (unterminated); non-ASCII was accepted.

RFC 2342: `DQUOTE QUOTED-CHAR DQUOTE / nil`. `init(string:delimiter:
responseExtensions:)` (was `char:`) throws `InvalidDelimiterError` for
non-ASCII, CR, LF, NUL; the delimiter is stored as a byte, read-only.
Quoted-specials are escaped on write and parsed when escaped.

* Gate a capturing exit test on Swift 6.3
2026-11-04 17:41:52 +00:00
Daniel Eggert f77de8e279 Add ExtensionKey for tagged-extension parameters (#865)
Generic over the extended type, so a STORE key can't be used where a FETCH key is expected.
2026-11-04 17:41:52 +00:00
Daniel Eggert ded4ff7245 Validate atom-shaped types at construction (#864)
* Reject invalid URLAUTH mechanisms

`.resetKey(mailbox: .inbox, mechanisms: [.init("X\r\nA2 DELETE INBOX")])`
was written verbatim, injecting a command into RESETKEY / GENURLAUTH.

RFC 4467: `mechanism = "INTERNAL" / 1*(ALPHA / DIGIT / "-" / ".")`.
`init(_:)` becomes `init?(_:)`; literals trap on invalid input. The
parser already enforces the production.

* Reject invalid mailbox attributes

`MailboxInfo.Attribute("\\X)\r\n* BYE")` was written verbatim, injecting
an untagged response into LIST. It also feeds CREATE … USE via
`UseAttribute(_:)`.

RFC 3501: `mbx-list-flag` is `"\" atom` in every branch. `init(_:)`
becomes `init?(_:)`; literals trap on invalid input. Constants become
`static let` literals; storage is `let`. Fix the `String.init` doc,
which claimed lowercase storage.

* Reject invalid use attributes

`UseAttribute("\\All))\r\nA2 DELETE INBOX\r\nA3 NOOP ((")` was written
verbatim, injecting a command into CREATE … (USE (…)). It also feeds
`GmailLabel(useAttribute:)`.

RFC 6154: `use-attr-ext = "\" atom`. `init(_:)` becomes `init?(_:)`;
literals trap on invalid input. `init(_: MailboxInfo.Attribute)` stays
non-failable: same production. Fix docs that claimed lowercase storage.

* Reject invalid attribute flags

`AttributeFlag("x\" all 1\r\nA2 DELETE INBOX\r\nA3 NOOP \"")` was
written verbatim inside SEARCH MODSEQ "/flags/…", injecting a command.

RFC 7162: `attr-flag = "\\" atom / atom`, where `"\\"` is two literal
backslashes (the stored form is already escaped). `init(_:)` becomes
`init?(_:)`, validating after lowercasing; literals trap on invalid
input. Fix docs that claimed casing is preserved.

* Add FilterName for SEARCH FILTER

`.filter("x\r\nA2 DELETE INBOX")` was written verbatim, injecting a
command into SEARCH.

RFC 5466: `filter-name = 1*<any ATOM-CHAR except "/">`. New `FilterName`
type replaces the `String` payload of `SearchKey.filter`; `init?(_:)`
validates, literals trap on invalid input.

* Reject invalid compression kinds

`.compress(.init("DEFLATE\r\nA2 DELETE INBOX"))` was written verbatim,
injecting a command after COMPRESS.

RFC 4978: `algorithm = "DEFLATE"`, an atom. `init(_:)` becomes
`init?(_:)`, validating after uppercasing; literals trap on invalid
input. Add `String.init(_:)`.

* Reject invalid capabilities

`Capability("X\r\nA2 DELETE INBOX")` was written verbatim, injecting a
command into ENABLE, or (`"X\r\n* OK [ALERT] hi"`) a response into
CAPABILITY / ENABLED. Same for the kinds a capability is built from,
e.g. `.context(.init("X\r\n…"))`.

RFC 3501: `capability = ("AUTH=" auth-type) / atom`. `init(_:)` becomes
`init?(_:)` for `Capability` and each kind (kinds validate after
uppercasing); literals trap on invalid input. Storage is `let`. Add
`String.init(_:)` for the kinds.

* Add validated LIST option tag types

`.standard("X)\r\nA2 DELETE INBOX\r\nA3 LIST (")` was written verbatim,
injecting a command into LIST select/return options. Same for
`.vendor(KeyValue<String, String>)`.

RFC 5258: `option-standard-tag = atom`, `option-vendor-tag =
vendor-token "-" atom`. New `OptionExtensionKind.Standard` and
`.Vendor` replace the payloads; `init?(_:)` validates, literals trap.
`Vendor` stores `ACME-SORT` and derives `token` / `name`.

* Add CharacterSetName for SEARCH, SORT, and BADCHARSET

`.sort(…, charset: "UTF-8 ALL\r\nA2 DELETE INBOX\r\nA3 SEARCH", …)` was
written verbatim, injecting a command into SORT / SEARCH / ESEARCH.
`.badCharset(["a)] x\r\n* BYE"])` injected a response. Quoted names
also didn't round-trip: `"a b"` parsed, then encoded bare.

RFC 3501: `charset = atom / quoted`. New `CharacterSetName` replaces
`String`; valid = non-empty `TEXT-CHAR`. Written as an atom where it is
one (`CHARSET UTF-8` unchanged), quoted otherwise, never a literal. The
parser rejects quoted names it couldn't write back.

* Assert keyword validity when writing a flag keyword

`writeFlagKeyword` wrote verbatim with no check. `writeAtom` would be
wrong: Gmail keywords contain `]`, which no atom does. Assert the
keyword's own production instead; test that a `]` keyword encodes.

* Hoist a #require the compiler flagged as redundant
2026-11-04 17:41:52 +00:00
Daniel Eggert e7729053c0 Fix writers that emit untrusted bytes unquoted (#863)
* Test basic list-mailbox parsing

`parseListMailbox` was only tested against DEL. Cover wildcards,
resp-specials, the quoted-string branch, and an empty input.

* Write GmailLabel bare only if it is a system label

`GmailLabel("\\x)\r\nA2 DELETE INBOX\r\nA3 NOOP (")` was written raw
because it starts with `\`, injecting a command into STORE X-GM-LABELS.
Reachable from server data via `init(mailboxName:)`.

Write bare only for `"\" atom`; otherwise `writeIMAPString`. Also fixes
round-trip of astring labels such as `"\\Foo bar"`.

* Write URLFETCH URLs as astring

`.urlFetch([ByteBuffer(string: "x\r\nA2 DELETE INBOX")])` was written
verbatim, injecting a command.

RFC 4467: `url-full = astring`. Write bare if `1*ASTRING-CHAR` (keeps
long URLAUTH URLs out of literals), else `writeIMAPString` (`%`, `*`).

* Write body encoding as string

`Encoding("x\" 0 0) UID 9 (")` was spliced into `"…"` unescaped, so a
MIME `Content-Transfer-Encoding` header spoofs FETCH items. The parser
accepts any `string` (incl. literals with CRLF), so proxies re-emitted it.

`body-fld-enc = (DQUOTE ("7BIT"/…) DQUOTE) / string`. Use
`writeIMAPString`; standard values are unchanged on the wire.

* Write media type and subtype as string

`Media.Subtype("x\"\r\n* 1 EXPUNGE")` was spliced into `"…"` unescaped;
a MIME `Content-Type` header could inject an untagged response.

`media-basic = ((DQUOTE (…) DQUOTE) / string) SP media-subtype`,
`media-subtype = string`. Use `writeIMAPString` (still uppercased).

* Write search correlator tag as string

`SearchCorrelator(tag: "a\") * BYE")` was spliced into `"…"` unescaped,
so ESEARCH / UIDBATCHES responses could carry injected data.

RFC 4466: `tag-string = string`. Use `writeIMAPString`, and parse a
`string` rather than `"` tag `"` so every tag round-trips.

* Fix escaping of mailbox path separator

The quoted-special cases were swapped: `\` encoded as `"\"`
(unterminated), `"` as `"\\"` (a backslash). `pathSeparator: "\n"` was
written as a raw LF inside `"…"`, and NUL silently became NIL.

`(DQUOTE QUOTED-CHAR DQUOTE / nil)`, `QUOTED-CHAR = <TEXT-CHAR except
quoted-specials> / "\" quoted-specials`. Swap the cases; parse the
escaped forms; `MailboxPath.init` throws for CR, LF, CRLF, NUL.

* Base64-encode URLMECH mechanism data on write

The parser base64-decodes `mechanism-base64`, but the encoder wrote the
decoded bytes raw: parse `INTERNAL=YQ==` → "a" → `INTERNAL=a`. A proxy
re-encoding `[URLMECH INTERNAL X=<base64 of CRLF…>]` emitted raw CRLF.

RFC 4467: `mechanism-base64 = mechanism ["=" base64]`. Encode on write;
fix the fixtures that locked in the mismatch.
2026-11-04 17:41:51 +00:00
Daniel Eggert df4f53ea8b Run macOS Swift 6.2/6.3 tests serially (#881) 2026-11-04 16:38:08 +01:00
Daniel Eggert d7018634d2 Explicit “invalid” case for invalid mailbox IDs (#876) 2026-11-02 21:53:00 +01:00
Daniel Eggert 1d32ed43bf Disable Swift Testing error backtraces on Swift 6.3 CI (#879) 2026-11-02 09:59:28 +01:00
Daniel Eggert fbec780de3 Normalize malformed ENVELOPE address groups (#872) 2026-10-27 15:06:24 +01:00
Daniel Eggert 088b6eb105 Fix race in ClientBootstrap (#870) 2026-10-12 15:32:49 +02:00
Daniel Eggert 14ad3887da More “Modified UTF-7” tests (#856) 2026-09-25 11:23:20 -04:00
Daniel Eggert 6c8cfaddcc Add a imperative IMAP client and an imap-tool CLI (#841) 2026-09-25 16:16:41 +01:00
Daniel Eggert 8fd34eaff7 Validate flag and quota resource names as atoms (#854) 2026-09-14 21:16:50 +00:00
Daniel Eggert 3507d6da24 Don't build macOS for Swift 6.1 (#847) 2026-09-14 13:43:48 -07:00
Daniel Eggert e536be599e Reject invalid AuthenticationMechanism (#846) 2026-09-01 10:11:11 +02:00
Daniel Eggert c4d4d23e29 Drop pre-Swift 6.2 (#845) 2026-08-29 09:23:34 +02:00
Daniel Eggert 273b5602db Update UIDBATCHES RFC number (#842) 2026-08-10 14:46:51 -04:00
Daniel Eggert 90124af395 Add proxy readme (#839) 2026-07-30 09:57:47 -04:00
Daniel Eggert dcba159054 Modernize the Proxy example (#835) 2026-07-18 21:54:14 +02:00
Daniel Eggert e67fc89e63 RFC 9979 (#833) 2026-07-18 20:57:21 +02:00
Daniel Eggert 1057994e93 Move examples into sub-dir (#834) 2026-07-18 12:00:06 +02:00
Daniel Eggert 880366a417 Add macOS CI job (#836) 2026-07-07 11:37:57 +02:00
Daniel Eggert 0eaa07f877 Fix cr-lf handling in FramingParser (#830) 2026-06-22 08:10:24 -04:00
Daniel Eggert faaa15ee50 Add explicit test for credential redaction (#825) 2026-06-03 10:46:06 -04:00
Daniel Eggert 983e0f1aff InvalidCommandForState error may leak PII (#828) 2026-06-02 16:37:19 +01:00
Daniel Eggert abfc170ff1 Only parse continuation responses while an AUTHENTICATE is in progress (#827) 2026-06-01 14:13:22 -04:00
Daniel Eggert 01de1f9a29 Allow () in place of NIL for empty addr-list fields. Fixes #821 (#823) 2026-04-30 08:12:53 +02:00
Daniel Eggert 34883bcba6 Update style in documentation (#822) 2026-04-28 18:06:43 +02:00
Daniel Eggert 871d0122c9 Better docc comments (#815) 2026-04-16 09:20:29 -07:00
Daniel Eggert ac63e9f145 Mailbox attribute requirements from RFC 9051 (#816)
Fixes #731
2026-03-18 09:13:03 +01:00
Daniel Eggert 9491d31e2a Additional Tests (#811) 2026-03-09 09:58:21 -04:00
Daniel Eggert e466da1b68 Inbound buffer split (#812) 2026-03-09 08:50:04 -04:00
Daniel Eggert af9dbf1d92 Cleanup and improve tests (#809) 2026-03-03 13:01:01 -05:00
Daniel Eggert a92a35e360 Add CustomDebugStringConvertible to a few more types (#804) 2025-10-14 11:30:39 +01:00
Daniel Eggert ad065b2f30 Extract 64-bit raw value from ServerMessageDate. Better debugDescription. (#800) 2025-07-10 08:40:52 -04:00
Daniel Eggert efc0bfe244 Allow receiving untagged responses while appending (#799) 2025-06-11 13:52:48 -04:00
Daniel Eggert d232e016ff Use quoted strings even when they contain REVERSE SOLIDUS or QUOTATION MARK (#798) 2025-06-02 18:21:42 +00:00
Daniel Eggert 7125d3d7b1 UIDBATCHES Extension (#777) 2025-05-22 12:47:29 -04:00
Daniel Eggert c8f9f55336 Fix encoding of UID EXPUNGE (#797) 2025-05-21 13:54:57 -04:00
Daniel Eggert 1fa0d6ef53 Improve (pre-calculated) hash of MailboxName (#794) 2025-05-12 12:28:12 -04:00
Daniel Eggert ed6fcb0444 Add additional test case for encoding \ and " (#792) 2025-05-07 22:39:23 +02:00
Daniel Eggert e672225d76 Rename → IMAPClientHandler.Message (#793) 2025-05-07 22:39:05 +02:00
Daniel Eggert b838dc2206 Pass response parser options into IMAPClientHandler.init (#789) 2025-05-06 15:30:31 +02:00
Daniel Eggert 52d4ef16f3 Update README (#790) 2025-05-06 15:08:00 +02:00
Daniel Eggert 655492302a Add MessageIdentifierSet.suffix overload (#791) 2025-05-02 08:18:36 +00:00
Daniel Eggert ae9498d7dd Fix receiving untagged responses during APPEND (#787) 2025-04-14 09:00:33 -07:00
Daniel Eggert 1b27cae1b4 Fix client handler encoding options (#786) 2025-04-11 17:33:25 +02:00
Daniel Eggert 851c3f89b6 Workaround for IMAPClientHandler and APPEND (#785) 2025-04-11 17:01:26 +02:00
Daniel Eggert adfb504006 Update comments / links for MESSAGELIMIT / RFC 9738 (#781) 2025-04-08 06:56:33 -04:00
Daniel Eggert ffec818c4c Fix IMAPServerHandler not resetting outstanding continuations (#783) 2025-04-08 12:25:11 +09:00
Daniel Eggert a941316af3 Fix parsing of NIL for RFC 7889 APPENDLIMIT (#782) 2025-04-04 11:06:20 -07:00
Daniel Eggert 1b3dc9e1cd FramingParser can crash when single CR is inside DQUOTE string (#779) 2025-02-12 14:07:40 +01:00
Daniel Eggert a0441a53d3 FramingParser: Allow un-matched DQUOTE in lines (#776) 2024-12-18 08:45:59 +01:00
Daniel Eggert 7328a733b4 Be more lenient about spaces in RFC 2971 ID response (#774) 2024-10-24 09:43:03 -04:00
Daniel Eggert 35583d7cf9 Add helper for logging CommandStreamPart without PII and special case ID command / response (#773) 2024-09-25 09:24:29 -04:00
Daniel Eggert 13cf165aaf Implement RFC 7889 “APPENDLIMIT” (#769) 2024-09-03 14:49:41 +02:00
Daniel Eggert 2ead8b2ac0 RFC 7377: Use RETURN (ALL) instead of RETURN () (#768) 2024-09-03 06:32:29 -04:00
Daniel Eggert 2b6d728191 Fix correctly parsing incomplete, invalid BODYSTRUCTURE data (#762) 2024-07-29 10:54:53 -04:00
Daniel Eggert 0040533b67 Add support for MESSAGELIMIT Extension (#760) 2024-06-20 09:04:10 -07:00
Daniel Eggert 373a95435a Skip BODYSTRUCTURE data when literal size limit is exceeded (#759) 2024-06-10 09:14:08 -04:00
Daniel Eggert 342a2c695f Add support for RFC 9586 “Using and Returning UIDs Only” (aka. UIDONLY) (#758) 2024-06-10 09:55:46 +02:00
Daniel Eggert e45aa3283f Skip invalid BODYSTRUCTURE in server responses (#757) 2024-04-20 19:16:38 +02:00
Daniel Eggert 14ac21ddb9 Include actual and limit values in errors (#754) 2024-04-18 19:27:22 +02:00
Daniel Eggert 366581ac18 Reduce size of MailboxName and MailboxPath (#755) 2024-04-18 11:59:14 +02:00
Daniel Eggert fe1e2beb15 Fix compiler warnings for Swift 5.9 (#756) 2024-04-17 07:13:17 -04:00
Daniel Eggert a11ff210f3 Add PARTIAL (RFC 9394) to Capability (#749) 2023-09-25 08:33:58 +01:00
Daniel Eggert a212ea2c40 Make calculated properties public. Follow up to #747 (#748) 2023-07-24 11:29:38 -04:00
Daniel Eggert e3989136d2 ExtendedSearchResponse convenience (#747) 2023-07-24 08:48:06 -04:00
Daniel Eggert 0d951a6d57 IMAP Paged SEARCH & FETCH Support (#746) 2023-07-21 14:22:32 -07:00
Daniel Eggert 39b1902c5d 2nd part of renaming Partial → ByteRange (#745) 2023-07-20 14:31:51 -07:00
Daniel Eggert 0ee42deabe Add SectionSpecifier.Part. isChildPart(of:) (#744) 2023-07-19 15:51:40 -07:00
Daniel Eggert c041371b50 Fix for receiving untagged response during SASL auth (#743) 2023-06-27 18:03:12 +02:00
Daniel Eggert 3d871e0f6b Make generic functions that are public inlinable (#741) 2023-05-25 10:32:21 -04:00
Daniel Eggert 8851fdb73b Fix for stray + in response. (#740) 2023-05-24 09:22:53 -04:00
Daniel Eggert fc6524ab8d Allow non-ASCII values in BODYSTRUCTURE parameters (#739) 2023-04-19 18:26:48 +02:00
Daniel Eggert 89777af885 Fix parsing Gmail labels as flags (#738) 2023-04-18 14:57:40 +02:00
Daniel Eggert 01577b28be Rename Partial → ByteRange (#736) 2023-03-31 21:03:13 +02:00
Daniel Eggert 35e9edb1f7 Add MessageIdentifierRange convenience (#734) 2023-02-27 14:30:42 +00:00
Daniel Eggert c25047fc0c Use enum for ExtendedSearchResponse UID vs. sequence number (#733) 2023-02-22 19:45:58 +01:00
Daniel Eggert 18dd5d5193 Call through to RangeSet for SetAlgebra where possible (#732) 2023-02-22 12:17:48 +01:00
Daniel Eggert 511d4e799d Fix parsing response codes (#730) 2023-02-19 10:10:12 +01:00
Daniel Eggert 426a884a42 Ability to create decription from Response (#726) 2023-01-25 08:50:04 +00:00
Daniel Eggert ec304298ea Add “XYMHIGHESTMODSEQ” capability (#725) 2022-12-22 15:41:16 +01:00
Daniel Eggert 728076fa44 Use pre-calculated digest when checking if name is INBOX (#724) 2022-12-09 16:41:26 +01:00
Daniel Eggert e8bb770d00 Only include CHARSET in search when there’s text (#723) 2022-12-09 15:28:23 +01:00
Daniel Eggert 8abe89882e Allow NIL response for a particular body section (#720) 2022-10-27 16:40:58 +02:00
Daniel Eggert 945f0d664c Remove MessageAttribute.binary (#721)
This is (already) being handled by `FetchResponse.streamingBegin` / `StreamingKind`.
2022-10-27 10:24:13 +01:00
Daniel Eggert 25392460d4 Improve documentation for SectionSpecifier.Kind (#719) 2022-10-25 16:52:25 +01:00
Daniel Eggert 4fdfe749c8 Need to allow Response.fetch while in IDLE (#718) 2022-10-07 08:03:02 -07:00
Daniel Eggert fc46347a85 Clean up RFC 2045 “media type” in BodyStructure (#717)
Each “part” in a `BodyStructure` has an RFC 2045 “media type” — which is a combination of “top level type” + “sub-stype”.

But the types that were previously used, were inconsistently used / named. This PR cleans up the use of these and makes them consistent.

Additionally it adds a
```swift
extension BodyStructure {
    public var mediaType: Media.MediaType
}
```
such that it’s easy to get to a part’s media type, regardless of its kind.
2022-10-06 15:49:55 +02:00
Daniel Eggert 6eb8a70b2c More BodyStructure / SectionSpec convenience (#715) 2022-10-04 16:58:35 +01:00
Daniel Eggert 58236520fa Fix BodyStructure’s RandomAccessCollection conformance (#714) 2022-09-12 17:24:26 +02:00
Daniel Eggert ad85d4a0cc Cleanup CustomDebugStringConvertible conformance (#713)
With this PR the implementation of `CustomDebugStringConvertible` generally uses new `makeDescription` convenience methods on the three encode buffers, e.g.:
```swift
extension ResponseEncodeBuffer {
    static func makeDescription(_ closure: (inout ResponseEncodeBuffer) -> Void) -> String
}
```
such that conformance can be implemented as e.g.
```swift
extension Command: CustomDebugStringConvertible {
    public var debugDescription: String {
        CommandEncodeBuffer.makeDescription {
            $0.writeCommand(self)
        }
    }
}
```

This also adds `CustomDebugStringConvertible` to `MessageAttribute` and `StreamingKind`.
2022-09-10 12:35:32 +02:00
Daniel Eggert cc1a03dd73 Use SE0270_RangeSet instead of StandardLibraryPreview (#707) 2022-09-05 09:25:45 +01:00
Daniel Eggert 4319190212 Remove NIOIMAPFormatter (#712)
With #711 the formatter is part of the Docker image.
2022-09-05 09:25:07 +01:00
Daniel Eggert 379953ddd6 Contributing and Contributors (#708) 2022-08-30 20:00:25 +02:00
Daniel Eggert ef20269506 Cleanup (#705) 2022-08-29 20:34:42 +02:00