Commit Graph
397 Commits
Author SHA1 Message Date
Matt Diephouse b00a6bc6e1 Use let for static constants, not var (#766) 2024-08-28 17:03:09 +02:00
Daniel Eggert 2b6d728191 Fix correctly parsing incomplete, invalid BODYSTRUCTURE data (#762) 2024-07-29 10:54:53 -04:00
Matt Diephouse 49af890114 Parse PARTIAL data returned from UID SEARCH (#761) 2024-07-10 09:56:25 -04:00
Daniel Eggert 0040533b67 Add support for MESSAGELIMIT Extension (#760) 2024-06-20 09:04:10 -07:00
Massimo OlivieroandDaniel Eggert b9a6a88f92 Add support for RFC 8970 — Message Preview Generation (#751)
Co-authored-by: Daniel Eggert <deggert@apple.com>
2024-06-10 11:54:40 -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
Massimo Oliviero c04c4aa3f7 Fix envelope multiple addresses parsing (#752) 2024-04-18 14:18:25 +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
Matt Diephouse 9716083dce Fix parser error with continuation responses (#742)
When the response text of a continuation response began with base64 characters, the response would be interpreted as base64. Any remaining characters would cause a parser error.

Rework the parser to only interpret the text as base64 if all of the text is base64 characters.
2023-06-14 08:08:29 -04: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
Matt Diephouse cc3b72e93f Parse INTERNALDATEs without a leading digit or space (#735) 2023-03-08 16:49:13 +01: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
carolinacass cab8fef8a7 Use #fileID/#filePath instead of #file (#722)
Motivation:

Modifications:

Changed #file to #filePath or #fileID depending on situation
2022-11-03 15:50:37 +00: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 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
Yim Lee d3c18350c7 CI updates (#711)
* CI updates

- Add SwiftFormat
- Add CI for Swift nightly
2022-09-05 08:00:34 +02:00
Daniel Eggert 194947ceb2 “MIME” is not a valid section specifier (without a part) (#703)
Don’t crash. Throw parsing error.
2022-08-24 11:37:28 +02:00
Daniel Eggert 4ab3b2bd0f Fix crash when parsing invalid mod-seq (#702)
Modification sequence numbers need to be in the range 0-Int64.max (63 bit unsiged values). When parsing, use the failing initializer, instead of the one with a `precondition()`.
2022-08-24 10:33:50 +01:00
Daniel Eggert 04d504c533 CommandParser needs to accept single CR as valid newline. (#701)
The `FramingParser` might split a `CRLF` lineline into `CF` only (`LF` in the “next frame”). The `CommandParser` thus needs to be able to parse
```text
A26 UID FETCH 1:10002 (UID FLAGS MODSEQ)\r
```
as a valid and complete command.
2022-08-03 16:26:34 +02:00
Daniel Eggert c2e9712c95 Make ResponseText conform to CustomDebugStringConvertible (#700) 2022-07-06 19:06:49 +02:00
Daniel Eggert 692f4ed85d Fix stack exhaustion due to recursion (#698) 2022-05-18 15:25:54 +02:00
Daniel Eggert 040df6a6c6 Make conversion between MessageIdentifierSet variants public (#697)
This also renames some files and move some code around — to make the UID / SequenceNumber / UnknownMessageIdentifier split clearer.
2022-04-19 18:10:09 +02:00
Daniel Eggert 010167d33e Pre-calculate MailboxName hash value (#696)
Since it’s common to use `MailboxName` as a key in a dictionary and/or compare `MailboxName` for equality, `MailboxName` will pre-calculate its hash value, and store it. As a result `Hashable` (and `Equatable`) performance is very fast.
2022-03-22 11:32:47 +00:00