Finds messages matching some criteria (RFC 3501 section 6.4.4)
The entirety of the basic syntax is handled, as well as ESEARCH (RFC 4731 and RFC 4466), of CONDSTORE (RFC 4551), ANNOTATE (RFC 5257) and WITHIN (RFC 5032).
Searches are first run against the RAM cache, rudimentarily. If the comparison is difficult, expensive or unsuccessful, it gives up and uses the database.
If ESEARCH with only MIN, only MAX or only COUNT is used, we could generate better SQL than we do. Let's do that optimisation when a client benefits from it.
Constructs an empty Search. If u is true, it's a UID SEARCH, otherwise it's the MSN variety.
Considers whether this search can and should be solved using this cache, and if so, finds all the matches.
Parse one search key (IMAP search-key) and returns a pointer to the corresponding Selector. Leaves the cursor on the first character following the search-key.
Returns the root Selector constructed while parsing this Search command.
Makes sure a SEARCH or ESEARCH response is sent, whichever is appropriate.
This helper function is called by the parser to set the CHARSET for this search to s.
Reads an argument of type stringType (which may be AString, NString, or PlainString) and returns it as unicode, using the charset specified in the CHARSET argument to SEARCH.
This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.