VERSION
VERSION
Serialized version.
Abstraction of the IMAP4rev1 search criteria (see RFC 3501 [6.4.4]).
Allows translation between abstracted search criteria and a generated IMAP search criteria string suitable for sending to a remote IMAP server.
build(\Horde_Imap_Client_Base $exts = array()) : array
Builds an IMAP4rev1 compliant search string.
\Horde_Imap_Client_Base | $exts | The server object this query will be run on (@since 2.24.0), a Horde_Imap_Client_Data_Capability object (@since 2.24.0), or the list of extensions present on the server (@deprecated). If null, all extensions are assumed to be available. |
An array with these elements:
flag(string $name, boolean $set = true, array $opts = array())
Search for a flag/keywords.
string | $name | The flag or keyword name. |
boolean | $set | If true, search for messages that have the flag set. If false, search for messages that do not have the flag set. |
array | $opts | Additional options:
|
newMsgs(boolean $newmsgs = true, array $opts = array())
Search for either new messages (messages that have the '\Recent' flag but not the '\Seen' flag) or old messages (messages that do not have the '\Recent' flag). If new messages are searched, this will clear any '\Recent' or '\Unseen' flag searches. If old messages are searched, this will clear any '\Recent' flag search.
boolean | $newmsgs | If true, searches for new messages. Else, search for old messages. |
array | $opts | Additional options:
|
headerText(string $header, string $text, boolean $not = false, array $opts = array())
Search for text in the header of a message.
string | $header | The header field. |
string | $text | The search text. |
boolean | $not | If true, do a 'NOT' search of $text. |
array | $opts | Additional options:
|
text(string $text, string $bodyonly = true, boolean $not = false, array $opts = array())
Search for text in either the entire message, or just the body.
string | $text | The search text. |
string | $bodyonly | If true, only search in the body of the message. If false, also search in the headers. |
boolean | $not | If true, do a 'NOT' search of $text. |
array | $opts | Additional options:
|
size(integer $size, boolean $larger = false, boolean $not = false, array $opts = array())
Search for messages smaller/larger than a certain size.
integer | $size | The size (in bytes). |
boolean | $larger | Search for messages larger than $size? |
boolean | $not | If true, do a 'NOT' search of $text. |
array | $opts | Additional options:
|
ids(\Horde_Imap_Client_Ids $ids, boolean $not = false, array $opts = array())
Search for messages within a given UID range. Only one message range can be specified per query.
\Horde_Imap_Client_Ids | $ids | The list of UIDs to search. |
boolean | $not | If true, do a 'NOT' search of the UIDs. |
array | $opts | Additional options:
|
dateSearch(mixed $date, string $range, boolean $header = true, boolean $not = false, array $opts = array())
Search for messages within a date range.
mixed | $date | DateTime or Horde_Date object. |
string | $range | Either:
|
boolean | $header | If true, search using the date in the message headers. If false, search using the internal IMAP date (usually arrival time). |
boolean | $not | If true, do a 'NOT' search of the range. |
array | $opts | Additional options:
|
dateTimeSearch(mixed $date, string $range, boolean $header = true, boolean $not = false, array $opts = array())
Search for messages within a date and time range.
mixed | $date | DateTime or Horde_Date object. |
string | $range | Either:
|
boolean | $header | If true, search using the date in the message headers. If false, search using the internal IMAP date (usually arrival time). |
boolean | $not | If true, do a 'NOT' search of the range. |
array | $opts | Additional options:
|
intervalSearch(integer $interval, string $range, boolean $not = false, array $opts = array())
Search for messages within a given interval. Only one interval of each type can be specified per search query. If the IMAP server supports the WITHIN extension (RFC 5032), it will be used. Otherwise, the search query will be dynamically created using IMAP4rev1 search terms.
integer | $interval | Seconds from the present. |
string | $range | Either:
|
boolean | $not | If true, do a 'NOT' search. |
array | $opts | Additional options:
|
andSearch(mixed $queries)
AND queries - the contents of this query will be AND'ed (in its entirety) with the contents of EACH of the queries passed in. All AND'd queries must share the same charset as this query.
mixed | $queries | A query, or an array of queries, to AND with the current query. |
orSearch(mixed $queries)
OR a query - the contents of this query will be OR'ed (in its entirety) with the contents of EACH of the queries passed in. All OR'd queries must share the same charset as this query. All contents of any single query will be AND'ed together.
mixed | $queries | A query, or an array of queries, to OR with the current query. |
modseq(integer $value, string $name = null, string $type = null, boolean $not = false, array $opts = array())
Search for messages modified since a specific moment. The IMAP server must support the CONDSTORE extension (RFC 7162) for this query to be used.
integer | $value | The mod-sequence value. |
string | $name | The entry-name string. |
string | $type | Either 'shared', 'priv', or 'all'. Defaults to 'all' |
boolean | $not | If true, do a 'NOT' search. |
array | $opts | Additional options:
|
previousSearch(boolean $not = false, array $opts = array())
Use the results from the previous SEARCH command. The IMAP server must support the SEARCHRES extension (RFC 5182) for this query to be used.
boolean | $not | If true, don't match the previous query. |
array | $opts | Additional options:
|