Files
swift-nio-imap/Sources/NIOIMAPCore/Parser
Daniel Eggert 3726eb0fa5 Fix RFC 4731 vs. RFC 3501 style search commands (#688)
The existing code was not able to differentiate between

A1 SEARCH ANSWERED
A1 SEARCH RETURN () ANSWERED
commands. The former is an RFC 3501 style search, the latter an RFC 4731 style search.

RFC 3501 does not allow for any RETURN options.

With this PR, those get mapped to

public enum Command: Hashable {
    ...
    case search(key: SearchKey, charset: String? = nil, returnOptions: [SearchReturnOption] = [])
such that returnOptions are empty for RFC 3501 style searches, wheras RFC 4731 style searches will always contain at least one element.

Note that RETURN () is a shorthand for RETURN (ALL), and as such gets mapped to [.all].

This is called out in the comments for Command.search.

Also

The SearchCorrelator’s tag is now a String to align with TaggedCommand’s tag.

SearchReturnData now uses UnknownMessageIdentifier instead of Int for min and max.
2022-02-18 21:14:22 -08:00
..
2020-10-26 09:54:46 +00:00