Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
Imap_Client

Functions

 __clone ()
 This object can not be cloned.
 
 __construct ( $msg, $code, Horde_Imap_Client_Interaction_Server $server, Horde_Imap_Client_Interaction_Pipeline $pipeline)
 Constructor.
 
 __construct ($data, $type)
 Constructor.
 
 __construct ($debug)
 Constructor.
 
 __construct ($id, $pass, $challenge, $hostname, $service)
 Generate the Digest-MD5 response.
 
 __construct ($str, array $opts=array())
 Constructor.
 
 __construct ($user, $pass, $hash='SHA1')
 Constructor.
 
 __construct ()
 Constructor.
 
 __construct (array $params=array())
 Constructor.
 
 __construct (array $required=array(), array $optional=array())
 Constructor.
 
 __construct (Horde_Imap_Client_Base $base_ob, $mailbox, $sync, $curr, $criteria, $ids)
 Constructor.
 
 __construct (Horde_Imap_Client_Fetch_Results $fetch)
 Constructor.
 
 __construct (Horde_Imap_Client_Socket $socket)
 Constructor.
 
 __construct (Horde_Imap_Client_Tokenize $token)
 Constructor.
 
 __construct (Horde_Imap_Client_Tokenize $token, $tag)
 
 __get ($name)
 Return specific digest response directive.
 
 __isset ($name)
 
 __serialize ()
 Serialization.
 
 __set ($name, $value)
 
 __sleep ()
 
 __toString ()
 Cooerce to string.
 
 __unserialize ( $data)
 Unserialization.
 
 __unserialize (array $data)
 
 _addFuzzy ($add, &$temp)
 Adds fuzzy modifier to search keys.
 
 _append (Horde_Imap_Client_Mailbox $mailbox, $data, $options)
 Append message(s) to a mailbox.
 
 _appendData ($data, &$asize)
 Prepares append message data for insertion into the IMAP command string.
 
 _authInitialResponse ($method, $ir, $username=null)
 Create the AUTHENTICATE command for the initial client response.
 
 _baseSql ($mailbox, $join=null)
 Prepare the base SQL query.
 
 _buildAndOr ($type, $data, &$charset, &$exts_used, &$cmds)
 Builds the AND/OR query.
 
 _cacheFields ()
 Provide the list of available caching fields.
 
 _capability ()
 Query server capability.
 
 _changeSelected ($mailbox=null, $mode=null)
 Called when the selected mailbox is changed.
 
 _check ()
 Request a checkpoint of the currently selected mailbox.
 
 _clientSortProcess ($res, $fetch_res, $sort)
 
 _close ($options)
 Close the connection to the currently selected mailbox, optionally expunging all deleted messages (RFC 3501 [6.4.2]).
 
 _command ($cmd)
 Shortcut to creating a new IMAP client command object.
 
 _condstoreSync ()
 Synchronizes the current mailbox cache with the server (using CONDSTORE or QRESYNC).
 
 _connect ($host, $port, $timeout, $secure, $context, $retries=0)
 
 _connect ()
 Connect to the remote server.
 
 _continuationCheck ($list)
 Recursive check for continuation functions.
 
 _convertCatenateUrl ($url)
 Converts a CATENATE URL to stream data.
 
 _copy (Horde_Imap_Client_Mailbox $dest, $options)
 Copy messages to another mailbox.
 
 _createMailbox (Horde_Imap_Client_Mailbox $mailbox, $opts)
 Create a mailbox.
 
 _createUid ( $mailbox)
 Create and return the UID for a mailbox/user/server combo.
 
 _deleteACL (Horde_Imap_Client_Mailbox $mailbox, $identifier)
 Deletes ACL rights for a given mailbox/identifier.
 
 _deleteMailbox ($mbox)
 Delete a mailbox from the cache.
 
 _deleteMailbox (Horde_Imap_Client_Mailbox $mailbox)
 Delete a mailbox.
 
 _deleteMailboxPost (Horde_Imap_Client_Mailbox $mailbox)
 Actions to perform after a mailbox delete.
 
 _deleteMsgs (Horde_Imap_Client_Mailbox $mailbox, Horde_Imap_Client_Ids $ids, array $opts=array())
 Delete messages in the cache.
 
 _enable ($exts)
 Enable an IMAP extension (see RFC 5161).
 
 _expunge ($options)
 Expunge all deleted messages from the given mailbox.
 
 _fetch (Horde_Imap_Client_Fetch_Results $results, $queries)
 Fetch message data.
 
 _fetchCmd (Horde_Imap_Client_Fetch_Results $results, $options)
 Fetch data for a given fetch query.
 
 _fetchCmd (Horde_Imap_Client_Interaction_Pipeline $pipeline, $options)
 Add a FETCH command to the given pipeline.
 
 _filterParams ()
 Return the base string filter parameters.
 
 _fromSequenceString ($str)
 Parse an IMAP message sequence string into a list of indices.
 
 _getACL (Horde_Imap_Client_Mailbox $mailbox)
 Get ACL rights for a given mailbox.
 
 _getAllIndices ()
 Return all indices.
 
 _getAnnotateMoreEntry ($name)
 Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.
 
 _getCid ($mailbox)
 Create the unique ID used to store the mailbox data in the cache.
 
 _getCid ($mailbox, $slice)
 Create the unique ID used to store the data in the cache.
 
 _getCnonce ()
 Creates the client nonce for the response.
 
 _getComparator ()
 Get the comparator used for searching/sorting (RFC 5255).
 
 _getEncryptKey ()
 Get encryption key.
 
 _getHeaders ($id, $format, $key)
 Return representation of a header field.
 
 _getID ()
 Return ID information from the IMAP server (RFC 2971).
 
 _getLanguage ($list)
 Gets the preferred language for server response messages (RFC 5255).
 
 _getLine (Horde_Imap_Client_Interaction_Pipeline $pipeline)
 Gets data from the IMAP server stream and parses it.
 
 _getMailboxList ($pattern, $mode, $options, $subscribed=null)
 Obtain a list of mailboxes.
 
 _getMboxFormatOb ($mailbox, $list=false)
 Return the proper mailbox format object based on the server's capabilities.
 
 _getMetadata (Horde_Imap_Client_Mailbox $mailbox, $entries, $options)
 Get metadata for a given mailbox.
 
 _getMsgCids ($mailbox, $ids)
 Return a list of cache IDs for mailbox/UID pairs.
 
 _getMyACLRights (Horde_Imap_Client_Mailbox $mailbox)
 Get the ACL rights for the current user for a given mailbox.
 
 _getNamespaces ()
 Get the NAMESPACE information from the IMAP server.
 
 _getQuota (Horde_Imap_Client_Mailbox $root)
 Get quota limits.
 
 _getQuotaRoot (Horde_Imap_Client_Mailbox $mailbox)
 Get quota limits for a mailbox.
 
 _getResponse ($multiline=false)
 Gets a line from the stream and parses it.
 
 _getSearchCache ($type, $options)
 Retrieve data from the search cache.
 
 _getSentDates (Horde_Imap_Client_Fetch_Results $data, $ids, $internal=false)
 Get the sent dates for purposes of SORT/THREAD sorting under RFC 5256 [2.2].
 
 _getSeqIds (Horde_Imap_Client_Ids $ids)
 Returns a list of sequence IDs.
 
 _getUid ( $mailbox)
 Return the UID for a mailbox/user/server combo.
 
 _getUidByMessageId ($mailbox, $msgid)
 Get a message UID by the Message-ID.
 
 _initCache ($current=false)
 Initialize the Horde_Imap_Client_Cache object, if necessary.
 
 _initCapability ()
 Retrieve capability information from the IMAP server.
 
 _initOb ()
 Do initialization tasks.
 
 _listACLRights (Horde_Imap_Client_Mailbox $mailbox, $identifier)
 Get ACL rights for a given mailbox/identifier.
 
 _listMailboxes ($pattern, $mode, $options)
 Obtain a list of mailboxes matching a pattern.
 
 _loadMailbox ($mailbox, $uidvalid=null)
 Loads basic mailbox information.
 
 _loadSlice ($mailbox, $slice)
 Load UIDs from a cache slice.
 
 _loadSliceMap ($mailbox, $uidvalid=null)
 Load the slicemap for a given mailbox.
 
 _loadUids ($mailbox, $uids, $uidvalid=null)
 Load UIDs by regenerating from the cache.
 
 _login ()
 Login to the IMAP server.
 
 _loginTasks ($firstlogin=true, array $resp=array())
 Perform login tasks.
 
 _logout ()
 Logout from the IMAP server (see RFC 3501 [6.1.3]).
 
 _mailboxOb ($mailbox=null)
 Return the Horde_Imap_Client_Base_Mailbox object.
 
 _mboxCompare ($a, $b)
 Hierarchical folder sorting function (used with usort()).
 
 _moveCache (Horde_Imap_Client_Mailbox $to, $map, $uidvalid)
 Moves cache entries from the current mailbox to another mailbox.
 
 _msgText ($stream, $data)
 Return text representation of a field.
 
 _noop ()
 Send a NOOP command.
 
 _normalize ()
 Normalize virtual rights (see RFC 4314 [2.1.1]).
 
 _normalizeProperty ($name)
 
 _openMailbox (Horde_Imap_Client_Mailbox $mailbox, $mode)
 Open a mailbox.
 
 _parse ($url)
 
 _parseACL (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse an ACL response (RFC 4314 [3.6]).
 
 _parseAnnotation (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse an ANNOTATION response (ANNOTATEMORE/ANNOTATEMORE2).
 
 _parseBodystructure (Horde_Imap_Client_Tokenize $data)
 Recursively parse BODYSTRUCTURE data from a FETCH return (see RFC 3501 [7.4.2]).
 
 _parseCapability (Horde_Imap_Client_Interaction_Pipeline $pipeline, $data)
 Parse a CAPABILITY Response (RFC 3501 [7.2.1]).
 
 _parseChallenge ($challenge)
 Parses and verifies the digest challenge.
 
 _parseComparator (Horde_Imap_Client_Interaction_Pipeline $pipeline, $data)
 Parse a COMPARATOR response (RFC 5255 [4.8])
 
 _parseEnabled (Horde_Imap_Client_Tokenize $data)
 Parse an ENABLED response (RFC 5161 [3.2]).
 
 _parseEnvelope (Horde_Imap_Client_Tokenize $data)
 Parse ENVELOPE data from a FETCH return (see RFC 3501 [7.4.2]).
 
 _parseEsearch (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse an ESEARCH response (RFC 4466 [2.6.2]) Format: (TAG "a567") UID COUNT 5 ALL 4:19,21,28.
 
 _parseFetch (Horde_Imap_Client_Interaction_Pipeline $pipeline, $id, Horde_Imap_Client_Tokenize $data)
 Parse a FETCH response (RFC 3501 [7.4.2]).
 
 _parseID (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse an ID response (RFC 2971 [3.2]).
 
 _parseLanguage (Horde_Imap_Client_Tokenize $data)
 Parse a LANGUAGE response (RFC 5255 [3.3]).
 
 _parseList (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse a LIST/LSUB response (RFC 3501 [7.2.2 & 7.2.3]).
 
 _parseListRights (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse a LISTRIGHTS response (RFC 4314 [3.7]).
 
 _parseMetadata (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse a METADATA response (RFC 5464 [4.4]).
 
 _parseMyRights (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse a MYRIGHTS response (RFC 4314 [3.8]).
 
 _parseNamespace (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse a NAMESPACE response (RFC 2342 [5] & RFC 5255 [3.4]).
 
 _parseQuota (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse a QUOTA response (RFC 2087 [5.1]).
 
 _parseResponseCode ($text)
 Parses response text for response codes (RFC 2449 [8]).
 
 _parseSearch (Horde_Imap_Client_Interaction_Pipeline $pipeline, $data)
 Parse a SEARCH/SORT response (RFC 3501 [7.2.5]; RFC 4466 [3]; RFC 5256 [4]; RFC 5267 [3]).
 
 _parseStatus (Horde_Imap_Client_Tokenize $data)
 Parse a STATUS response (RFC 3501 [7.2.4]).
 
 _parseStructureParams ($data)
 Helper function to parse a parameters-like tokenized array.
 
 _parseThread (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse a THREAD response (RFC 5256 [4]).
 
 _parseThreadLevel (&$thread, Horde_Imap_Client_Tokenize $data, $level=0)
 Parse a level of a THREAD response (RFC 5256 [4]).
 
 _parseUrl (array $data)
 
 _parseVanished (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data)
 Parse a VANISHED response (RFC 7162 [3.2.10]).
 
 _partialAtom ($opts)
 Add a partial atom to an IMAP command based on the criteria options.
 
 _pipeline ($cmd=null)
 Shortcut to creating a new pipeline object.
 
 _pop3Cache ( $type, $index=self::MBOX_CACHE, $data=null)
 Retrieve locally cached message data.
 
 _prepareStatusResponse ($request, $mailbox)
 Prepares a status response for a mailbox.
 
 _processCmd ($pipeline, $cmd, $data)
 Process/send a command to the remote server.
 
 _processCmdContinuation ($pipeline, $noexception=false)
 Process a command continuation response.
 
 _processString ($str, $opts)
 Process a string response based on criteria options.
 
 _removeBlob ($str, $i)
 Remove "[...]" text.
 
 _removeBlobWhenNonempty (&$str)
 Remove "[...]" text if it doesn't result in the subject becoming empty.
 
 _removeSubjFwdHdr (&$str)
 Remove a "[fwd: ... ]" string.
 
 _removeSubjLeader (&$str, $keepblob=false)
 Remove all prefix text of the subject that matches the subj-leader ABNF.
 
 _renameMailbox (Horde_Imap_Client_Mailbox $old, Horde_Imap_Client_Mailbox $new)
 Rename a mailbox.
 
 _resolveIds ($ids)
 Resolve the $ids input to add() and remove().
 
 _responseCode (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Interaction_Server $ob)
 Handle status responses (see RFC 3501 [7.1]).
 
 _search ($query, $options)
 Search a mailbox.
 
 _sendCmd ($cmd)
 Sends command(s) to the IMAP server.
 
 _sendCmdChunk ($pipeline, $chunk)
 Send a chunk of commands and/or continuation fragments to the server.
 
 _sendID ($info)
 Send ID information to the IMAP server (RFC 2971).
 
 _sendLine ($cmd, $options=array())
 Perform a command on the server.
 
 _serverResponse (Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Interaction_Server $ob)
 Handle untagged server responses (see RFC 3501 [2.2.2]).
 
 _setACL (Horde_Imap_Client_Mailbox $mailbox, $identifier, $options)
 Set ACL rights for a given mailbox/identifier.
 
 _setComparator ($comparator)
 Set the comparator to use for searching/sorting (RFC 5255).
 
 _setInit ($key=null, $val=null)
 Set an initialization value.
 
 _setLanguage ($langs)
 Sets the preferred language for server response messages (RFC 5255).
 
 _setMetadata (Horde_Imap_Client_Mailbox $mailbox, $data)
 Set metadata for a given mailbox/identifier.
 
 _setMixed ($data)
 Converts mixed input (string or resource) to the correct internal representation.
 
 _setQuota (Horde_Imap_Client_Mailbox $root, $resources)
 Set quota limits.
 
 _setSearchCache ($data, $sdata)
 Set data in the search cache.
 
 _sort (&$ids)
 Sorts the IDs numerically.
 
 _sortString (&$sorted)
 Sort an array of strings based on current locale.
 
 _stableAsort (&$a)
 Stable asort() function.
 
 _status ($mboxes, $flags)
 Obtain status information for mailboxes.
 
 _store ($options)
 Store message flag data.
 
 _storeCmd ($options)
 Create a store command.
 
 _subscribeMailbox (Horde_Imap_Client_Mailbox $mailbox, $subscribe)
 Manage subscription status for a mailbox.
 
 _syncStatus ($mailbox)
 Return the current mailbox synchronization status.
 
 _thread ($options)
 Thread sort a given list of messages (RFC 5256).
 
 _toImapString ()
 
 _toSequenceString ($sort=true)
 Create an IMAP message sequence string from a list of indices.
 
 _toUpdate ($mailbox, $type, $data)
 Add update entry for a mailbox.
 
 _tryLogin ($method)
 Authenticate to the IMAP server.
 
 _updateCache (Horde_Imap_Client_Fetch_Results $data)
 Store FETCH data in cache.
 
 _updateModSeq ($modseq)
 Updates the cached MODSEQ value.
 
 _value ($data)
 Convert data from/to storage format.
 
 _vanished ($modseq, Horde_Imap_Client_Ids $ids)
 Get the list of vanished messages.
 
 _write ($msg, $pre=null)
 Write debug information to the output stream.
 
 add ($alert, $type=null)
 Add an alert.
 
 add ($ids)
 Add IDs to the current object.
 
 add (Horde_Imap_Client_Interaction_Command $cmd, $top=false)
 Add a command to the pipeline.
 
 addLiteralStream ($data)
 Add data to literal stream at the current position.
 
 alerts ()
 Return a list of alerts that MUST be presented to the user (RFC 3501 [7.1]).
 
 allAclRights ()
 Return master list of ACL rights available on the server.
 
 andSearch ($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.
 
 append ($mailbox, $data, array $options=array())
 Append message(s) to a mailbox.
 
 attach (SplObserver $observer)
 
 binary ()
 If literal output, is the data binary?
 
 bodyPart ($id, array $opts=array())
 Return the body part data for a MIME ID.
 
 bodyPartSize ($id)
 Returns the decoded body part size for a MIME ID.
 
 bodyText (array $opts=array())
 Return body text.
 
 build ($exts=array())
 Builds an IMAP4rev1 compliant search string.
 
 capability ()
 Get CAPABILITY information from the IMAP server.
 
 charset ($charset, $convert=true)
 Sets the charset of the search text.
 
 check ()
 Request a checkpoint of the currently selected mailbox (RFC 3501 [6.4.1]).
 
 checkMongoIndices ()
 
 clear ($lifetime=null)
 Clear the cache.
 
 clear ()
 Clears all fetch results.
 
 client ($msg)
 Write client output to debug log.
 
 clientSort ($res, $opts)
 Sort search results client side if the server does not support the SORT IMAP extension (RFC 5256).
 
 close (array $options=array())
 Close the connection to the currently selected mailbox, optionally expunging all deleted messages (RFC 3501 [6.4.2]).
 
 complete (Horde_Imap_Client_Interaction_Server_Tagged $resp)
 Mark a command as completed.
 
 contains ($criteria)
 Does the query contain the given criteria?
 
 copy ($source, $dest, array $options=array())
 Copy messages to another mailbox.
 
 count ()
 
static create (Horde_Imap_Client_Tokenize $t)
 Auto-scan an incoming line to determine the response type.
 
 createMailbox ($mailbox, array $opts=array())
 Create a mailbox.
 
 createMongoIndices ()
 
 current ()
 
 currentMailbox ()
 Return the currently opened mailbox and access mode.
 
 dateSearch ($date, $range, $header=true, $not=false, array $opts=array())
 Search for messages within a date range.
 
 dateTimeSearch ($date, $range, $header=true, $not=false, array $opts=array())
 Search for messages within a date and time range.
 
 deleteACL ($mailbox, $identifier)
 Deletes ACL rights for a given mailbox/identifier.
 
 deleteMailbox ($mailbox)
 Delete a mailbox.
 
 deleteMsgs ($mailbox, $uids)
 Delete messages in the cache.
 
 detach (SplObserver $observer)
 
 diff ($rights)
 Computes the difference to another rights string.
 
 enable ($capability, $enable=true)
 Set a capability as enabled/disabled.
 
 envelope ()
 Return envelope header data.
 
 equals ($mbox)
 Compares this mailbox to another mailbox string.
 
 escape ()
 Returns the data formatted for output to the IMAP server.
 
 escapeStream ()
 Return the escaped string as a stream.
 
 exists ($type)
 Does this object containing cacheable data of the given type?
 
 expunge ($mailbox, array $options=array())
 Expunge deleted messages from the given mailbox.
 
 fetch ($mailbox, $query, array $options=array())
 Fetch message data (see RFC 3501 [6.4.5]).
 
 fetchFromUrl (Horde_Imap_Client_Url_Imap $url)
 Given an IMAP URL, fetches the corresponding part.
 
 filter ($in, $out, &$consumed, $closing)
 
 first ()
 Return the first fetch object in the results, if there is only one object.
 
 flag ($name, $set=true, array $opts=array())
 Search for a flag/keywords.
 
 flags ()
 Return flags set for the message.
 
 flagSearch ()
 Determines if flags are a part of the search.
 
 flushIterator ($return=true, $sublevel=true)
 Flush the remaining entries left in the iterator.
 
 forceBinary ()
 Force item to be output as a binary literal.
 
 forceLiteral ()
 Force item to be output as a literal.
 
 forceQuoted ()
 Force item to be output quoted.
 
 fullText (array $opts=array())
 Get the full text of the message.
 
 get ($key)
 Return a fetch object, creating and storing an empty object in the results set if it doesn't currently exist.
 
 get ($mailbox, $uids, $fields, $uidvalid)
 Get information from the cache for a set of UIDs.
 
 get ($mailbox, array $uids=array(), $fields=array(), $uidvalid=null)
 Get information from the cache.
 
static get ($mbox, $utf7imap=false)
 Shortcut to obtaining mailbox object.
 
 getACL ($mailbox)
 Get the ACL rights for a given mailbox.
 
 getBodyPart ($id, $stream=false)
 Get a body part entry.
 
 getBodyPartDecode ($id)
 Determines if/how a body part was MIME decoded on the server.
 
 getBodyPartSize ($id)
 Returns the body part size, if returned by the server.
 
 getBodyText ($id=0, $stream=false)
 Get a body text entry.
 
 getCache ()
 Returns the Horde_Imap_Client_Cache object used, if available.
 
 getCachedUids ($mailbox, $uidvalid)
 Get the list of cached UIDs.
 
 getCacheId ($mailbox, array $addl=array())
 Returns a unique identifier for the current mailbox status.
 
 getClientFinalMessage ()
 Return the final client message.
 
 getClientFirstMessage ()
 Return the initial client message.
 
 getCmd ($tag)
 Return the command for a given tag.
 
 getCommand ()
 Get the command.
 
 getCommands (Horde_Imap_Client_Interaction_Server_Continuation $ob)
 Calls the closure object.
 
 getComparator ()
 Get the comparator used for searching/sorting (RFC 5255).
 
 getData ()
 Returns the raw data.
 
 getEnvelope ()
 Get envelope data.
 
 getFlags ()
 Get IMAP flags.
 
 getFullMsg ($stream=false)
 Returns the full message.
 
 getHeaders ($label, $format=0)
 Get a header entry.
 
 getHeaderText ($id=0, $format=0)
 Get a header text entry.
 
 getID ()
 Return ID information from the IMAP server (RFC 2971).
 
 getIdsOb ($ids=null, $sequence=false)
 Returns the correct IDs object for use with this driver.
 
 getImapDate ()
 Get internal IMAP date.
 
 getIterator ()
 
 getLanguage ($list=false)
 Gets the preferred language for server response messages (RFC 5255).
 
 getLast ()
 Returns the last alert received.
 
 getLiteralLength ()
 Return literal length data located at the end of the stream.
 
 getMetaData ($mailbox, $uidvalid, $entries)
 Get metadata information for a mailbox.
 
 getMetaData ($mailbox, $uidvalid=null, array $entries=array())
 Get metadata information for a mailbox.
 
 getMetadata ($mailbox, $entries, array $options=array())
 Get metadata for a given mailbox.
 
 getMimeHeader ($id, $format=0)
 Get a MIME header entry.
 
 getModSeq ()
 Get the modified sequence value for the message.
 
 getMyACLRights ($mailbox)
 Get the ACL rights for the current user for a given mailbox.
 
 getNamespace ($mbox, $personal=false)
 Get namespace info for a full mailbox path.
 
 getNamespaces (array $additional=array(), array $opts=array())
 Get the NAMESPACE information from the IMAP server (RFC 2342).
 
 getParam ($key)
 Returns a value from the internal params array.
 
 getParams ($capability)
 Return the list of parameters for an extension.
 
 getPassword ()
 Return the password to use for the server connection.
 
 getQuota ($root)
 Get quota limits.
 
 getQuotaRoot ($mailbox)
 Get quota limits for a mailbox.
 
 getRawData ()
 Return the internal representation of the data.
 
 getSeq ()
 Get message sequence number.
 
 getSize ()
 Get message size.
 
 getStatus ($entry)
 Get status information for the mailbox.
 
 getStream ()
 Return the contents of the string as a stream object.
 
 getString ($type=self::RFC_4314)
 Returns the raw string to use in IMAP server calls.
 
 getStructure ()
 Get the message structure.
 
 getSyncToken ($mailbox)
 Returns a unique token for the current mailbox synchronization status.
 
 getThread ($index)
 Returns the list of messages in a thread.
 
 getThreads ()
 Returns array of all threads.
 
 getTimer ()
 Return the timer data.
 
 getType ()
 Return the ID type.
 
 getUid ()
 Get UID.
 
 hash ()
 Returns a hash of the current query object.
 
 headers ($label, $search, array $opts=array())
 Returns RFC 2822 header text that matches a search string.
 
 headerText ($header, $text, $not=false, array $opts=array())
 Search for text in the header of a message.
 
 headerText (array $opts=array())
 Return header text.
 
 ids ()
 Return the list of IDs.
 
 ids (Horde_Imap_Client_Ids $ids, $not=false, array $opts=array())
 Search for messages within a given UID range.
 
 imapDate ()
 Return the internal (IMAP) date of the message.
 
 info ($msg)
 Write informational message to debug log.
 
 intervalSearch ($interval, $range, $not=false, array $opts=array())
 Search for messages within a given interval.
 
 isDefault ()
 Does this object contain only default values for all fields?
 
 isDowngraded ()
 Does the message contain internationalized downgraded data (i.e.
 
 isEmpty ()
 Is this object empty (i.e.
 
 isEnabled ($capability=null)
 Is the extension enabled?
 
 isSecureConnection ()
 Display if connection to the server has been secured via TLS or SSL.
 
 key ()
 
 length ()
 Return the length of the data.
 
 listACLRights ($mailbox, $identifier)
 List the ACL rights for a given mailbox/identifier.
 
 listMailboxes ($pattern, $mode=Horde_Imap_Client::MBOX_ALL, array $options=array())
 Obtain a list of mailboxes matching a pattern.
 
 literal ()
 Does this data item require literal string output?
 
 login ()
 Login to the IMAP server.
 
 logout ()
 Logout from the IMAP server (see RFC 3501 [6.1.3]).
 
 lookup (Horde_Imap_Client_Ids $ids)
 Create a Sequence <-> UID lookup table.
 
 merge (Horde_Imap_Client_Data_Fetch $data)
 Merge a fetch object into this one.
 
 messageList ()
 Return the sorted list of messages indices.
 
 messagePrintf (array $args=array())
 Perform substitution of variables in the error message.
 
 mimeHeader ($id, array $opts=array())
 Return MIME header text.
 
 modseq ($value, $name=null, $type=null, $not=false, array $opts=array())
 Search for messages modified since a specific moment.
 
 modseq ()
 Return the mod-sequence value for the message.
 
 newMsgs ($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).
 
 next ()
 
 nextStream ()
 Force return of literal data as stream, if next token.
 
 noop ()
 Send a NOOP command (RFC 3501 [6.1.2]).
 
 notify ()
 Notification is triggered internally whenever the object's internal data storage is altered.
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 onCreate ()
 
 openMailbox ($mailbox, $mode=Horde_Imap_Client::OPEN_AUTO)
 Open a mailbox.
 
 orSearch ($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.
 
 parseCacheId ($id)
 Parses a cacheID created by getCacheId().
 
 parseServerFinalMessage ($msg)
 Process the final server message response.
 
 parseServerFirstMessage ($msg)
 Process the initial server message response.
 
 previousSearch ($not=false, array $opts=array())
 Use the results from the previous SEARCH command.
 
 query ($capability, $parameter=null)
 Returns whether the server supports the given capability.
 
 queryCapability ($capability)
 Returns whether the IMAP server supports the given capability (See RFC 3501 [6.1.1]).
 
 quoted ()
 Does this data item require quoted string output?
 
 raw ($msg)
 Write server output to debug log.
 
 read ($size=null)
 Read data from incoming POP3 stream.
 
 remove ($capability, $params=null)
 Remove a capability.
 
 remove ($ids)
 Removed IDs from the current object.
 
 remove (Horde_Imap_Client_Ids $ids)
 Removes messages from the ID mapping.
 
 renameMailbox ($old, $new)
 Rename a mailbox.
 
 reset ()
 Reset the mailbox information.
 
 resolveIds (Horde_Imap_Client_Mailbox $mailbox, Horde_Imap_Client_Ids $ids, $convert=0)
 Resolves an IDs object into a list of IDs.
 
 reverse ()
 Reverses the order of the IDs.
 
 rewind ()
 
 save ()
 Updates the cache.
 
 search ($mailbox, $query=null, array $options=array())
 Search a mailbox.
 
 sendID ($info=null)
 Send ID information to the IMAP server (RFC 2971).
 
 seq ()
 Return the sequence number of the message.
 
 serialize ()
 
 server ($msg)
 Write server output to debug log.
 
 set ($mailbox, $data, $uidvalid)
 Store information in cache.
 
 setACL ($mailbox, $identifier, $options)
 Set ACL rights for a given mailbox/identifier.
 
 setBaseOb (Horde_Imap_Client_Base $ob)
 
 setBodyPart ($id, $text, $decode=null)
 Set a body part entry.
 
 setBodyPartSize ($id, $size)
 Set the body part size for a body part.
 
 setBodyText ($id, $text)
 Set a body text entry.
 
 setCode ($code)
 Allow the error code to be altered.
 
 setComparator ($comparator=null)
 Set the comparator to use for searching/sorting (RFC 5255).
 
 setDowngraded ($downgraded)
 Set the internationalized downgraded status for the message.
 
 setEnvelope ($data)
 Set envelope data.
 
 setFlags (array $flags)
 Set IMAP flags.
 
 setFullMsg ($msg)
 Set the full message property.
 
 setHeaders ($label, $data)
 Set a header entry.
 
 setHeaderText ($id, $text)
 Set a header text entry.
 
 setImapDate ($date)
 Set IMAP internal date.
 
 setLanguage ($langs=null)
 Sets the preferred language for server response messages (RFC 5255).
 
 setMessage ($msg)
 Allow the error message to be altered.
 
 setMetaData ($mailbox, $data)
 Set metadata information for a mailbox.
 
 setMetaData ($mailbox, $uidvalid, array $data=array())
 Set metadata information for a mailbox.
 
 setMetadata ($mailbox, $data)
 Set metadata for a given mailbox/identifier.
 
 setMimeHeader ($id, $text)
 Set a MIME header entry.
 
 setModSeq ($modseq)
 Set the modified sequence value for the message.
 
 setParam ($key, $val)
 Sets a configuration parameter value.
 
 setParams (array $params=array())
 Add configuration parameters.
 
 setQuota ($root, array $resources=array())
 Set quota limits.
 
 setSeq ($seq)
 Set message sequence number.
 
 setSize ($size)
 Set message size.
 
 setStatus ($entry, $value)
 Set status information for the mailbox.
 
 setStructure (Horde_Mime_Part $structure)
 Set the message structure.
 
 setUid ($uid)
 Set UID.
 
 setValid ($charset, $valid=true)
 Set the validity of a given charset.
 
 shutdown ()
 Shutdown actions.
 
 size ($size, $larger=false, $not=false, array $opts=array())
 Search for messages smaller/larger than a certain size.
 
 size ()
 Return the size (in bytes) of the message.
 
 sort ()
 Sorts the IDs.
 
 sort (array $opts=array())
 Sort the list of mailboxes.
 
 split ($length)
 Split the sequence string at an approximate length.
 
 startTimer ()
 Start the command timer.
 
 status ($mailbox, $flags=Horde_Imap_Client::STATUS_ALL, array $opts=array())
 Obtain status information for a mailbox.
 
 statusMultiple ($mailboxes, $flags=Horde_Imap_Client::STATUS_ALL, array $opts=array())
 Perform a STATUS call on multiple mailboxes at the same time.
 
 store ($mailbox, array $options=array())
 Store message flag data (see RFC 3501 [6.4.6]).
 
 stripNamespace ($mbox)
 Strips namespace information from the given mailbox name.
 
 stripNonAtomCharacters ()
 Strip out any characters that are not allowed in an IMAP atom.
 
 structure ()
 Return MIME structure information.
 
 subscribeMailbox ($mailbox, $subscribe=true)
 Manage subscription status for a mailbox.
 
 sync ($mailbox, $token, array $opts=array())
 Synchronize a mailbox from a sync token.
 
 text ($text, $bodyonly=true, $not=false, array $opts=array())
 Search for text in either the entire message, or just the body.
 
 thread ($mailbox, array $options=array())
 Thread sort a given list of messages (RFC 5256).
 
 threadOrderedSubject (Horde_Imap_Client_Fetch_Results $data, $uids)
 If server does not support the THREAD IMAP extension (RFC 5256), do ORDEREDSUBJECT threading on the client side.
 
 toArray ()
 Returns the raw data.
 
 uid ()
 Return the unique ID of the message.
 
 unserialize ($data)
 
 update ($ids)
 Updates the mapping.
 
 update (SplSubject $subject)
 
static Utf7ImapToUtf8 ($str)
 Convert a string from UTF7-IMAP to UTF-8.
 
static Utf8ToUtf7Imap ($str, $force=true)
 Convert a string from UTF-8 to UTF7-IMAP.
 
 valid ()
 
 validSearchCharset ($charset)
 Determines if the given charset is valid for search-related queries.
 
 vanished ($mailbox, $modseq, array $opts=array())
 Get the list of vanished messages (UIDs that have been expunged since a given mod-sequence value).
 
 verify ()
 Verify the data.
 
 write ($data, $debug=true)
 Writes data to the POP3 output stream.
 
 writeLiteral ($data, $length, $binary=false)
 Writes literal data to the IMAP output stream.
 

Variables

Horde_Imap_Client_Base_Alerts $_alerts
 Alerts reporting object.
 
Horde_Imap_Client_Cache_Backend $_backend
 Storage backend.
 
string $_buffer = ''
 Sending buffer.
 
Horde_Imap_Client_Cache $_cache = null
 The Horde_Imap_Client_Cache object.
 
Horde_Cache $_cache
 The cache object.
 
string $_charset = null
 The charset of the search strings.
 
array $_charsets
 Charset data.
 
boolean $_checkStatus = true
 Check for status response?
 
Closure $_closure
 Closure function to run after continuation response.
 
array $_cmdQueue = array()
 Queued commands to send to the server.
 
array $_commands = array()
 The list of commands.
 
Horde Socket Client $_connection = null
 Connection to the IMAP server.
 
array $_data = array()
 The working data for the current pageload.
 
array $_data = array()
 The working data for the current pageload.
 
Horde_Mime_Headers $_data
 Data object.
 
array $_data = array()
 Internal data array.
 
array $_data = array()
 Data object.
 
array $_data = array()
 Internal data array.
 
Horde_Db_Adapter $_db
 Handle for the database connection.
 
MongoDB $_db
 The MongoDB object for the cache data.
 
Horde_Imap_Client_Base_Debug $_debug = null
 The debug object.
 
Horde_Imap_Client_Base_Debug $_debug = false
 Debug output.
 
array $_defaultPorts = array()
 The default ports to use for a connection.
 
array $_defaultPorts = array(143, 993)
 The default ports to use for a connection.
 
array $_defaultPorts = array(110, 995)
 The default ports to use for a connection.
 
array $_deleted = array()
 The list of deleted messages.
 
string $_fetchDataClass = 'Horde_Imap_Client_Data_Fetch'
 The fetch data object type to return.
 
string $_fetchDataClass = 'Horde_Imap_Client_Data_Fetch_Pop3'
 This object returns POP3 Fetch data objects.
 
Horde_Imap_Client_Ids $_flagsuids
 UIDs of messages that have had flag changes.
 
string $_hash
 Hash name.
 
Horde_HashTable $_hash
 HashTable object.
 
string $_host = null
 The server name.
 
mixed $_ids = array()
 List of IDs.
 
array $_indices
 The list of indices.
 
array $_init
 Cached server data.
 
boolean $_isAuthenticated = false
 Is there an active authenticated connection to the IMAP Server?
 
integer $_iterations
 Number of Hi iterations (RFC 5802 [2]).
 
integer $_key = false
 Current key.
 
integer $_keyType
 Key type.
 
integer $_level = false
 Sublevel.
 
array $_literals = array()
 Array of literal stream objects.
 
boolean $_literalStream = false
 Return Horde_Stream object for literal tokens?
 
array $_loaded = array()
 The list of cache slices loaded.
 
Horde_Imap_Client_Mailbox $_mailbox
 Mailbox object.
 
array $_mbox = array()
 Mailbox level data.
 
array $_mboxes = array()
 Mailbox list.
 
static array $_mbstring = null
 Is mbstring extension available?
 
integer $_mode = 0
 The current mailbox selection mode.
 
Horde_Imap_Client_Ids $_newmsgsuids
 UIDs of new messages.
 
array $_nextModify = array()
 next() modifiers.
 
string $_nonce
 Nonce.
 
string $_obClass
 Class to use when creating a new fetch object.
 
array $_observers = array()
 Observers.
 
array $_observers = array()
 Observers.
 
array $_observers = array()
 Observers.
 
Horde_Pack $_pack
 Horde_Pack singleton object.
 
array $_params = array()
 Hash containing connection parameters.
 
array $_params = array()
 The configuration params.
 
string $_partial
 Byte range for use with IMAP FETCH command.
 
string $_pass
 Password.
 
static string $_pearDirectory = '@data_dir@'
 The absolute PEAR path to the translations for the default gettext handler.
 
integer $_port = null
 The port.
 
array $_required = array()
 ACL required rights.
 
string $_salt
 Server salt.
 
array $_search = array()
 The list of search params.
 
string $_search
 Search query to be run with IMAP SEARCH.
 
string $_section
 MIME part ID.
 
Horde_Imap_Client_Mailbox $_selected = null
 The currently selected mailbox.
 
boolean $_sequence = false
 Are IDs message sequence numbers?
 
Horde_Imap_Client_Interaction_Server $_server
 Server response object.
 
string $_serversig
 Calculated server signature value.
 
array $_slicemap = array()
 The mapping of UIDs to slices.
 
Horde_Imap_Client_Socket $_socket
 Socket object.
 
boolean $_sorted = false
 Are IDs sorted?
 
boolean $_sorted = true
 Is the array sorted?
 
boolean $_sortinbox
 Should we sort with INBOX at the front of the list?
 
array $_status = array()
 Status information.
 
array $_statusFields
 Mapping of status fields to IMAP names.
 
resource $_stream
 The debug stream.
 
Horde_Stream $_stream
 Data stream.
 
integer $_tag = 0
 The unique tag to use when making an IMAP query.
 
array $_temp = array()
 Temp array (destroyed at end of process).
 
integer $_time = null
 Timestamp of last command.
 
Horde_Support_Timer $_timer
 Command timer.
 
array $_todo = array()
 The list of commands to complete.
 
string $_type
 The index type.
 
string $_uid
 IMAP UID.
 
integer $_uidvalidity
 IMAP UIDVALIDITY for the given mailbox.
 
array $_update = array()
 The list of items to update:
 
array $_update = array()
 List of mailbox/UIDs to update.
 
string $_urlauth
 URLAUTH info (not parsed).
 
string $_user
 Username.
 
string $_username = null
 The username.
 
string $_utf8
 UTF8 representation of mailbox.
 
Horde_Imap_Client_Ids $_vanisheduids
 UIDs of messages that have vanished.
 
array $_virtual
 List of virtual rights (RFC 4314 [2.1.1]).
 
array $cacheFields
 The list of fetch fields that can be cached, and their cache names.
 
static array $capability_deps
 Capability dependencies.
 
boolean $changed = false
 Has the internal configuration changed?
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see $condstore
 
boolean $debug = true
 Is debugging active?
 
boolean $duplicates = false
 Allow duplicate IDs?
 
Horde_Imap_Client_Fetch_Results $fetch
 Fetch results.
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see $fields
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see boolean $flags = null
 Are there messages that have had flag changes?
 
integer $highestmodseq = null
 The previous value of HIGHESTMODSEQ.
 
string $hostspec = null
 The remote server (not present for relative URLs).
 
boolean $literal8 = false
 Are literal8's available?
 
boolean $literalplus = true
 Use LITERAL+ if available.
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see $mailbox
 
Horde_Imap_Client_Mailbox $mailbox
 The synchronized mailbox.
 
string $mailbox = null
 The IMAP mailbox.
 
integer $messages = null
 The previous number of messages in the mailbox.
 
boolean $newmsgs = null
 Are there new messages?
 
return $ob
 
return $ob
 
callback $on_error = null
 A callback to run on error.
 
callback $on_success = null
 A callback to run on success.
 
boolean $open
 Is mailbox opened?
 
string $partial = null
 A byte range for use with IMAP FETCH.
 
Horde_Imap_Client_Interaction_Pipeline $pipeline
 Pipeline object associated with this command.
 
integer $port = null
 The remote port (not present for relative URLs).
 
string $protocol = null
 The protocol type.
 
string $raw_msg = ''
 Raw error message (in English).
 
Horde_Imap_Client_Interaction_Server $response
 Server response.
 
object $responseCode = null
 Response code (RFC 3501 [7.1]).
 
string $search = null
 A search query to be run with IMAP SEARCH.
 
string $section = null
 A MIME part ID.
 
string $status = null
 Status response from the server.
 
boolean $statuscache = true
 Horde_Imap_Client is optimized for short (i.e.
 
boolean $sync
 Is mailbox sync'd with remote server (via CONDSTORE/QRESYNC)?
 
string $tag
 The command tag.
 
Horde_Imap_Client_Tokenize $token
 IMAP server data.
 
string $uid = null
 The IMAP UID.
 
integer $uidnext = null
 The previous value of UIDNEXT.
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see $uids
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see $uidvalid
 
integer $uidvalidity = null
 The previous value of UIDVALIDITY.
 
integer $uidvalidity = null
 The IMAP UIDVALIDITY for the given mailbox.
 
string $urlauth = null
 URLAUTH info (not parsed).
 
string $username
 Username.
 
string $username = null
 The username to use on the remote server.
 
Horde_Imap_Client_Ids $vanished = null
 The UIDs of messages that are guaranteed to have vanished.
 
default __pad0__
 
const ACL_ADMINISTER = 'a'
 
const ACL_CREATE = 'c'
 
const ACL_CREATEMBOX = 'k'
 
const ACL_DELETE = 'd'
 
const ACL_DELETEMBOX = 'x'
 
const ACL_DELETEMSGS = 't'
 
const ACL_EXPUNGE = 'e'
 
const ACL_INSERT = 'i'
 
const ACL_LOOKUP = 'l'
 
const ACL_POST = 'p'
 
const ACL_READ = 'r'
 
const ACL_SEEN = 's'
 
const ACL_WRITE = 'w'
 
const ALREADYEXISTS = 22
 The operation failed because the requested creation object already exists.
 
const BADCHARSET = 5
 The charset used in the search query is not supported on the server.
 
const BADCOMPARATOR = 9
 The comparator specified by setComparator() was not recognized by the IMAP server.
 
const BASE_HOSTSPEC = 'hostspec'
 Mongo field names: BASE collection.
 
const BASE_MAILBOX = 'mailbox'
 
const BASE_MODIFIED = 'modified'
 
const BASE_PORT = 'port'
 
const BASE_UID = 'data'
 
const BASE_USERNAME = 'username'
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth below
 
const BYE = 2
 
const CACHE_DOWNGRADED = 'HICdg'
 Cache names used exclusively within this class.
 
const CACHE_MODSEQ = '_m'
 Cache names for miscellaneous data.
 
const CACHE_SEARCH = '_s'
 
const CACHE_SEARCHID = '_i'
 
const CATENATE_BADURL = 13
 Thrown on CATENATE if the URL is invalid.
 
const CATENATE_TOOBIG = 14
 Thrown on CATENATE if the message was too big.
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT| *|LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE,| *|DATA, OR PROFITS;OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY| *|THEORY OF LIABILITY WHETHER I CONTRACT )
 
OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY *THEORY OF WHETHER IN CONTRACT
 
const CORRUPTION = 19
 The operation failed because data on the server was corrupt.
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Countable
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Countable
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Countable
 
LOSS OF * DATA
 
const DATE_BEFORE = 'BEFORE'
 Constants for dateSearch()
 
const DATE_ON = 'ON'
 
const DATE_SINCE = 'SINCE'
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT
 
const DISCONNECT = 4
 The server ended the connection.
 
 else
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY EXEMPLARY
 
const FETCH_BODYPART = 6
 
const FETCH_BODYPARTSIZE = 7
 
const FETCH_BODYTEXT = 4
 
const FETCH_DOWNGRADED = 16
 
const FETCH_ENVELOPE = 9
 
const FETCH_FLAGS = 10
 
const FETCH_FULLMSG = 2
 
const FETCH_HEADERS = 8
 
const FETCH_HEADERTEXT = 3
 
const FETCH_IMAPDATE = 11
 
const FETCH_MIMEHEADER = 5
 
const FETCH_MODSEQ = 15
 
const FETCH_SEQ = 14
 
const FETCH_SIZE = 12
 
const FETCH_STRUCTURE = 1
 
const FETCH_UID = 13
 
const FLAG_ANSWERED = '\\answered'
 
const FLAG_DELETED = '\\deleted'
 
const FLAG_DRAFT = '\\draft'
 
const FLAG_FLAGGED = '\\flagged'
 
const FLAG_FORWARDED = '$forwarded'
 
const FLAG_JUNK = '$junk'
 
const FLAG_MDNSENT = '$mdnsent'
 
const FLAG_NOTJUNK = '$notjunk'
 
const FLAG_RECENT = '\\recent'
 
const FLAG_SEEN = '\\seen'
 
const HEADER_STREAM = 2
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT| *|LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE,| *|DATA, OR PROFITS;OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY| *|THEORY OF LIABILITY WHETHER IN STRICT OR TORT *INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE *OF THIS EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ***category Horde *copyright Richard Heyes *copyright Horde LLC *licens http )
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*getBaseSubject() code adapted from imap-base-subject.c(Dovecot 1.2) *Original code released under the LGPL-2.1 *Copyright(c) 2002-2008 Timo Sirainen< tss @iki.fi > **See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see http
 
*Copyright(C) 2000 Edmund Grimley Evans< edmundo @rano.org > *Released under the GPL(version 2) **Translated from C to PHP by Thomas Bruederli< roundcube @gmail.com > *Code extracted from the RoundCube Webmail(http(version 2) **Copyright 2008-2017 Horde LLC(http(LGPL). If you *did not receive this file see http
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INCIDENTAL
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED INCLUDING
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT
 
const INTERVAL_OLDER = 'OLDER'
 Constants for intervalSearch()
 
const INTERVAL_YOUNGER = 'YOUNGER'
 
const INUSE = 18
 The operation was not successful because another user is holding a necessary resource.
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Iterator
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Iterator
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Iterator
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see IteratorAggregate
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see IteratorAggregate
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see IteratorAggregate
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see IteratorAggregate
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see IteratorAggregate
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see IteratorAggregate
 
const LARGEST = "\03"
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT| *|LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE,| *|DATA, OR PROFITS;OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY| *|THEORY OF LIABILITY WHETHER IN STRIC LIABILITY )
 
OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY *THEORY OF LIABILITY
 
const LIMIT = 20
 The operation failed because it exceeded some limit on the server.
 
const LOGIN_AUTHENTICATIONFAILED = 102
 Generic authentication failure.
 
const LOGIN_AUTHORIZATIONFAILED = 104
 Authentication succeeded, but authorization failed.
 
const LOGIN_EXPIRED = 105
 Authentication is no longer permitted with this passphrase.
 
const LOGIN_NOAUTHMETHOD = 101
 Could not find an available authentication method.
 
const LOGIN_PRIVACYREQUIRED = 106
 Login requires privacy.
 
const LOGIN_SERVER_VERIFICATION_FAILED = 107
 Server verification failed (SCRAM authentication).
 
const LOGIN_TLSFAILURE = 100
 Could not start mandatory TLS connection.
 
const LOGIN_UNAVAILABLE = 103
 Remote server is unavailable.
 
const MAILBOX_NOOPEN = 200
 Could not open/access mailbox.
 
const MAILBOX_READONLY = 201
 Could not complete the command because the mailbox is read-only.
 
const MBOX_ALL = 4
 
const MBOX_ALL_SUBSCRIBED = 5
 
const MBOX_SUBSCRIBED = 1
 
const MBOX_SUBSCRIBED_EXISTS = 2
 
const MBOX_UNSUBSCRIBED = 3
 
const MBOXNOMODSEQ = 10
 RFC 7162 [3.1.2.2] - All mailboxes are not required to support mod-sequences.
 
const MD = 'horde_imap_client_cache_metadata'
 
const MD_DATA = 'data'
 Mongo field names: MD collection.
 
const MD_FIELD = 'field'
 
const MD_TABLE = 'horde_imap_client_metadata'
 
const MD_UID = 'uid'
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are met
 
const METADATA_INVALID = 27
 Invalid metadata entry.
 
const METADATA_MAXSIZE = 24
 Setting metadata failed because the size of its value is too large.
 
const METADATA_NOPRIVATE = 26
 Setting metadata failed because the server does not support private annotations on one of the specified mailboxes.
 
const METADATA_TOOMANY = 25
 Setting metadata failed because the maximum number of allowed annotations has already been reached.
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without * modification
 
const MSG = 'horde_imap_client_cache_message'
 
const MSG_DATA = 'data'
 Mongo field names: MSG collection.
 
const MSG_MSGUID = 'msguid'
 
const MSG_TABLE = 'horde_imap_client_message'
 
const MSG_UID = 'uid'
 
const NO = 3
 
$ob no_quote_list = true
 
$ob no_quote_list = true
 
const NONEXISTENT = 23
 The operation failed because the requested deletion object did not exist.
 
const NOPERM = 17
 The user did not have permissions to carry out the operation.
 
const NOT_SUPPORTED = 400
 Function/feature is not supported on this server.
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright * notice
 
const NS_OTHER = 2
 
const NS_OTHER = 2
 
const NS_PERSONAL = 1
 
const NS_SHARED = 3
 
const NS_SHARED = 3
 
const OK = 4
 
const OPEN_AUTO = 3
 
const OPEN_READWRITE = 2
 
const OVERQUOTA = 21
 The operation failed because the user is over their quota.
 
const PARSEERROR = 6
 There were errors parsing the MIME/RFC 2822 header of the part.
 
const POP3_PERM_ERROR = 301
 Permanent error indicated by server.
 
const POP3_TEMP_ERROR = 300
 Temporary issue.
 
const PREAUTH = 5
 
LOSS OF OR PROFITS
 
const RFC_4314 = 2
 
const SEARCH_RES = "\02"
 
const SEARCH_RESULTS_COUNT = 1
 
const SEARCH_RESULTS_MATCH = 2
 
const SEARCH_RESULTS_MAX = 3
 
const SEARCH_RESULTS_MIN = 4
 
const SEARCH_RESULTS_RELEVANCY = 6
 
const SEARCH_RESULTS_SAVE = 5
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Serializable
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Serializable
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Serializable
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Serializable
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see Serializable
 
const SERVER_CONNECT = 11
 Thrown if server denies the network connection.
 
const SERVER_READERROR = 12
 Thrown if read error for server response.
 
const SERVER_WRITEERROR = 16
 Thrown if write error in server interaction.
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT| *|LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE,| *|DATA, OR PROFITS;OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY| *|THEORY OF LIABILITY WHETHER IN STRICT OR TORT *INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE *OF THI SOFTWARE )
 
OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY *THEORY OF WHETHER IN STRICT OR TORT *INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE *OF THIS SOFTWARE
 
const SORT_ARRIVAL = 1
 
const SORT_CC = 2
 
const SORT_DATE = 3
 
const SORT_DISPLAYFROM = 10
 
const SORT_DISPLAYFROM_FALLBACK = 14
 
const SORT_DISPLAYTO = 11
 
const SORT_DISPLAYTO_FALLBACK = 15
 
const SORT_FROM = 4
 
const SORT_RELEVANCY = 13
 
const SORT_REVERSE = 5
 
const SORT_SEQUENCE = 12
 
const SORT_SIZE = 6
 
const SORT_SUBJECT = 7
 
const SORT_THREAD = 9
 
const SORT_TO = 8
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT *OWNER OR CONTRIBUTORS BE LIABLE FOR ANY * SPECIAL
 
const SPECIALUSE_ALL = '\\All'
 
const SPECIALUSE_ARCHIVE = '\\Archive'
 
const SPECIALUSE_DRAFTS = '\\Drafts'
 
const SPECIALUSE_FLAGGED = '\\Flagged'
 
const SPECIALUSE_JUNK = '\\Junk'
 
const SPECIALUSE_SENT = '\\Sent'
 
const SPECIALUSE_TRASH = '\\Trash'
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see SplObserver
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see SplSubject
 
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see SplSubject
 
const STATUS_ALL = 32
 
const STATUS_FIRSTUNSEEN = 64
 
const STATUS_FLAGS = 128
 
const STATUS_FORCE_REFRESH = 65536
 
const STATUS_HIGHESTMODSEQ = 512
 
const STATUS_MESSAGES = 1
 
const STATUS_PERMFLAGS = 256
 
const STATUS_RECENT = 2
 
const STATUS_RECENT_TOTAL = 32768
 
const STATUS_SYNCFLAGUIDS = 2048
 
const STATUS_SYNCMODSEQ = 1024
 
const STATUS_SYNCVANISHED = 16384
 
const STATUS_UIDNEXT = 4
 
const STATUS_UIDNEXT_FORCE = 8192
 
const STATUS_UIDNOTSTICKY = 4096
 
const STATUS_UIDVALIDITY = 8
 
const STATUS_UNSEEN = 16
 
const SYNC_ALL = 64
 
const SYNC_FLAGS = 1
 
const SYNC_FLAGSUIDS = 2
 
const SYNC_NEWMSGS = 4
 
const SYNC_NEWMSGSUIDS = 8
 
const SYNC_UIDVALIDITY = 0
 
const SYNC_VANISHED = 16
 
const SYNC_VANISHEDUIDS = 32
 
const THREAD_ORDEREDSUBJECT = 1
 
const THREAD_REFERENCES = 2
 
const THREAD_REFS = 3
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED BUT NOT *LIMITED TO
 
const UID = 2
 
const UIDVALIDITY_CHANGED = 2
 UIDVALIDITY of the mailbox changed.
 
const UNKNOWNCTE = 7
 The server could not decode the MIME part (see RFC 3516).
 
LOSS OF USE
 
const USEATTR = 15
 Thrown on CREATE if special-use attribute is not supported.
 
const UTF7IMAP_CONVERSION = 3
 There was an unrecoverable error in UTF7IMAP -> UTF8 conversion.
 
**This code is based on the original code contained in the PEAR Auth_SASL *package(v0.5.1) as set forth with or without are permitted provided that the following conditions *are this list of conditions and the following disclaimer *o Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the *documentation and or other materials provided with the distribution *o The names of the authors may not be used to endorse or promote *products derived from this software without specific prior written *permission **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *AND ANY EXPRESS OR IMPLIED WARRANTIES
 

Detailed Description

Function Documentation

◆ __construct() [1/13]

__construct ( $msg,
$code,
Horde_Imap_Client_Interaction_Server $server,
Horde_Imap_Client_Interaction_Pipeline $pipeline )

Constructor.

Parameters
string | null$msgError message.
integer$codeError code.
Horde_Imap_Client_Interaction_Server$serverServer ob.
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline ob.

◆ __construct() [2/13]

__construct ( $username = null,
$access_token = null )

Constructor.

Parameters
array$dataSee $_thread.
string$typeEither 'sequence' or 'uid'.
string$messageError message (non-translated).
int$codeError code.
string$extensionThe extension not supported on the server.
string$msgA non-standard error message to use instead of the default.
string$ob_classClass to use when creating a new fetch object.
integer$key_typeKey type.
mixed$idsSee self\add().
boolean$sequenceAre $ids message sequence numbers?
string$cmdThe IMAP command.
string$tagThe tag to use. If not set, will be automatically generated.
string$mboxThe mailbox name.
boolean$utf7imapIs mailbox UTF7-IMAP encoded (true). Otherwise, mailbox is assumed to be UTF-8 encoded.
string$usernameThe username.
string$access_tokenThe access token.

◆ __construct() [3/13]

__construct ( $url = '')

Constructor.

Parameters
mixed$debugThe debug target.
string$rightsThe rights (see RFC 4314 [2.1]).
mixed$dataData.
mixed$dataEither a mailbox object or a UTF-8 mailbox name.
string$charsetThe charset that was attempted to be converted to.
string$tagThe tag to use. If not set, will be automatically generated.
Closure$closureA function to run after the continuation response is received. It receives one argument - a Continuation object - and should return a list of arguments to send to the server (via a Horde_Imap_Client_Data_Format_List object).
mixed$mboxesA mailbox or list of mailboxes.
array$nsThe list of namespace objects.
mixed$dataData to add (string, resource, or Horde_Stream object).

Absolute IMAP URLs takes one of the following forms:

  • imap://<iserver>[/]
  • imap://<iserver>/<enc-mailbox>[<uidvalidity>][?<enc-search>]
  • imap://<iserver>/<enc-mailbox>[<uidvalidity>]<iuid>[<isection>][<ipartial>][<iurlauth>]

POP URLs take one of the following forms:

  • pop://<user>;auth=<auth><host>:<port>
Parameters
string$urlA URL string.
string$urlA URL string.

◆ __construct() [4/13]

__construct ( $id,
$pass,
$challenge,
$hostname,
$service )

Generate the Digest-MD5 response.

Parameters
string$idAuthentication id (username).
string$passPassword.
string$challengeThe digest challenge sent by the server.
string$hostnameThe hostname of the machine connecting to.
string$serviceThe service name (e.g. 'imap', 'pop3').
Exceptions
Horde_Imap_Client_Exception

◆ __construct() [5/13]

__construct ( $data,
array $opts = array() )

Constructor.

Parameters
string$strThe subject string.
array$optsAdditional options:
  • keepblob: (boolean) Don't remove any "blob" information (i.e. text leading text between square brackets) from string.
Return values
stringThe cleaned up subject string.
Parameters
array$optsAdditional options:
  • eol: (boolean) If true, normalize EOLs in input.
Since
2.2.0
  • skipscan: (boolean) If true, don't scan input for binary/literal/quoted data.
2.2.0
Exceptions
Horde_Imap_Client_Data_Format_Exception

◆ __construct() [6/13]

__construct ( $user,
$pass,
$hash = 'SHA1' )

Constructor.

Parameters
string$userUsername.
string$passPassword.
string$hashHash name.
Exceptions
Horde_Imap_Client_Exception

◆ __construct() [7/13]

__construct ( array $params = array())

Constructor.

Parameters
array$paramsConfiguration parameters:
- cache: (array) If set, caches data from fetch(), search(), and
         thread() calls. Requires the horde/Cache package to be
         installed. The array can contain the following keys (see
         Horde_Imap_Client_Cache for default values):
  - backend: [REQUIRED (or cacheob)] (Horde_Imap_Client_Cache_Backend)
             Backend cache driver [
Since
 2.9.0].
  - fetch_ignore: (array) A list of mailboxes to ignore when storing
                  fetch data.
  - fields: (array) The fetch criteria to cache. If not defined, all
            cacheable data is cached. The following is a list of
            criteria that can be cached:
    - Horde_Imap_Client\FETCH_ENVELOPE
    - Horde_Imap_Client\FETCH_FLAGS
      Only if server supports CONDSTORE extension
    - Horde_Imap_Client\FETCH_HEADERS
      Only for queries that specifically request caching
    - Horde_Imap_Client\FETCH_IMAPDATE
    - Horde_Imap_Client\FETCH_SIZE
    - Horde_Imap_Client\FETCH_STRUCTURE
- capability_ignore: (array) A list of IMAP capabilites to ignore, even
                     if they are supported on the server.
                     DEFAULT: No supported capabilities are ignored.
- comparator: (string) The search comparator to use instead of the
              default server comparator. See setComparator() for
              format.
              DEFAULT: Use the server default
- context: (array) Any context parameters passed to
           stream_create_context(). 
 2.27.0
- debug: (string) If set, will output debug information to the stream
         provided. The value can be any PHP supported wrapper that can
         be opened via PHP's fopen() function.
         DEFAULT: No debug output
- hostspec: (string) The hostname or IP address of the server.
            DEFAULT: 'localhost'
- id: (array) Send ID information to the server (only if server
      supports the ID extension). An array with the keys as the fields
      to send and the values being the associated values. See RFC 2971
      [3.3] for a list of standard field values.
      DEFAULT: No info sent to server
- lang: (array) A list of languages (in priority order) to be used to
        display human readable messages.
        DEFAULT: Messages output in IMAP server default language
- password: (mixed) The user password. Either a string or a
            Horde_Imap_Client_Base_Password object [
 2.14.0].
- port: (integer) The server port to which we will connect.
        DEFAULT: 143 (imap or imap w/TLS) or 993 (imaps)
- secure: (string) Use SSL or TLS to connect. Values:
  - false (No encryption)
  - 'ssl' (Auto-detect SSL version)
  - 'sslv2' (Force SSL version 3)
  - 'sslv3' (Force SSL version 2)
  - 'tls' (TLS; started via protocol-level negotation over
    unencrypted channel; RECOMMENDED way of initiating secure
    connection)
  - 'tlsv1' (TLS direct version 1.x connection to server) [
    2.16.0]
  - true (TLS if available/necessary) [
 2.15.0]
    DEFAULT: false
- timeout: (integer)  Connection timeout, in seconds.
           DEFAULT: 30 seconds
- username: (string) [REQUIRED] The username.
- authusername (string) The username used for SASL authentication.
     If specified this is the user name whose password is used
     (e.g. administrator).
     Only valid for RFC 2595/4616 - PLAIN SASL mechanism.
     DEFAULT: the same value provided in the username parameter.
Parameters
array$paramsConfiguration parameters:
  - REQUIRED Parameters:
    - backend: (Horde_Imap_Client_Cache_Backend) The cache backend.
    - baseob: (Horde_Imap_Client_Base) The base client object.

  - Optional Parameters:
    - debug: (Horde_Imap_Client_Base_Debug) Debug object.
             DEFAULT: No debug output
array$paramsConfiguration parameters.
array$paramsConfiguration parameters:
  - REQUIRED Parameters:
    - cacheob: (Horde_Cache) The cache object to use.

  - Optional Parameters:
    - lifetime: (integer) The lifetime of the cache data (in seconds).
                DEFAULT: 1 week (604800 seconds)
    - slicesize: (integer) The slicesize to use.
                 DEFAULT: 50
array$paramsConfiguration parameters:
  - REQUIRED Parameters:
    - db: (Horde_Db_Adapter) DB object.
array$paramsConfiguration parameters:
  - REQUIRED parameters:
    - hashtable: (Horde_HashTable) A HashTable object.

  - Optional Parameters:
    - lifetime: (integer) The lifetime of the cache data (in seconds).
                DEFAULT: 604800 seconds (1 week) [
Since
 2.19.0]
Parameters
array$paramsConfiguration parameters:
  - REQUIRED parameters:
    - mongo_db: (Horde_Mongo_Client) A MongoDB client object.

$data An array of property names (keys) and values to set in this object.

Parameters
array$idsArray of sequence -> UID mapping.
array$paramsA hash containing configuration parameters. Additional parameters to base driver:
  • debug_literal: (boolean) If true, will output the raw text of literal responses to the debug stream. Otherwise, outputs a summary of the literal response.
  • envelope_addrs: (integer) The maximum number of address entries to read for FETCH ENVELOPE address fields. DEFAULT: 1000
  • envelope_string: (integer) The maximum length of string fields returned by the FETCH ENVELOPE command. DEFAULT: 2048
  • xoauth2_token: (mixed) If set, will authenticate via the XOAUTH2 mechanism (if available) with this token. Either a string (since 2.13.0) or a Horde_Imap_Client_Base_Password object (since 2.14.0).

◆ __construct() [8/13]

__construct ( array $required = array(),
array $optional = array() )

Constructor.

Parameters
array$requiredThe required rights (see RFC 4314 [2.1]).
array$optionalThe optional rights (see RFC 4314 [2.1]).

◆ __construct() [9/13]

__construct ( Horde_Imap_Client_Base $base_ob,
$mailbox,
$sync,
$curr,
$criteria,
$ids )

Constructor.

Parameters
Horde_Imap_Client_Base$base_obBase driver object.
mixed$mailboxMailbox to sync.
array$syncToken sync data.
array$currCurrent sync data.
integer$criteriaMask of criteria to return.
Horde_Imap_Client_Ids$idsList of known UIDs.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_Sync

◆ __construct() [10/13]

__construct ( Horde_Imap_Client_Fetch_Results $fetch)

Constructor.

Parameters
Horde_Imap_Client_Fetch_Results$fetchFetch results object.

◆ __construct() [11/13]

__construct ( Horde_Imap_Client_Socket $socket)

Constructor.

Parameters
Horde_Imap_Client_Socket$socketSocket object.

◆ __construct() [12/13]

__construct ( Horde_Imap_Client_Tokenize $token)

Constructor.

Parameters
Horde_Imap_Client_Tokenize$tokenTokenized data returned from the server.

◆ __construct() [13/13]

__construct ( Horde_Imap_Client_Tokenize $token,
$tag )
Parameters
string$tagResponse tag.

◆ __get()

__get ( $name)

Return specific digest response directive.

Return values
mixedRequested directive, or null if it does not exist.

◆ __serialize()

__serialize ( )

Serialization.

Return values
array
stringSerialized data.

◆ __toString()

__toString ( )

Cooerce to string.

Create a POP3 URL (RFC 2384).

Create an IMAP URL (RFC 5092/5593).

Create a POP3 (RFC 2384) or IMAP (RFC 5092/5593) URL.

String representation: The IMAP search string.

Returns the string value of the raw data.

Return the "base subject" defined in RFC 5256 [2.1].

String representation of the ACL.

Return values
stringThe digest response (not base64 encoded).
stringString representation (RFC 4314 compliant).
stringThe base subject.
stringString value.
stringA URL string.

◆ __unserialize()

__unserialize ( $data)

Unserialization.

Parameters
string$dataSerialized data.
Exceptions
Exception

◆ _addFuzzy()

_addFuzzy ( $add,
& $temp )
protected

Adds fuzzy modifier to search keys.

Parameters
boolean$addAdd the fuzzy modifier?
array$tempTemporary build data.
Exceptions
Horde_Imap_Client_Exception_NoSupport_Extension

◆ _append()

_append ( Horde_Imap_Client_Mailbox $mailbox,
$data,
$options )
abstractprotected

Append message(s) to a mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe mailbox to append the message(s) to.
array$dataThe message data.
array$optionsAdditional options.
Return values
mixedA Horde_Imap_Client_Ids object containing the UIDs of the appended messages (if server supports UIDPLUS extension) or true.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _appendData()

_appendData ( $data,
& $asize )
protected

Prepares append message data for insertion into the IMAP command string.

Parameters
mixed$dataEither a resource or a string.
integer&$asizeTotal append size.
Return values
Horde_Imap_Client_Data_Format_String_NonasciiThe data object.

◆ _authInitialResponse()

_authInitialResponse ( $method,
$ir,
$username = null )
protected

Create the AUTHENTICATE command for the initial client response.

Parameters
string$methodAUTHENTICATE SASL method.
string$irInitial client response.
string$usernameIf set, log a username message in debug log instead of raw data.
Return values
Horde_Imap_Client_Interaction_CommandA command object.

◆ _baseSql()

_baseSql ( $mailbox,
$join = null )
protected

Prepare the base SQL query.

Parameters
string$mailboxThe mailbox.
string$joinThe table to join with the base table.
Return values
arraySQL query and bound parameters.

◆ _buildAndOr()

_buildAndOr ( $type,
$data,
& $charset,
& $exts_used,
& $cmds )
protected

Builds the AND/OR query.

Parameters
string$type'AND' or 'OR'.
array$dataQuery data.
string&$charsetSearch charset.
array&$exts_usedIMAP extensions used.
Horde_Imap_Client_Data_Format_List&$cmdsCommand list.
Return values
booleanTrue if query might return results.

◆ _cacheFields()

_cacheFields ( )
protected

Provide the list of available caching fields.

Return values
arrayThe list of available caching fields (fields are in the key).

◆ _capability()

_capability ( )
protected

Query server capability.

Required because internal code can't call capability via magic method directly - it may not exist yet, the creation code may call capability recursively, and __get() doesn't allow recursive calls to the same property (chicken/egg issue).

Return values
mixedThe capability object if no arguments provided. If arguments are provided, they are passed to the query() method and this value is returned.
Exceptions
Horde_Imap_Client_Exception

◆ _changeSelected()

_changeSelected ( $mailbox = null,
$mode = null )
protected

Called when the selected mailbox is changed.

Parameters
mixed$mailboxThe selected mailbox or null.
integer$modeThe access mode.

◆ _check()

_check ( )
abstractprotected

Request a checkpoint of the currently selected mailbox.

Exceptions
Horde_Imap_Client_Exception

◆ _close()

_close ( $options)
abstractprotected

Close the connection to the currently selected mailbox, optionally expunging all deleted messages (RFC 3501 [6.4.2]).

Parameters
array$optionsAdditional options.
Exceptions
Horde_Imap_Client_Exception

◆ _command()

_command ( $cmd)
protected

Shortcut to creating a new IMAP client command object.

Parameters
string$cmdThe IMAP command.
Return values
Horde_Imap_Client_Interaction_CommandA command object.

◆ _connect()

_connect ( )
abstractprotected

Connect to the remote server.

Connects to the server.

Connects to the IMAP server.

Exceptions
Horde_Imap_Client_Exception

◆ _convertCatenateUrl()

_convertCatenateUrl ( $url)
protected

Converts a CATENATE URL to stream data.

Parameters
string$urlThe CATENATE URL.
Return values
resourceA stream containing the data.

◆ _copy()

_copy ( Horde_Imap_Client_Mailbox $dest,
$options )
abstractprotected

Copy messages to another mailbox.

Parameters
Horde_Imap_Client_Mailbox$destThe destination mailbox.
array$optionsAdditional options.
Return values
mixedAn array mapping old UIDs (keys) to new UIDs (values) on success (if the IMAP server and/or driver support the UIDPLUS extension) or true.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _createMailbox()

_createMailbox ( Horde_Imap_Client_Mailbox $mailbox,
$opts )
abstractprotected

Create a mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe mailbox to create.
array$optsAdditional options. See createMailbox().
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _createUid()

_createUid ( $mailbox)
protected

Create and return the UID for a mailbox/user/server combo.

Parameters
string$mailbox
Return values
stringUID from base table.
Parameters
string$mailboxMailbox name.
Return values
stringUID from base table.

◆ _deleteACL()

_deleteACL ( Horde_Imap_Client_Mailbox $mailbox,
$identifier )
abstractprotected

Deletes ACL rights for a given mailbox/identifier.

Parameters
Horde_Imap_Client_Mailbox$mailboxA mailbox.
string$identifierThe identifier to delete (UTF7-IMAP).
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _deleteMailbox() [1/2]

_deleteMailbox ( $mbox)
protected

Delete a mailbox from the cache.

Parameters
string$mboxThe mailbox to delete.

◆ _deleteMailbox() [2/2]

_deleteMailbox ( Horde_Imap_Client_Mailbox $mailbox)
abstractprotected

Delete a mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe mailbox to delete.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _deleteMailboxPost()

_deleteMailboxPost ( Horde_Imap_Client_Mailbox $mailbox)
protected

Actions to perform after a mailbox delete.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe deleted mailbox.

◆ _deleteMsgs()

_deleteMsgs ( Horde_Imap_Client_Mailbox $mailbox,
Horde_Imap_Client_Ids $ids,
array $opts = array() )
protected

Delete messages in the cache.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe mailbox.
Horde_Imap_Client_Ids$idsThe list of IDs to delete in $mailbox.
array$optsAdditional options (not used in base class).
Return values
Horde_Imap_Client_IdsUIDs that were deleted.
Exceptions
Horde_Imap_Client_Exception
Parameters
array$optsOptions:
  • decrement: (boolean) If true, decrement the message count.
  • pipeline: (Horde_Imap_Client_Interaction_Pipeline) Pipeline object.

◆ _enable()

_enable ( $exts)
protected

Enable an IMAP extension (see RFC 5161).

Parameters
array$extsThe extensions to enable.
Exceptions
Horde_Imap_Client_Exception

◆ _expunge()

_expunge ( $options)
abstractprotected

Expunge all deleted messages from the given mailbox.

Parameters
array$optionsAdditional options.
Return values
Horde_Imap_Client_IdsIf 'list' option is true, returns the list of expunged messages.
Exceptions
Horde_Imap_Client_Exception
Parameters
array$optionsAdditional options. 'ids' has no effect in this driver.

◆ _fetch()

_fetch ( Horde_Imap_Client_Fetch_Results $results,
$queries )
abstractprotected

Fetch message data.

Fetch queries should be grouped in the $queries argument. Each value is an array of fetch options, with the fetch query stored in the '_query' parameter. IMPORTANT: All queries must have the same ID type (either sequence or UID).

Parameters
Horde_Imap_Client_Fetch_Results$resultsFetch results.
array$queriesThe list of queries.
Exceptions
Horde_Imap_Client_Exception

◆ _fetchCmd() [1/2]

_fetchCmd ( Horde_Imap_Client_Fetch_Results $results,
$options )
protected

Fetch data for a given fetch query.

Parameters
Horde_Imap_Client_Fetch_Results$resultsFetch results.
array$optionsFetch query options.

◆ _fetchCmd() [2/2]

_fetchCmd ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
$options )
protected

Add a FETCH command to the given pipeline.

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
array$optionsFetch query options

◆ _filterParams()

_filterParams ( )
protected

Return the base string filter parameters.

Return values
objectFilter parameters.

◆ _fromSequenceString()

_fromSequenceString ( $str)
protected

Parse an IMAP message sequence string into a list of indices.

Parse a POP3 message sequence string into a list of indices.

See also
_toSequenceString()
Parameters
string$strThe IMAP message sequence string.
Return values
arrayAn array of indices.
Parameters
string$strThe POP3 message sequence string.
Return values
arrayAn array of UIDs.

◆ _getACL()

_getACL ( Horde_Imap_Client_Mailbox $mailbox)
abstractprotected

Get ACL rights for a given mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxA mailbox.
Return values
arrayAn array with identifiers as the keys and Horde_Imap_Client_Data_Acl objects as the values.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _getAllIndices()

_getAllIndices ( )
protected

Return all indices.

Return values
arrayAn array of indices.

◆ _getAnnotateMoreEntry()

_getAnnotateMoreEntry ( $name)
protected

Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.

Parameters
string$nameA name for a metadata entry.
Return values
arrayA list of two elements: The entry name and the value type.
Exceptions
Horde_Imap_Client_Exception

◆ _getCid() [1/2]

_getCid ( $mailbox)
protected

Create the unique ID used to store the mailbox data in the cache.

Parameters
string$mailboxThe mailbox to cache.
Return values
stringThe cache ID.

◆ _getCid() [2/2]

_getCid ( $mailbox,
$slice )
protected

Create the unique ID used to store the data in the cache.

Parameters
string$mailboxThe mailbox to cache.
string$sliceThe cache slice.
Return values
stringThe cache ID.

◆ _getCnonce()

_getCnonce ( )
protected

Creates the client nonce for the response.

Return values
stringThe cnonce value.

◆ _getComparator()

_getComparator ( )
abstractprotected

Get the comparator used for searching/sorting (RFC 5255).

Return values
mixedNull if the default comparator is being used, or an array of comparator information (see RFC 5255 [4.8]).
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _getEncryptKey()

_getEncryptKey ( )
protected

Get encryption key.

Deprecated
Pass callable into 'password' parameter instead.
Return values
stringThe encryption key.

◆ _getHeaders()

_getHeaders ( $id,
$format,
$key )
protected

Return representation of a header field.

Parameters
string$idThe header id.
integer$formatThe return format. If self\HEADER_PARSE, returns a Horde_Mime_Headers object. If self\HEADER_STREAM, returns a stream. Otherwise, returns header text.
integer$keyThe array key where the data is stored in the internal array.
Return values
mixedThe data in the format specified by $format.

◆ _getID()

_getID ( )
abstractprotected

Return ID information from the IMAP server (RFC 2971).

Return implementation information from the POP3 server (RFC 2449 [6.9]).

Return values
arrayAn array of information returned, with the keys as the 'field' and the values as the 'value'.
Exceptions
Horde_Imap_Client_Exception

◆ _getLanguage()

_getLanguage ( $list)
abstractprotected

Gets the preferred language for server response messages (RFC 5255).

Parameters
array$listIf true, return the list of available languages.
Return values
mixedIf $list is true, the list of languages available on the server (may be empty). If false, the language used by the server, or null if the default language is used.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _getLine()

_getLine ( Horde_Imap_Client_Interaction_Pipeline $pipeline)
protected

Gets data from the IMAP server stream and parses it.

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Return values
Horde_Imap_Client_Interaction_ServerServer object.
Exceptions
Horde_Imap_Client_Exception

◆ _getMailboxList()

_getMailboxList ( $pattern,
$mode,
$options,
$subscribed = null )
protected

Obtain a list of mailboxes.

Parameters
array$patternThe mailbox search pattern(s).
integer$modeWhich mailboxes to return.
array$optionsAdditional options. 'no_listext' will skip using the LIST-EXTENDED capability.
array$subscribedA list of subscribed mailboxes.
Return values
arraySee listMailboxes(().
Exceptions
Horde_Imap_Client_Exception

◆ _getMboxFormatOb()

_getMboxFormatOb ( $mailbox,
$list = false )
protected

Return the proper mailbox format object based on the server's capabilities.

Parameters
string$mailboxThe mailbox.
boolean$listIs this object used in a LIST command?
Return values
Horde_Imap_Client_Data_Format_MailboxA mailbox format object.

◆ _getMetadata()

_getMetadata ( Horde_Imap_Client_Mailbox $mailbox,
$entries,
$options )
abstractprotected

Get metadata for a given mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxA mailbox.
array$entriesThe entries to fetch (UTF7-IMAP strings).
array$optionsAdditional options.
Return values
arrayAn array with metadata names as the keys and metadata values as the values.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _getMsgCids()

_getMsgCids ( $mailbox,
$ids )
protected

Return a list of cache IDs for mailbox/UID pairs.

Parameters
string$mailboxThe mailbox to cache.
array$idsThe UID list.
Return values
arrayList of UIDs => cache IDs.

◆ _getMyACLRights()

_getMyACLRights ( Horde_Imap_Client_Mailbox $mailbox)
abstractprotected

Get the ACL rights for the current user for a given mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxA mailbox.
Return values
Horde_Imap_Client_Data_AclAn ACL data object.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _getNamespaces()

_getNamespaces ( )
abstractprotected

Get the NAMESPACE information from the IMAP server.

Return values
Horde_Imap_Client_Namespace_ListNamespace list object.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _getQuota()

_getQuota ( Horde_Imap_Client_Mailbox $root)
abstractprotected

Get quota limits.

Parameters
Horde_Imap_Client_Mailbox$rootThe quota root.
Return values
mixedAn array with resource keys. Each key holds an array with 2 values: 'limit' and 'usage'.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _getQuotaRoot()

_getQuotaRoot ( Horde_Imap_Client_Mailbox $mailbox)
abstractprotected

Get quota limits for a mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxA mailbox.
Return values
mixedAn array with the keys being the quota roots. Each key holds an array with resource keys: each of these keys holds an array with 2 values: 'limit' and 'usage'.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _getResponse()

_getResponse ( $multiline = false)
protected

Gets a line from the stream and parses it.

Parameters
mixed$multiline'array', 'none', 'stream', or null.
Return values
arrayAn array with the following keys:
  • data: (mixed) Stream, array, or null.
  • resp: (string) The server response text.
Exceptions
Horde_Imap_Client_Exception

◆ _getSearchCache()

_getSearchCache ( $type,
$options )
protected

Retrieve data from the search cache.

Parameters
string$typeThe cache type ('search' or 'thread').
array$optionsThe options array of the calling function.
Return values
mixedReturns search cache metadata. If search was retrieved, data is in key 'data'. Returns null if caching is not available.

◆ _getSentDates()

_getSentDates ( Horde_Imap_Client_Fetch_Results $data,
$ids,
$internal = false )
protected

Get the sent dates for purposes of SORT/THREAD sorting under RFC 5256 [2.2].

Parameters
Horde_Imap_Client_Fetch_Results$dataData returned from fetch() that includes both date and envelope items.
array$idsThe IDs to process.
boolean$internalOnly use internal date?
Return values
arrayA mapping of IDs -> UNIX timestamps.

◆ _getSeqIds()

_getSeqIds ( Horde_Imap_Client_Ids $ids)
protected

Returns a list of sequence IDs.

Parameters
Horde_Imap_Client_Ids$idsThe ID list.
Return values
arrayA list of sequence IDs.

◆ _getUid()

_getUid ( $mailbox)
protected

Return the UID for a mailbox/user/server combo.

Parameters
string$mailbox
Return values
stringUID from base table.
Parameters
string$mailboxMailbox name.
Return values
stringUID from base table.

◆ _getUidByMessageId()

_getUidByMessageId ( $mailbox,
$msgid )
protected

Get a message UID by the Message-ID.

Returns the last message in a mailbox that matches.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe mailbox to search
string$msgidMessage-ID.
Return values
stringUID (null if not found).

◆ _initCache()

_initCache ( $current = false)
protected

Initialize the Horde_Imap_Client_Cache object, if necessary.

Parameters
boolean$currentIf true, we are going to update the currently selected mailbox. Add an additional check to see if caching is available in current mailbox.
Return values
booleanReturns true if caching is enabled.

◆ _initCapability()

_initCapability ( )
abstractprotected

Retrieve capability information from the IMAP server.

Exceptions
Horde_Imap_Client_Exception

◆ _initOb()

_initOb ( )
protected

Do initialization tasks.

Initialization tasks.

◆ _listACLRights()

_listACLRights ( Horde_Imap_Client_Mailbox $mailbox,
$identifier )
abstractprotected

Get ACL rights for a given mailbox/identifier.

Parameters
Horde_Imap_Client_Mailbox$mailboxA mailbox.
string$identifierThe identifier to query (UTF7-IMAP).
Return values
Horde_Imap_Client_Data_AclRightsAn ACL data rights object.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _listMailboxes()

_listMailboxes ( $pattern,
$mode,
$options )
abstractprotected

Obtain a list of mailboxes matching a pattern.

Parameters
array$patternThe mailbox search patterns (Horde_Imap_Client_Mailbox objects).
integer$modeWhich mailboxes to return.
array$optionsAdditional options.
Return values
arraySee listMailboxes().
Exceptions
Horde_Imap_Client_Exception

◆ _loadMailbox()

_loadMailbox ( $mailbox,
$uidvalid = null )
protected

Loads basic mailbox information.

Parameters
string$mailboxThe mailbox to load.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.

◆ _loadSlice()

_loadSlice ( $mailbox,
$slice )
protected

Load UIDs from a cache slice.

Parameters
string$mailboxThe mailbox to load.
integer$sliceThe slice to load.

◆ _loadSliceMap()

_loadSliceMap ( $mailbox,
$uidvalid = null )
protected

Load the slicemap for a given mailbox.

The slicemap contains the uidvalidity information, the UIDs->slice lookup table, and any metadata that needs to be saved for the mailbox.

Parameters
string$mailboxThe mailbox.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.

◆ _loadUids()

_loadUids ( $mailbox,
$uids,
$uidvalid = null )
protected

Load UIDs by regenerating from the cache.

Parameters
string$mailboxThe mailbox to load.
array$uidsThe UIDs to load.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.

◆ _login()

_login ( )
abstractprotected

Login to the IMAP server.

Return values
booleanReturn true if global login tasks should be run.
Exceptions
Horde_Imap_Client_Exception

◆ _loginTasks()

_loginTasks ( $firstlogin = true,
array $resp = array() )
protected

Perform login tasks.

Parameters
boolean$firstloginIs this the first login?
array$respThe data response from the login command. May include:
  • capability_set: (boolean) True if CAPABILITY was set after login.
  • proxyreuse: (boolean) True if re-used connection via imapproxy.
Return values
booleanTrue if global login tasks should be performed.

◆ _mailboxOb()

_mailboxOb ( $mailbox = null)
protected

Return the Horde_Imap_Client_Base_Mailbox object.

Parameters
string$mailboxThe mailbox name. Defaults to currently selected mailbox.
Return values
Horde_Imap_Client_Base_MailboxMailbox object.

◆ _mboxCompare()

_mboxCompare ( $a,
$b )
finalprotected

Hierarchical folder sorting function (used with usort()).

Parameters
string$aComparison item 1.
string$bComparison item 2.
Return values
integerSee usort().

◆ _moveCache()

_moveCache ( Horde_Imap_Client_Mailbox $to,
$map,
$uidvalid )
protected

Moves cache entries from the current mailbox to another mailbox.

Parameters
Horde_Imap_Client_Mailbox$toThe destination mailbox.
array$mapMapping of source UIDs (keys) to destination UIDs (values).
string$uidvalidUIDVALIDITY of destination mailbox.
Exceptions
Horde_Imap_Client_Exception

◆ _msgText()

_msgText ( $stream,
$data )
protected

Return text representation of a field.

Parameters
boolean$streamReturn as a stream?
mixed$dataThe field data (string or resource) or null if field does not exist.
Return values
mixedRequested text representation.

◆ _noop()

_noop ( )
abstractprotected

Send a NOOP command.

Exceptions
Horde_Imap_Client_Exception

◆ _openMailbox()

_openMailbox ( Horde_Imap_Client_Mailbox $mailbox,
$mode )
abstractprotected

Open a mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe mailbox to open.
integer$modeThe access mode.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _parseACL()

_parseACL ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse an ACL response (RFC 4314 [3.6]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseAnnotation()

_parseAnnotation ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse an ANNOTATION response (ANNOTATEMORE/ANNOTATEMORE2).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.
Exceptions
Horde_Imap_Client_Exception

◆ _parseBodystructure()

_parseBodystructure ( Horde_Imap_Client_Tokenize $data)
protected

Recursively parse BODYSTRUCTURE data from a FETCH return (see RFC 3501 [7.4.2]).

Parameters
Horde_Imap_Client_Tokenize$dataData returned from the server.
Return values
Horde_Mime_PartMime part object.

◆ _parseCapability()

_parseCapability ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
$data )
protected

Parse a CAPABILITY Response (RFC 3501 [7.2.1]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
array$dataAn array of CAPABILITY strings.

◆ _parseChallenge()

_parseChallenge ( $challenge)
protected

Parses and verifies the digest challenge.

Parameters
string$challengeThe digest challenge
Return values
arrayThe parsed challenge as an array with directives as keys.
Exceptions
Horde_Imap_Client_Exception

◆ _parseComparator()

_parseComparator ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
$data )
protected

Parse a COMPARATOR response (RFC 5255 [4.8])

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseEnabled()

_parseEnabled ( Horde_Imap_Client_Tokenize $data)
protected

Parse an ENABLED response (RFC 5161 [3.2]).

Parameters
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseEnvelope()

_parseEnvelope ( Horde_Imap_Client_Tokenize $data)
protected

Parse ENVELOPE data from a FETCH return (see RFC 3501 [7.4.2]).

Parameters
Horde_Imap_Client_Tokenize$dataData returned from the server.
Return values
Horde_Imap_Client_Data_EnvelopeAn envelope object.

◆ _parseEsearch()

_parseEsearch ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse an ESEARCH response (RFC 4466 [2.6.2]) Format: (TAG "a567") UID COUNT 5 ALL 4:19,21,28.

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseFetch()

_parseFetch ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
$id,
Horde_Imap_Client_Tokenize $data )
protected

Parse a FETCH response (RFC 3501 [7.4.2]).

A FETCH response may occur due to a FETCH command, or due to a change in a message's state (i.e. the flags change).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
integer$idThe message sequence number.
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseID()

_parseID ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse an ID response (RFC 2971 [3.2]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseLanguage()

_parseLanguage ( Horde_Imap_Client_Tokenize $data)
protected

Parse a LANGUAGE response (RFC 5255 [3.3]).

Parameters
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseList()

_parseList ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse a LIST/LSUB response (RFC 3501 [7.2.2 & 7.2.3]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response (includes type as first token).
Exceptions
Horde_Imap_Client_Exception

◆ _parseListRights()

_parseListRights ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse a LISTRIGHTS response (RFC 4314 [3.7]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseMetadata()

_parseMetadata ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse a METADATA response (RFC 5464 [4.4]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.
Exceptions
Horde_Imap_Client_Exception

◆ _parseMyRights()

_parseMyRights ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse a MYRIGHTS response (RFC 4314 [3.8]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseNamespace()

_parseNamespace ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse a NAMESPACE response (RFC 2342 [5] & RFC 5255 [3.4]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe NAMESPACE data.

◆ _parseQuota()

_parseQuota ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse a QUOTA response (RFC 2087 [5.1]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe server response.

◆ _parseResponseCode()

_parseResponseCode ( $text)
protected

Parses response text for response codes (RFC 2449 [8]).

Parameters
string$textThe response text.
Return values
objectAn object with the following properties:
  • code: (string) The response code, if it exists.
  • data: (string) The response code data, if it exists.
  • text: (string) The human-readable response text.

◆ _parseSearch()

_parseSearch ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
$data )
protected

Parse a SEARCH/SORT response (RFC 3501 [7.2.5]; RFC 4466 [3]; RFC 5256 [4]; RFC 5267 [3]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
array$dataA list of IDs (message sequence numbers or UIDs).

◆ _parseStatus()

_parseStatus ( Horde_Imap_Client_Tokenize $data)
protected

Parse a STATUS response (RFC 3501 [7.2.4]).

Parameters
Horde_Imap_Client_Tokenize$dataToken data

◆ _parseStructureParams()

_parseStructureParams ( $data)
protected

Helper function to parse a parameters-like tokenized array.

Parameters
mixed$dataMessage data. Either a Horde_Imap_Client_Tokenize object or null.
Return values
arrayThe parameter array.

◆ _parseThread()

_parseThread ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse a THREAD response (RFC 5256 [4]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThread data.

◆ _parseThreadLevel()

_parseThreadLevel ( & $thread,
Horde_Imap_Client_Tokenize $data,
$level = 0 )
protected

Parse a level of a THREAD response (RFC 5256 [4]).

Parameters
array$threadResults.
Horde_Imap_Client_Tokenize$dataThread data.
integer$levelThe current tree level.

◆ _parseVanished()

_parseVanished ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Tokenize $data )
protected

Parse a VANISHED response (RFC 7162 [3.2.10]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Tokenize$dataThe response data.

◆ _partialAtom()

_partialAtom ( $opts)
protected

Add a partial atom to an IMAP command based on the criteria options.

Parameters
array$optsCriteria options.
Return values
stringThe partial atom.

◆ _pipeline()

_pipeline ( $cmd = null)
protected

Shortcut to creating a new pipeline object.

Parameters
Horde_Imap_Client_Interaction_Command$cmdAn IMAP command to add.
Return values
Horde_Imap_Client_Interaction_PipelineA pipeline object.

◆ _pop3Cache()

_pop3Cache ( $type,
$index = self::MBOX_CACHE,
$data = null )
protected

Retrieve locally cached message data.

Parameters
string$typeEither 'hdr', 'hdrob', 'msg', 'size', 'stat', 'top', or 'uidl'.
integer$indexThe message index.
mixed$dataAdditional information needed.
Return values
mixedThe cached data. 'msg' returns a stream resource. All other types return strings.
Exceptions
Horde_Imap_Client_Exception

◆ _prepareStatusResponse()

_prepareStatusResponse ( $request,
$mailbox )
protected

Prepares a status response for a mailbox.

Parameters
array$requestThe status keys to return.
string$mailboxThe mailbox to query.

◆ _processCmd()

_processCmd ( $pipeline,
$cmd,
$data )
protected

Process/send a command to the remote server.

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelineThe pipeline object.
Horde_Imap_Client_Interaction_Command$cmdThe master command.
Horde_Imap_Client_Data_Format_List$dataCommands to send.
Return values
booleanTrue if EOL needed to finish command.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupport

◆ _processCmdContinuation()

_processCmdContinuation ( $pipeline,
$noexception = false )
protected

Process a command continuation response.

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelineThe pipeline object.
boolean$noexceptionDon't throw exception if continuation does not occur.
Return values
mixedA Horde_Imap_Client_Interaction_Server_Continuation object or false.
Exceptions
Horde_Imap_Client_Exception

◆ _processString()

_processString ( $str,
$opts )
protected

Process a string response based on criteria options.

Parameters
string$strThe original string.
array$optsThe criteria options.
Return values
stringThe requested string.

◆ _removeBlob()

_removeBlob ( $str,
$i )
protected

Remove "[...]" text.

Parameters
string$strThe subject string.
integer$iCurrent position.
Return values
boolean|integerFalse if blob was not found, otherwise the string position of the first non-blob char.

◆ _removeBlobWhenNonempty()

_removeBlobWhenNonempty ( & $str)
protected

Remove "[...]" text if it doesn't result in the subject becoming empty.

Parameters
string&$strThe subject string.
Return values
booleanTrue if string was altered.

◆ _removeSubjFwdHdr()

_removeSubjFwdHdr ( & $str)
protected

Remove a "[fwd: ... ]" string.

Parameters
string&$strThe subject string.
Return values
booleanTrue if string was altered.

◆ _removeSubjLeader()

_removeSubjLeader ( & $str,
$keepblob = false )
protected

Remove all prefix text of the subject that matches the subj-leader ABNF.

Parameters
string&$strThe subject string.
boolean$keepblobRemove blob information?
Return values
booleanTrue if string was altered.

◆ _renameMailbox()

_renameMailbox ( Horde_Imap_Client_Mailbox $old,
Horde_Imap_Client_Mailbox $new )
abstractprotected

Rename a mailbox.

Parameters
Horde_Imap_Client_Mailbox$oldThe old mailbox name.
Horde_Imap_Client_Mailbox$newThe new mailbox name.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _resolveIds()

_resolveIds ( $ids)
protected

Resolve the $ids input to add() and remove().

Parameters
mixed$idsEither Horde_Imap_Client_Ids object, array, or sequence string.
Return values
arrayAn array of IDs.

◆ _responseCode()

_responseCode ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Interaction_Server $ob )
protected

Handle status responses (see RFC 3501 [7.1]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Interaction_Server$obServer object.
Exceptions
Horde_Imap_Client_Exception_ServerResponse

◆ _search()

_search ( $query,
$options )
abstractprotected

Search a mailbox.

Parameters
object$queryThe search query.
array$optionsAdditional options. The '_query' key contains the value of $query->build().
Return values
Horde_Imap_Client_IdsAn array of IDs.
Exceptions
Horde_Imap_Client_Exception

This driver supports all IMAP4rev1 search criteria as defined in RFC 3501.

Exceptions
Horde_Imap_Client_Exception_NoSupportPop3

◆ _sendCmd()

_sendCmd ( $cmd)
protected

Sends command(s) to the IMAP server.

A connection to the server must have already been made.

Parameters
mixed$cmdEither a Command object or a Pipeline object.
Return values
Horde_Imap_Client_Interaction_PipelineA pipeline object.
Exceptions
Horde_Imap_Client_Exception

◆ _sendCmdChunk()

_sendCmdChunk ( $pipeline,
$chunk )
protected

Send a chunk of commands and/or continuation fragments to the server.

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelineThe pipeline object.
array$chunkList of commands to send.
Exceptions
Horde_Imap_Client_Exception

◆ _sendID()

_sendID ( $info)
abstractprotected

Send ID information to the IMAP server (RFC 2971).

Parameters
array$infoThe information to send to the server.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _sendLine()

_sendLine ( $cmd,
$options = array() )
protected

Perform a command on the server.

A connection to the server must have already been made.

Parameters
string$cmdThe command to execute.
array$optionsAdditional options:
  - debug: (string) When debugging, send this string instead of the
           actual command/data sent.
           DEFAULT: Raw data output to debug stream.
  - multiline: (mixed) 'array', 'none', or 'stream'.
Return values
arraySee _getResponse().
Exceptions
Horde_Imap_Client_Exception

◆ _serverResponse()

_serverResponse ( Horde_Imap_Client_Interaction_Pipeline $pipeline,
Horde_Imap_Client_Interaction_Server $ob )
protected

Handle untagged server responses (see RFC 3501 [2.2.2]).

Parameters
Horde_Imap_Client_Interaction_Pipeline$pipelinePipeline object.
Horde_Imap_Client_Interaction_Server$obServer response.

◆ _setACL()

_setACL ( Horde_Imap_Client_Mailbox $mailbox,
$identifier,
$options )
abstractprotected

Set ACL rights for a given mailbox/identifier.

Parameters
Horde_Imap_Client_Mailbox$mailboxA mailbox.
string$identifierThe identifier to alter (UTF7-IMAP).
array$optionsAdditional options. 'rights' contains the string of rights to set on the server.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _setComparator()

_setComparator ( $comparator)
abstractprotected

Set the comparator to use for searching/sorting (RFC 5255).

Parameters
string$comparatorThe comparator string (see RFC 4790 [3.1] - "collation-id" - for format). The reserved string 'default' can be used to select the default comparator.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _setInit()

_setInit ( $key = null,
$val = null )

Set an initialization value.

Parameters
string$keyThe initialization key. If null, resets all keys.
mixed$valThe cached value. If null, removes the key.

◆ _setLanguage()

_setLanguage ( $langs)
abstractprotected

Sets the preferred language for server response messages (RFC 5255).

Parameters
array$langsThe preferred list of languages.
Return values
stringThe language accepted by the server, or null if the default language is used.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _setMetadata()

_setMetadata ( Horde_Imap_Client_Mailbox $mailbox,
$data )
abstractprotected

Set metadata for a given mailbox/identifier.

Parameters
Horde_Imap_Client_Mailbox$mailboxA mailbox.
array$dataA set of data values. See setMetadata() for format.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _setMixed()

_setMixed ( $data)
protected

Converts mixed input (string or resource) to the correct internal representation.

Parameters
mixed$dataMixed data (string, resource, Horde_Stream object).
Return values
mixedThe internal representation of that data.

◆ _setQuota()

_setQuota ( Horde_Imap_Client_Mailbox $root,
$options )
abstractprotected

Set quota limits.

Parameters
Horde_Imap_Client_Mailbox$rootThe quota root.
array$resourcesThe resource values to set.
Return values
booleanTrue on success.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _setSearchCache()

_setSearchCache ( $data,
$sdata )
protected

Set data in the search cache.

Parameters
mixed$dataThe cache data to store.
string$sdataThe search data returned from _getSearchCache().

◆ _sort()

_sort ( & $ids)
protected

Sorts the IDs numerically.

Parameters
array$idsThe array list.

◆ _sortString()

_sortString ( & $sorted)
protected

Sort an array of strings based on current locale.

Parameters
array&$sortedArray of strings.

◆ _stableAsort()

_stableAsort ( & $a)
protected

Stable asort() function.

PHP's asort() (BWT) is not a stable sort - identical values have no guarantee of key order. Use Schwartzian Transform instead. See: http://notmysock.org/blog/php/schwartzian-transform.html

Parameters
array&$aArray to sort.

◆ _status()

_status ( $mboxes,
$flags )
abstractprotected

Obtain status information for mailboxes.

Parameters
array$mboxesThe list of mailbox objects to query.
integer$flagsA bitmask of information requested from the server.
Return values
arraySee array return for status().
Exceptions
Horde_Imap_Client_Exception
Parameters
integer$flagsThis driver only supports the options listed under Horde_Imap_Client\STATUS_ALL.
Exceptions
Horde_Imap_Client_Exception_NoSupportPop3

◆ _store()

_store ( $options)
abstractprotected

Store message flag data.

Parameters
array$optionsAdditional options.
Return values
Horde_Imap_Client_IdsA Horde_Imap_Client_Ids object containing the list of IDs that failed the 'unchangedsince' test.
Exceptions
Horde_Imap_Client_Exception
Parameters
array$optionsAdditional options. This driver does not support 'unchangedsince'.

◆ _storeCmd()

_storeCmd ( $options)
protected

Create a store command.

Parameters
array$optionsSee Horde_Imap_Client_Base\_store().
Return values
Horde_Imap_Client_Interaction_PipelinePipeline object.

◆ _subscribeMailbox()

_subscribeMailbox ( Horde_Imap_Client_Mailbox $mailbox,
$subscribe )
abstractprotected

Manage subscription status for a mailbox.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe mailbox to [un]subscribe to.
boolean$subscribeTrue to subscribe, false to unsubscribe.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportPop3

◆ _syncStatus()

_syncStatus ( $mailbox)
protected

Return the current mailbox synchronization status.

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Return values
arrayAn array with status data. (This data is not guaranteed to have any specific format).

◆ _thread()

_thread ( $options)
abstractprotected

Thread sort a given list of messages (RFC 5256).

Parameters
array$optionsAdditional options. See thread().
Return values
Horde_Imap_Client_Data_ThreadA thread data object.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension
Horde_Imap_Client_Exception_NoSupportPop3

◆ _toSequenceString()

_toSequenceString ( $sort = true)
protected

Create an IMAP message sequence string from a list of indices.

Index Format: range_start:range_end,uid,uid2,...

Parameters
boolean$sortNumerically sort the IDs before creating the range?
Return values
stringThe IMAP message sequence string.

◆ _toUpdate()

_toUpdate ( $mailbox,
$type,
$data )
protected

Add update entry for a mailbox.

Parameters
string$mailboxThe mailbox.
string$type'add', 'slice', or 'slicemap'.
mixed$dataThe data to update.

◆ _tryLogin()

_tryLogin ( $method)
protected

Authenticate to the IMAP server.

Authenticate to the POP3 server.

Parameters
string$methodIMAP login method.
Return values
Horde_Imap_Client_Interaction_PipelinePipeline object.
Exceptions
Horde_Imap_Client_Exception
Parameters
string$methodPOP3 login method.
Exceptions
Horde_Imap_Client_Exception

◆ _updateCache()

_updateCache ( Horde_Imap_Client_Fetch_Results $data)
protected

Store FETCH data in cache.

Parameters
Horde_Imap_Client_Fetch_Results$dataThe fetch results.
Exceptions
Horde_Imap_Client_Exception

◆ _updateModSeq()

_updateModSeq ( $modseq)
protected

Updates the cached MODSEQ value.

Parameters
integer$modseqMODSEQ value to store.
Return values
mixedThe MODSEQ of the old value if it was replaced (or false if it didn't exist or is the same).

◆ _value()

_value ( $data)
protected

Convert data from/to storage format.

Parameters
mixed | MongoBinData$dataThe data object.
Return values
mixed|MongoBinDataThe converted data.

◆ _vanished()

_vanished ( $modseq,
Horde_Imap_Client_Ids $ids )
abstractprotected

Get the list of vanished messages.

Parameters
integer$modseqMod-sequence value.
Horde_Imap_Client_Ids$idsUIDs.
Return values
Horde_Imap_Client_IdsList of UIDs that have vanished.
Exceptions
Horde_Imap_Client_Exception_NoSupportPop3

◆ _write()

_write ( $msg,
$pre = null )
protected

Write debug information to the output stream.

Parameters
string$msgDebug data.

◆ add() [1/3]

add ( $capability,
$params = null )

Add an alert.

Add a capability (and optional parameters).

Parameters
string$alertThe alert string.
string$typeThe alert type.
string$capabilityThe capability to add.
mixed$paramsA parameter (or array of parameters) to add.

◆ add() [2/3]

add ( $data)

Add IDs to the current object.

Add data to buffer.

Parameters
mixed$idsEither self\ALL, self\SEARCH_RES, self\LARGEST, Horde_Imap_Client_Ids object, array, or sequence string.
mixed$dataData to add (string, resource, or Horde_Stream object).

◆ add() [3/3]

add ( Horde_Imap_Client_Interaction_Command $cmd,
$top = false )

Add a command to the pipeline.

Parameters
Horde_Imap_Client_Interaction_Command$cmdCommand object.
boolean$topAdd command to top of queue?

◆ addLiteralStream()

addLiteralStream ( $data)

Add data to literal stream at the current position.

Parameters
mixed$dataData to add (string, resource, or Horde_Stream object).

◆ alerts()

alerts ( )

Return a list of alerts that MUST be presented to the user (RFC 3501 [7.1]).

Deprecated
Add an observer to the $alerts_ob property instead.
Return values
arrayAn array of alert messages.

◆ allAclRights()

allAclRights ( )

Return master list of ACL rights available on the server.

Return values
arrayA list of ACL rights.

◆ andSearch()

andSearch ( $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.

Parameters
mixed$queriesA query, or an array of queries, to AND with the current query.

◆ append()

append ( $mailbox,
$data,
array $options = array() )

Append message(s) to a mailbox.

Parameters
mixed$mailboxThe mailbox to append the message(s) to. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$dataThe message data to append, along with additional options. An array of arrays with each embedded array having the following entries:
  - data: (mixed) The data to append. If a string or a stream resource,
          this will be used as the entire contents of a single message.
          If an array, will catenate all given parts into a single
          message. This array contains one or more arrays with
          two keys:
    - t: (string) Either 'url' or 'text'.
    - v: (mixed) If 't' is 'url', this is the IMAP URL to the message
         part to append. If 't' is 'text', this is either a string or
         resource representation of the message part data.
    DEFAULT: NONE (entry is MANDATORY)
  - flags: (array) An array of flags/keywords to set on the appended
           message.
           DEFAULT: Only the Recent flag is set.
  - internaldate: (DateTime) The internaldate to set for the appended
                  message.
                  DEFAULT: internaldate will be the same date as when
                  the message was appended.
array$optionsAdditonal options:
  - create: (boolean) Try to create $mailbox if it does not exist?
            DEFAULT: No.
Return values
Horde_Imap_Client_IdsThe UIDs of the appended messages.
Exceptions
Horde_Imap_Client_Exception

◆ binary()

binary ( )

If literal output, is the data binary?

Exceptions
Horde_Imap_Client_Exception
Return values
booleanTrue if the literal output is binary.

◆ bodyPart()

bodyPart ( $id,
array $opts = array() )

Return the body part data for a MIME ID.

Parameters
string$idThe MIME ID to obtain the body part text for.
array$optsThe following options are available:
  • decode: (boolean) Attempt to server-side decode the bodypart data if it is MIME transfer encoded. DEFAULT: false
  • length: (integer) The length of the substring to return. DEFAULT: The entire text is returned.
  • peek: (boolean) If set, does not set the 'Seen' flag on the message. DEFAULT: The seen flag is set.
  • start: (integer) If a portion of the full text is desired to be returned, the starting position is identified here. DEFAULT: The entire text is returned.

◆ bodyPartSize()

bodyPartSize ( $id)

Returns the decoded body part size for a MIME ID.

Parameters
string$idThe MIME ID to obtain the decoded body part size for.

◆ bodyText()

bodyText ( array $opts = array())

Return body text.

Body text is defined only for the base RFC 2822 message or message/rfc822 parts.

Parameters
array$optsThe following options are available:
  • id: (string) The MIME ID to obtain the body text for. DEFAULT: The body text for the entire message will be returned.
  • length: (integer) The length of the substring to return. DEFAULT: The entire text is returned.
  • peek: (boolean) If set, does not set the 'Seen' flag on the message. DEFAULT: The seen flag is set.
  • start: (integer) If a portion of the full text is desired to be returned, the starting position is identified here. DEFAULT: The entire text is returned.

◆ build()

build ( $exts = array())

Builds an IMAP4rev1 compliant search string.

Todo
Change default of $exts to null.
Parameters
Horde_Imap_Client_Base$extsThe server object this query will be run on (
Since
2.24.0), a Horde_Imap_Client_Data_Capability object (
2.24.0), or the list of extensions present on the server (
Deprecated
). If null, all extensions are assumed to be available.
Return values
arrayAn array with these elements:
  • charset: (string) The charset of the search string. If null, no text strings appear in query.
  • exts: (array) The list of IMAP extensions used to create the string.
  • query: (Horde_Imap_Client_Data_Format_List) The IMAP search command.
Exceptions
Horde_Imap_Client_Data_Format_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ capability()

capability ( )

Get CAPABILITY information from the IMAP server.

Deprecated
Use $capability property instead.
Return values
arrayThe capability array.
Exceptions
Horde_Imap_Client_Exception

◆ charset()

charset ( $charset,
$convert = true )

Sets the charset of the search text.

Parameters
string$charsetThe charset to use for the search.
boolean$convertConvert existing text values?
Exceptions
Horde_Imap_Client_Exception_SearchCharset

◆ check()

check ( )

Request a checkpoint of the currently selected mailbox (RFC 3501 [6.4.1]).

Exceptions
Horde_Imap_Client_Exception

◆ clear() [1/2]

clear ( $lifetime = null)
abstract

Clear the cache.

Since
2.9.0
Parameters
integer$lifetimeOnly delete entries older than this (in seconds). If null, deletes all entries.
integer$lifetimeOnly delete entries older than this (in seconds). If null, deletes all entries.

◆ clear() [2/2]

clear ( )

Clears all fetch results.

Since
2.6.0

◆ client()

client ( $msg)

Write client output to debug log.

Parameters
string$msgDebug message.

◆ clientSort()

clientSort ( $res,
$opts )

Sort search results client side if the server does not support the SORT IMAP extension (RFC 5256).

Parameters
Horde_Imap_Client_Ids$resThe search results.
array$optsThe options to _search().
Return values
arrayThe sort results.
Exceptions
Horde_Imap_Client_Exception

◆ close()

close ( array $options = array())

Close the connection to the currently selected mailbox, optionally expunging all deleted messages (RFC 3501 [6.4.2]).

Parameters
array$optionsAdditional options:
  • expunge: (boolean) Expunge all messages flagged as deleted? DEFAULT: No
Exceptions
Horde_Imap_Client_Exception

◆ complete()

complete ( Horde_Imap_Client_Interaction_Server_Tagged $resp)

Mark a command as completed.

Parameters
Horde_Imap_Client_Interaction_Server_Tagged$respTagged server response.
Return values
Horde_Imap_Client_Interaction_CommandCommand that was completed. Returns null if tagged response is not contained in this pipeline object.

◆ contains()

contains ( $criteria)

Does the query contain the given criteria?

Parameters
integer$criteriaThe criteria to remove.
Return values
booleanTrue if the query contains the given criteria.

◆ copy()

copy ( $source,
$dest,
array $options = array() )

Copy messages to another mailbox.

Parameters
mixed$sourceThe source mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
mixed$destThe destination mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$optionsAdditional options:
  • create: (boolean) Try to create $dest if it does not exist? DEFAULT: No.
  • force_map: (boolean) Forces the array mapping to always be returned. [
Since
2.19.0]
  • ids: (Horde_Imap_Client_Ids) The list of messages to copy. DEFAULT: All messages in $mailbox will be copied.
  • move: (boolean) If true, delete the original messages. DEFAULT: Original messages are not deleted.
Return values
mixedAn array mapping old UIDs (keys) to new UIDs (values) on success (only guaranteed if 'force_map' is true) or true.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ create()

static create ( Horde_Imap_Client_Tokenize $t)
static

Auto-scan an incoming line to determine the response type.

Parameters
Horde_Imap_Client_Tokenize$tTokenized data returned from the server.
Return values
Horde_Imap_Client_Interaction_ServerA server response object.

◆ createMailbox()

createMailbox ( $mailbox,
array $opts = array() )

Create a mailbox.

Parameters
mixed$mailboxThe mailbox to create. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$optsAdditional options:
  • special_use: (array) An array of special-use flags to mark the mailbox with. The server MUST support RFC 6154.
Exceptions
Horde_Imap_Client_Exception

◆ currentMailbox()

currentMailbox ( )

Return the currently opened mailbox and access mode.

Return values
mixedNull if no mailbox selected, or an array with two elements:
  • mailbox: (Horde_Imap_Client_Mailbox) The mailbox object.
  • mode: (integer) Current mode.
Exceptions
Horde_Imap_Client_Exception

◆ dateSearch()

dateSearch ( $date,
$range,
$header = true,
$not = false,
array $opts = array() )

Search for messages within a date range.

Parameters
mixed$dateDateTime or Horde_Date object.
string$rangeEither:
  • Horde_Imap_Client_Search_Query\DATE_BEFORE
  • Horde_Imap_Client_Search_Query\DATE_ON
  • Horde_Imap_Client_Search_Query\DATE_SINCE
boolean$headerIf true, search using the date in the message headers. If false, search using the internal IMAP date (usually arrival time).
boolean$notIf true, do a 'NOT' search of the range.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ dateTimeSearch()

dateTimeSearch ( $date,
$range,
$header = true,
$not = false,
array $opts = array() )

Search for messages within a date and time range.

Parameters
mixed$dateDateTime or Horde_Date object.
string$rangeEither:
  • Horde_Imap_Client_Search_Query\DATE_BEFORE
  • Horde_Imap_Client_Search_Query\DATE_ON
  • Horde_Imap_Client_Search_Query\DATE_SINCE
boolean$headerIf true, search using the date in the message headers. If false, search using the internal IMAP date (usually arrival time).
boolean$notIf true, do a 'NOT' search of the range.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ deleteACL()

deleteACL ( $mailbox,
$identifier )

Deletes ACL rights for a given mailbox/identifier.

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
string$identifierThe identifier to delete (UTF-8).
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ deleteMailbox()

deleteMailbox ( $mailbox)
abstract

Delete a mailbox.

Delete a mailbox from the cache.

Parameters
mixed$mailboxThe mailbox to delete. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Exceptions
Horde_Imap_Client_Exception
Parameters
string$mboxThe mailbox to delete.
string$mailboxThe mailbox to delete.

◆ deleteMsgs()

deleteMsgs ( $mailbox,
$uids )
abstract

Delete messages in the cache.

Parameters
string$mailboxAn IMAP mailbox string.
array$uidsThe list of message UIDs to delete.

◆ diff()

diff ( $rights)

Computes the difference to another rights string.

Virtual rights are ignored.

Parameters
string$rightsThe rights to compute against.
Return values
arrayTwo element array: added and removed.

◆ enable()

enable ( $capability,
$enable = true )

Set a capability as enabled/disabled.

Parameters
array$capabilityA capability (+ parameter).
boolean$enableIf true, enables the capability.

◆ equals()

equals ( $mbox)

Compares this mailbox to another mailbox string.

Return values
booleanTrue if the items are equal.

◆ escape()

escape ( )

Returns the data formatted for output to the IMAP server.

Return values
stringIMAP escaped string.

◆ escapeStream()

escapeStream ( )

Return the escaped string as a stream.

Return values
resourceThe IMAP escaped stream.

◆ exists()

exists ( $type)

Does this object containing cacheable data of the given type?

Parameters
integer$typeThe type to query.
Return values
booleanTrue if the type is cacheable.

◆ expunge()

expunge ( $mailbox,
array $options = array() )

Expunge deleted messages from the given mailbox.

Parameters
mixed$mailboxThe mailbox to expunge. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$optionsAdditional options:
  • delete: (boolean) If true, will flag all messages in 'ids' as deleted (since 2.10.0). DEFAULT: false
  • ids: (Horde_Imap_Client_Ids) A list of messages to expunge. These messages must already be flagged as deleted (unless 'delete' is true). DEFAULT: All messages marked as deleted will be expunged.
  • list: (boolean) If true, returns the list of expunged messages (UIDs only). DEFAULT: false
Return values
Horde_Imap_Client_IdsIf 'list' option is true, returns the UID list of expunged messages.
Exceptions
Horde_Imap_Client_Exception

◆ fetch()

fetch ( $mailbox,
$query,
array $options = array() )

Fetch message data (see RFC 3501 [6.4.5]).

Parameters
mixed$mailboxThe mailbox to search. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Horde_Imap_Client_Fetch_Query$queryFetch query object.
array$optionsAdditional options:
  • changedsince: (integer) Only return messages that have a mod-sequence larger than this value. This option requires the CONDSTORE IMAP extension (if not present, this value is ignored). Additionally, the mailbox must support mod-sequences or an exception will be thrown. If valid, this option implicity adds the mod-sequence fetch criteria to the fetch command. DEFAULT: Mod-sequence values are ignored.
  • exists: (boolean) Ensure that all ids returned exist on the server. If false, the list of ids returned in the results object is not guaranteed to reflect the current state of the remote mailbox. DEFAULT: false
  • ids: (Horde_Imap_Client_Ids) A list of messages to fetch data from. DEFAULT: All messages in $mailbox will be fetched.
  • nocache: (boolean) If true, will not cache the results (previously cached data will still be used to generate results) [since 2.8.0]. DEFAULT: false
Return values
Horde_Imap_Client_Fetch_ResultsA results object.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ fetchFromUrl()

fetchFromUrl ( Horde_Imap_Client_Url_Imap $url)

Given an IMAP URL, fetches the corresponding part.

Parameters
Horde_Imap_Client_Url_Imap$urlAn IMAP URL.
Return values
resourceThe section contents in a stream. Returns null if the part could not be found.
Exceptions
Horde_Imap_Client_Exception

◆ filter()

filter ( $in,
$out,
& $consumed,
$closing )
See also
stream_filter_register()

◆ first()

first ( )

Return the first fetch object in the results, if there is only one object.

Return values
null|Horde_Imap_Client_Data_FetchThe fetch object if there is only one object, or null.

◆ flag()

flag ( $name,
$set = true,
array $opts = array() )

Search for a flag/keywords.

Parameters
string$nameThe flag or keyword name.
boolean$setIf true, search for messages that have the flag set. If false, search for messages that do not have the flag set.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ flagSearch()

flagSearch ( )

Determines if flags are a part of the search.

Return values
booleanTrue if search query involves flags.

◆ flushIterator()

flushIterator ( $return = true,
$sublevel = true )

Flush the remaining entries left in the iterator.

Parameters
boolean$returnIf true, return entries. Only returns entries on the current level.
boolean$sublevelOnly flush items in current sublevel?
Return values
arrayThe entries if $return is true.

◆ fullText()

fullText ( array $opts = array())

Get the full text of the message.

Parameters
array$optsThe following options are available:
  • length: (integer) The length of the substring to return. DEFAULT: The entire text is returned.
  • peek: (boolean) If set, does not set the 'Seen' flag on the message. DEFAULT: The seen flag is set.
  • start: (integer) If a portion of the full text is desired to be returned, the starting position is identified here. DEFAULT: The entire text is returned.

◆ get() [1/4]

get ( $key)

Return a fetch object, creating and storing an empty object in the results set if it doesn't currently exist.

Parameters
string$keyThe key to retrieve.
Return values
Horde_Imap_Client_Data_FetchThe fetch object.

◆ get() [2/4]

get ( $mailbox,
$uids,
$fields,
$uidvalid )
abstract

Get information from the cache for a set of UIDs.

Parameters
string$mailboxAn IMAP mailbox string.
array$uidsThe list of message UIDs to retrieve information for.
array$fieldsAn array of fields to retrieve. If empty, returns all cached fields.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.
Return values
arrayAn array of arrays with the UID of the message as the key (if found) and the fields as values (will be undefined if not found).

◆ get() [3/4]

get ( $mailbox,
array $uids = array(),
$fields = array(),
$uidvalid = null )

Get information from the cache.

Parameters
string$mailboxAn IMAP mailbox string.
array$uidsThe list of message UIDs to retrieve information for. If empty, returns the list of cached UIDs.
array$fieldsAn array of fields to retrieve. If empty, returns all cached fields.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.
Return values
arrayAn array of arrays with the UID of the message as the key (if found) and the fields as values (will be undefined if not found). If $uids is empty, returns the full (unsorted) list of cached UIDs.

◆ get() [4/4]

static get ( $mbox,
$utf7imap = false )
static

Shortcut to obtaining mailbox object.

Parameters
string$mboxThe mailbox name.
boolean$utf7imapIs mailbox UTF7-IMAP encoded? Otherwise, mailbox is assumed to be UTF-8.
Return values
Horde_Imap_Client_MailboxA mailbox object.

◆ getACL()

getACL ( $mailbox)

Get the ACL rights for a given mailbox.

The server must support the IMAP ACL extension (RFC 2086/4314).

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Return values
arrayAn array with identifiers as the keys and Horde_Imap_Client_Data_Acl objects as the values.
Exceptions
Horde_Imap_Client_Exception

◆ getBodyPart()

getBodyPart ( $id,
$stream = false )

Get a body part entry.

Parameters
string$idThe MIME ID.
boolean$streamReturn as a stream?
Return values
mixedThe full text of the body part.

◆ getBodyPartDecode()

getBodyPartDecode ( $id)

Determines if/how a body part was MIME decoded on the server.

Parameters
string$idThe MIME ID.
Return values
stringEither '8bit', 'binary', or null.

◆ getBodyPartSize()

getBodyPartSize ( $id)

Returns the body part size, if returned by the server.

Parameters
string$idThe MIME ID.
Return values
integerThe body part size, in bytes.

◆ getBodyText()

getBodyText ( $id = 0,
$stream = false )

Get a body text entry.

Parameters
string$idThe MIME ID.
boolean$streamReturn as a stream?
Return values
mixedThe full text of the body text.

◆ getCache()

getCache ( )

Returns the Horde_Imap_Client_Cache object used, if available.

Return values
mixedEither the cache object or null.

◆ getCachedUids()

getCachedUids ( $mailbox,
$uidvalid )
abstract

Get the list of cached UIDs.

Parameters
string$mailboxAn IMAP mailbox string.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.
Return values
arrayThe (unsorted) list of cached UIDs.

◆ getCacheId()

getCacheId ( $mailbox,
array $addl = array() )

Returns a unique identifier for the current mailbox status.

Deprecated
Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$addlAdditional cache info to add to the cache ID string.
Return values
stringThe cache ID string, which will change when the composition of the mailbox changes. The uidvalidity will always be the first element, and will be delimited by the '|' character.
Exceptions
Horde_Imap_Client_Exception

◆ getClientFinalMessage()

getClientFinalMessage ( )

Return the final client message.

Return values
stringFinal client message.

◆ getClientFirstMessage()

getClientFirstMessage ( )

Return the initial client message.

Return values
stringInitial client message.

◆ getCmd()

getCmd ( $tag)

Return the command for a given tag.

Parameters
string$tagThe command tag.
Return values
Horde_Imap_Client_Interaction_CommandA command object (or null if the tag does not exist).

◆ getCommand()

getCommand ( )

Get the command.

Return values
stringThe command.

◆ getCommands()

getCommands ( Horde_Imap_Client_Interaction_Server_Continuation $ob)

Calls the closure object.

Parameters
Horde_Imap_Client_Interaction_Server_Continuation$obContinuation object.
Return values
Horde_Imap_Client_Data_Format_ListFurther commands to issue to the server.

◆ getComparator()

getComparator ( )

Get the comparator used for searching/sorting (RFC 5255).

Return values
mixedNull if the default comparator is being used, or an array of comparator information (see RFC 5255 [4.8]).
Exceptions
Horde_Imap_Client_Exception

◆ getData()

getData ( )

Returns the raw data.

Return values
mixedRaw data.

◆ getEnvelope()

getEnvelope ( )

Get envelope data.

Return values
Horde_Imap_Client_Data_EnvelopeAn envelope object.

◆ getFlags()

getFlags ( )

Get IMAP flags.

Return values
arrayAn array of IMAP flags (all flags in lowercase).

◆ getFullMsg()

getFullMsg ( $stream = false)

Returns the full message.

Parameters
boolean$streamReturn as a stream?
Return values
mixedThe full text of the entire message.

◆ getHeaders()

getHeaders ( $label,
$format = 0 )

Get a header entry.

Parameters
string$labelThe search label.
integer$formatThe return format. If self\HEADER_PARSE, returns a Horde_Mime_Headers object. If self\HEADER_STREAM, returns a stream. Otherwise, returns header text.
Return values
mixedSee $format.

◆ getHeaderText()

getHeaderText ( $id = 0,
$format = 0 )

Get a header text entry.

Parameters
string$idThe MIME ID.
integer$formatThe return format. If self\HEADER_PARSE, returns a Horde_Mime_Headers object. If self\HEADER_STREAM, returns a stream. Otherwise, returns header text.
Return values
mixedSee $format.

◆ getID()

getID ( )

Return ID information from the IMAP server (RFC 2971).

Return values
arrayAn array of information returned, with the keys as the 'field' and the values as the 'value'.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ getIdsOb()

getIdsOb ( $ids = null,
$sequence = false )

Returns the correct IDs object for use with this driver.

Parameters
mixed$idsEither self\ALL, self\SEARCH_RES, self\LARGEST, Horde_Imap_Client_Ids object, array, or sequence string.
boolean$sequenceAre $ids message sequence numbers?
Return values
Horde_Imap_Client_IdsThe IDs object.

◆ getImapDate()

getImapDate ( )

Get internal IMAP date.

Return values
Horde_Imap_Client_DateTimeA date object.

◆ getLanguage()

getLanguage ( $list = false)

Gets the preferred language for server response messages (RFC 5255).

Parameters
array$listIf true, return the list of available languages.
Return values
mixedIf $list is true, the list of languages available on the server (may be empty). If false, the language used by the server, or null if the default language is used.
Exceptions
Horde_Imap_Client_Exception

◆ getLast()

getLast ( )

Returns the last alert received.

Return values
objectAlert information. Object with these properties:
  - alert: (string) Alert string.
  - type: (string) [OPTIONAL] Alert type.

◆ getLiteralLength()

getLiteralLength ( )

Return literal length data located at the end of the stream.

Return values
mixedNull if no literal data found, or an array with these keys:
  • binary: (boolean) True if this is a literal8.
  • length: (integer) Length of the literal.

◆ getMetaData() [1/2]

getMetaData ( $mailbox,
$uidvalid,
$entries )
abstract

Get metadata information for a mailbox.

Parameters
string$mailboxAn IMAP mailbox string.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.
array$entriesAn array of entries to return. If empty, returns all metadata.
Return values
arrayThe requested metadata. Requested entries that do not exist will be undefined. The following entries are defaults and always present:
  • uidvalid: (integer) The UIDVALIDITY of the mailbox.

◆ getMetaData() [2/2]

getMetaData ( $mailbox,
$uidvalid = null,
array $entries = array() )

Get metadata information for a mailbox.

Parameters
string$mailboxAn IMAP mailbox string.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.
array$entriesAn array of entries to return. If empty, returns all metadata.
Return values
arrayThe requested metadata. Requested entries that do not exist will be undefined. The following entries are defaults and always present:
  • uidvalid: (integer) The UIDVALIDITY of the mailbox.

◆ getMetadata()

getMetadata ( $mailbox,
$entries,
array $options = array() )

Get metadata for a given mailbox.

The server must support either the IMAP METADATA extension (RFC 5464) or the ANNOTATEMORE extension (http://ietfreport.isoc.org/idref/draft-daboo-imap-annotatemore/).

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$entriesThe entries to fetch (UTF-8 strings).
array$optionsAdditional options:
  • depth: (string) Either "0", "1" or "infinity". Returns only the given value (0), only values one level below the specified value (1) or all entries below the specified value (infinity).
  • maxsize: (integer) The maximal size the returned values may have. DEFAULT: No maximal size.
Return values
arrayAn array with metadata names as the keys and metadata values as the values. If 'maxsize' is set, and entries exist on the server larger than this size, the size will be returned in the key '*longentries'.
Exceptions
Horde_Imap_Client_Exception

◆ getMimeHeader()

getMimeHeader ( $id,
$format = 0 )

Get a MIME header entry.

Parameters
string$idThe MIME ID.
integer$formatThe return format. If self\HEADER_PARSE, returns a Horde_Mime_Headers object. If self\HEADER_STREAM, returns a stream. Otherwise, returns header text.
Return values
mixedSee $format.

◆ getModSeq()

getModSeq ( )

Get the modified sequence value for the message.

Return values
integerThe modseq value.

◆ getMyACLRights()

getMyACLRights ( $mailbox)

Get the ACL rights for the current user for a given mailbox.

The server must support the IMAP ACL extension (RFC 2086/4314).

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Return values
Horde_Imap_Client_Data_AclAn ACL data object.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ getNamespace()

getNamespace ( $mbox,
$personal = false )

Get namespace info for a full mailbox path.

Parameters
string$mboxThe mailbox path.
boolean$personalIf true, will return the empty namespace only if it is a personal namespace.
Return values
mixedThe Horde_Imap_Client_Data_Namespace object for the mailbox path, or null if the path doesn't exist.

◆ getNamespaces()

getNamespaces ( array $additional = array(),
array $opts = array() )

Get the NAMESPACE information from the IMAP server (RFC 2342).

Parameters
array$additionalIf the server supports namespaces, any additional namespaces to add to the namespace list that are not broadcast by the server. The namespaces must be UTF-8 strings.
array$optsAdditional options:
  • ob_return: (boolean) If true, returns a Horde_Imap_Client_Namespace_List object instead of an array.
Return values
mixedA Horde_Imap_Client_Namespace_List object if 'ob_return', is true. Otherwise, an array of namespace objects (
Deprecated
) with the name as the key (UTF-8) and the following values:
 - delimiter: (string) The namespace delimiter.
 - hidden: (boolean) Is this a hidden namespace?
 - name: (string) The namespace name (UTF-8).
 - translation: (string) Returns the translated name of the namespace
                (UTF-8). Requires RFC 5255 and a previous call to
                setLanguage().
 - type: (integer) The namespace type. Either:
   - Horde_Imap_Client\NS_PERSONAL
   - Horde_Imap_Client\NS_OTHER
   - Horde_Imap_Client\NS_SHARED
Exceptions
Horde_Imap_Client_Exception

◆ getParam()

getParam ( $key)

Returns a value from the internal params array.

Parameters
string$keyThe param key.
Return values
mixedThe param value, or null if not found.

◆ getParams()

getParams ( $capability)

Return the list of parameters for an extension.

Parameters
string$capabilityThe capability string to query.
Return values
arrayAn array of parameters if the extension exists and supports parameters. Otherwise, an empty array.

◆ getPassword()

getPassword ( )

Return the password to use for the server connection.

Return values
stringThe password.

◆ getQuota()

getQuota ( $root)

Get quota limits.

The server must support the IMAP QUOTA extension (RFC 2087).

Parameters
mixed$rootThe quota root. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Return values
mixedAn array with resource keys. Each key holds an array with 2 values: 'limit' and 'usage'.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ getQuotaRoot()

getQuotaRoot ( $mailbox)

Get quota limits for a mailbox.

The server must support the IMAP QUOTA extension (RFC 2087).

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Return values
mixedAn array with the keys being the quota roots. Each key holds an array with resource keys: each of these keys holds an array with 2 values: 'limit' and 'usage'.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ getRawData()

getRawData ( )

Return the internal representation of the data.

Return values
arrayThe data array.

◆ getSeq()

getSeq ( )

Get message sequence number.

Return values
integerThe message sequence number.

◆ getSize()

getSize ( )

Get message size.

Return values
integerThe size of the message, in bytes.

◆ getStatus()

getStatus ( $entry)

Get status information for the mailbox.

Parameters
integer$entrySTATUS_* constant.
Return values
mixedStatus information.

◆ getStream()

getStream ( )

Return the contents of the string as a stream object.

Since
2.3.0
Return values
Horde_StreamThe stream object.

◆ getString()

getString ( $type = self::RFC_4314)

Returns the raw string to use in IMAP server calls.

Parameters
integer$typeThe RFC type to use (RFC_* constant).
Return values
stringThe string representation of the ACL.

◆ getStructure()

getStructure ( )

Get the message structure.

Return values
Horde_Mime_Part\$structureThe base MIME part of the message.

◆ getSyncToken()

getSyncToken ( $mailbox)

Returns a unique token for the current mailbox synchronization status.

Since
2.2.0
Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Return values
stringThe sync token.
Exceptions
Horde_Imap_Client_Exception

◆ getThread()

getThread ( $index)

Returns the list of messages in a thread.

Parameters
integer$indexAn index contained in the thread.
Return values
arrayKeys are indices, values are objects with the following properties:
  • base: (integer) Base ID of the thread. If null, thread is a single message.
  • last: (boolean) If true, this is the last index in the sublevel.
  • level: (integer) The sublevel of the index.

◆ getThreads()

getThreads ( )

Returns array of all threads.

Return values
arrayKeys of thread arrays are indices, values are objects with the following properties:
  • base: (integer) Base ID of the thread. If null, thread is a single message.
  • last: (boolean) If true, this is the last index in the sublevel.
  • level: (integer) The sublevel of the index.

◆ getTimer()

getTimer ( )

Return the timer data.

Return values
mixedNull if timer wasn't started, or a float containing elapsed command time.

◆ getType()

getType ( )

Return the ID type.

Return values
stringEither 'sequence' or 'uid'.

◆ getUid()

getUid ( )

Get UID.

Return values
integerThe message UID.

◆ hash()

hash ( )

Returns a hash of the current query object.

Return values
stringHash.

◆ headers()

headers ( $label,
$search,
array $opts = array() )

Returns RFC 2822 header text that matches a search string.

This header search work only with the base RFC 2822 message or message/rfc822 parts.

Parameters
string$labelA unique label associated with this particular search. This is how the results are stored.
array$searchThe search string(s) (case-insensitive).
array$optsThe following options are available:
  • cache: (boolean) If true, and 'peek' is also true, will cache the result of this call. DEFAULT: false
  • id: (string) The MIME ID to search. DEFAULT: The base message part
  • length: (integer) The length of the substring to return. DEFAULT: The entire text is returned.
  • notsearch: (boolean) Do a 'NOT' search on the headers. DEFAULT: false
  • peek: (boolean) If set, does not set the 'Seen' flag on the message. DEFAULT: The seen flag is set.
  • start: (integer) If a portion of the full text is desired to be returned, the starting position is identified here. DEFAULT: The entire text is returned.

◆ headerText() [1/2]

headerText ( $header,
$text,
$not = false,
array $opts = array() )

Search for text in the header of a message.

Parameters
string$headerThe header field.
string$textThe search text.
boolean$notIf true, do a 'NOT' search of $text.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ headerText() [2/2]

headerText ( array $opts = array())

Return header text.

Header text is defined only for the base RFC 2822 message or message/rfc822 parts.

Parameters
array$optsThe following options are available:
  • id: (string) The MIME ID to obtain the header text for. DEFAULT: The header text for the base message will be returned.
  • length: (integer) The length of the substring to return. DEFAULT: The entire text is returned.
  • peek: (boolean) If set, does not set the 'Seen' flag on the message. DEFAULT: The seen flag is set.
  • start: (integer) If a portion of the full text is desired to be returned, the starting position is identified here. DEFAULT: The entire text is returned.

◆ ids() [1/2]

ids ( )

Return the list of IDs.

Return values
arrayID list.

◆ ids() [2/2]

ids ( Horde_Imap_Client_Ids $ids,
$not = false,
array $opts = array() )

Search for messages within a given UID range.

Only one message range can be specified per query.

Parameters
Horde_Imap_Client_Ids$idsThe list of UIDs to search.
boolean$notIf true, do a 'NOT' search of the UIDs.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ info()

info ( $msg)

Write informational message to debug log.

Parameters
string$msgDebug message.

◆ intervalSearch()

intervalSearch ( $interval,
$range,
$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.

Parameters
integer$intervalSeconds from the present.
string$rangeEither:
  • Horde_Imap_Client_Search_Query\INTERVAL_OLDER
  • Horde_Imap_Client_Search_Query\INTERVAL_YOUNGER
boolean$notIf true, do a 'NOT' search.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ isDefault()

isDefault ( )

Does this object contain only default values for all fields?

Return values
booleanTrue if object contains default data.

◆ isDowngraded()

isDowngraded ( )

Does the message contain internationalized downgraded data (i.e.

it is a "surrogate" message)?

Since
2.11.0
Return values
booleanTrue if at least one message components has been downgraded.

◆ isEmpty()

isEmpty ( )

Is this object empty (i.e.

does not contain IDs)?

Return values
booleanTrue if object is empty.

◆ isEnabled()

isEnabled ( $capability = null)

Is the extension enabled?

Parameters
string$capabilityThe extension (+ parameter) to query. If null, returns all enabled extensions.
Return values
mixedIf $capability is null, return all enabled extensions. Otherwise, true if the extension (+ parameter) is enabled.

◆ isSecureConnection()

isSecureConnection ( )

Display if connection to the server has been secured via TLS or SSL.

Return values
booleanTrue if the IMAP connection is secured.

◆ length()

length ( )

Return the length of the data.

Since
2.2.0
Return values
integerData length.

◆ listACLRights()

listACLRights ( $mailbox,
$identifier )

List the ACL rights for a given mailbox/identifier.

The server must support the IMAP ACL extension (RFC 2086/4314).

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
string$identifierThe identifier to query (UTF-8).
Return values
Horde_Imap_Client_Data_AclRightsAn ACL data rights object.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ listMailboxes()

listMailboxes ( $pattern,
$mode = Horde_Imap_Client::MBOX_ALL,
array $options = array() )

Obtain a list of mailboxes matching a pattern.

Parameters
mixed$patternThe mailbox search pattern(s) (see RFC 3501 [6.3.8] for the format). A UTF-8 string or an array of strings. If a Horde_Imap_Client_Mailbox object is given, it is escaped (i.e. wildcard patterns are converted to return the miminal number of matches possible).
integer$modeWhich mailboxes to return. Either:
  • Horde_Imap_Client\MBOX_SUBSCRIBED Return subscribed mailboxes.
  • Horde_Imap_Client\MBOX_SUBSCRIBED_EXISTS Return subscribed mailboxes that exist on the server.
  • Horde_Imap_Client\MBOX_UNSUBSCRIBED Return unsubscribed mailboxes.
  • Horde_Imap_Client\MBOX_ALL Return all mailboxes regardless of subscription status.
  • Horde_Imap_Client\MBOX_ALL_SUBSCRIBED (
Since
2.23.0) Return all mailboxes regardless of subscription status, and ensure the 'subscribed' attribute is set if mailbox is subscribed (implies 'attributes' option is true).
Parameters
array$optionsAdditional options:
  - attributes: (boolean) If true, return attribute information under
                the 'attributes' key.
                DEFAULT: Do not return this information.
  - children: (boolean) Tell server to return children attribute
              information (HasChildren, HasNoChildren). Requires the
              LIST-EXTENDED extension to guarantee this information is
              returned. Server MAY return this attribute without this
              option, or if the CHILDREN extension is available, but it
              is not guaranteed.
              DEFAULT: false
  - flat: (boolean) If true, return a flat list of mailbox names only.
          Overrides the 'attributes' option.
          DEFAULT: Do not return flat list.
  - recursivematch: (boolean) Force the server to return information
                    about parent mailboxes that don't match other
                    selection options, but have some sub-mailboxes that
                    do. Information about children is returned in the
                    CHILDINFO extended data item ('extended'). Requires
                    the LIST-EXTENDED extension.
                    DEFAULT: false
  - remote: (boolean) Tell server to return mailboxes that reside on
            another server. Requires the LIST-EXTENDED extension.
            DEFAULT: false
  - special_use: (boolean) Tell server to return special-use attribute
                 information (see Horde_Imap_Client SPECIALUSE_*
                 constants). Server must support the SPECIAL-USE return
                 option for this setting to have any effect.
                 DEFAULT: false
  - status: (integer) Tell server to return status information. The
            value is a bitmask that may contain any of:
    - Horde_Imap_Client\STATUS_MESSAGES
    - Horde_Imap_Client\STATUS_RECENT
    - Horde_Imap_Client\STATUS_UIDNEXT
    - Horde_Imap_Client\STATUS_UIDVALIDITY
    - Horde_Imap_Client\STATUS_UNSEEN
    - Horde_Imap_Client\STATUS_HIGHESTMODSEQ
    DEFAULT: 0
  - sort: (boolean) If true, return a sorted list of mailboxes?
          DEFAULT: Do not sort the list.
  - sort_delimiter: (string) If 'sort' is true, this is the delimiter
                    used to sort the mailboxes.
                    DEFAULT: '.'
Return values
arrayIf 'flat' option is true, the array values are a list of Horde_Imap_Client_Mailbox objects. Otherwise, the keys are UTF-8 mailbox names and the values are arrays with these keys:
  • attributes: (array) List of lower-cased attributes [only if 'attributes' option is true].
  • delimiter: (string) The delimiter for the mailbox.
  • extended: (TODO) TODO [only if 'recursivematch' option is true and LIST-EXTENDED extension is supported on the server].
  • mailbox: (Horde_Imap_Client_Mailbox) The mailbox object.
  • status: (array) See status() [only if 'status' option is true].
Exceptions
Horde_Imap_Client_Exception

◆ literal()

literal ( )

Does this data item require literal string output?

Return values
booleanTrue if literal output is required.

◆ login()

login ( )

Login to the IMAP server.

Exceptions
Horde_Imap_Client_Exception

◆ lookup()

lookup ( Horde_Imap_Client_Ids $ids)

Create a Sequence <-> UID lookup table.

Parameters
Horde_Imap_Client_Ids$idsIDs to lookup.
Return values
arrayKeys are sequence numbers, values are UIDs.

◆ merge()

merge ( Horde_Imap_Client_Data_Fetch $data)

Merge a fetch object into this one.

Parameters
Horde_Imap_Client_Data_Fetch$dataA fetch object.

◆ messageList()

messageList ( )

Return the sorted list of messages indices.

Return values
Horde_Imap_Client_IdsThe sorted list of messages.

◆ messagePrintf()

messagePrintf ( array $args = array())

Perform substitution of variables in the error message.

Needed to allow for correct translation of error message.

Since
2.22.0
Parameters
array$argsArguments used for substitution.

◆ mimeHeader()

mimeHeader ( $id,
array $opts = array() )

Return MIME header text.

MIME header text is defined only for non-RFC 2822 messages and non-message/rfc822 parts.

Parameters
string$idThe MIME ID to obtain the MIME header text for.
array$optsThe following options are available:
  • length: (integer) The length of the substring to return. DEFAULT: The entire text is returned.
  • peek: (boolean) If set, does not set the 'Seen' flag on the message. DEFAULT: The seen flag is set.
  • start: (integer) If a portion of the full text is desired to be returned, the starting position is identified here. DEFAULT: The entire text is returned.

◆ modseq() [1/2]

modseq ( $value,
$name = null,
$type = null,
$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.

Parameters
integer$valueThe mod-sequence value.
string$nameThe entry-name string.
string$typeEither 'shared', 'priv', or 'all'. Defaults to 'all'
boolean$notIf true, do a 'NOT' search.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ modseq() [2/2]

modseq ( )

Return the mod-sequence value for the message.

The server must support the CONDSTORE IMAP extension, and the mailbox must support mod-sequences.

◆ newMsgs()

newMsgs ( $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.

Parameters
boolean$newmsgsIf true, searches for new messages. Else, search for old messages.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ next()

next ( )
Return values
mixedEither a string, boolean (true for open paren, false for close paren/EOS), Horde_Stream object, or null.

◆ nextStream()

nextStream ( )

Force return of literal data as stream, if next token.

See also
next()

◆ noop()

noop ( )

Send a NOOP command (RFC 3501 [6.1.2]).

Exceptions
Horde_Imap_Client_Exception

◆ onCreate()

onCreate ( )
See also
stream_filter_register()

◆ openMailbox()

openMailbox ( $mailbox,
$mode = Horde_Imap_Client::OPEN_AUTO )

Open a mailbox.

Parameters
mixed$mailboxThe mailbox to open. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
integer$modeThe access mode. Either
  • Horde_Imap_Client\OPEN_READONLY
  • Horde_Imap_Client\OPEN_READWRITE
  • Horde_Imap_Client\OPEN_AUTO
Exceptions
Horde_Imap_Client_Exception

◆ orSearch()

orSearch ( $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.

Parameters
mixed$queriesA query, or an array of queries, to OR with the current query.

◆ parseCacheId()

parseCacheId ( $id)

Parses a cacheID created by getCacheId().

Deprecated
Parameters
string$idThe cache ID.
Return values
arrayAn array with the following information:
  • highestmodseq: (integer)
  • messages: (integer)
  • uidnext: (integer)
  • uidvalidity: (integer) Always present

◆ parseServerFinalMessage()

parseServerFinalMessage ( $msg)

Process the final server message response.

Parameters
string$msgFinal server response.
Return values
booleanFalse if authentication failed.

◆ parseServerFirstMessage()

parseServerFirstMessage ( $msg)

Process the initial server message response.

Parameters
string$msgInitial server response.
Return values
booleanFalse if authentication failed at this stage.

◆ previousSearch()

previousSearch ( $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.

Parameters
boolean$notIf true, don't match the previous query.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ query()

query ( $charset,
$cached = null )

Returns whether the server supports the given capability.

Query the validity of a charset.

Parameters
string$capabilityThe capability string to query.
string$parameterIf set, require the parameter to exist.
Return values
booleanTrue if the capability (and parameter) exist.
Parameters
string$charsetThe charset to query.
boolean$cachedIf true, only query cached values.
Return values
booleanTrue if the charset is valid for searching.

◆ queryCapability()

queryCapability ( $capability)

Returns whether the IMAP server supports the given capability (See RFC 3501 [6.1.1]).

Deprecated
Use $capability property instead.
Parameters
string$capabilityThe capability string to query.
Return values
mixedTrue if the server supports the queried capability, false if it doesn't, or an array if the capability can contain multiple values.

◆ quoted()

quoted ( )

Does this data item require quoted string output?

Return values
booleanTrue if quoted output is required.

◆ raw()

raw ( $msg)

Write server output to debug log.

Parameters
string$msgDebug message.

◆ read()

read ( $size = null)

Read data from incoming POP3 stream.

Read data from incoming IMAP stream.

Parameters
integer$sizeUNUSED: The number of bytes to read from the socket.
Return values
stringLine of data.
Exceptions
Horde_Imap_Client_Exception
Parameters
integer$sizeUNUSED: The number of bytes to read from the socket.
Return values
Horde_Imap_Client_TokenizeThe tokenized data.
Exceptions
Horde_Imap_Client_Exception

◆ remove() [1/3]

remove ( $criteria,
$key = null )

Remove a capability.

Remove an entry under a given criteria.

Parameters
string$capabilityThe capability to remove.
string$paramsA parameter (or array of parameters) to remove from the capability.
integer$criteriaCriteria ID.
string$keyThe key to remove.

◆ remove() [2/3]

remove ( $ids)

Removed IDs from the current object.

Since
2.17.0
Parameters
mixed$idsEither Horde_Imap_Client_Ids object, array, or sequence string.

◆ remove() [3/3]

remove ( Horde_Imap_Client_Ids $ids)

Removes messages from the ID mapping.

Parameters
Horde_Imap_Client_Ids$idsIDs to remove.

◆ renameMailbox()

renameMailbox ( $old,
$new )

Rename a mailbox.

Parameters
mixed$oldThe old mailbox name. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
mixed$newThe new mailbox name. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Exceptions
Horde_Imap_Client_Exception

◆ resolveIds()

resolveIds ( Horde_Imap_Client_Mailbox $mailbox,
Horde_Imap_Client_Ids $ids,
$convert = 0 )

Resolves an IDs object into a list of IDs.

Parameters
Horde_Imap_Client_Mailbox$mailboxThe mailbox.
Horde_Imap_Client_Ids$idsThe Ids object.
integer$convertConvert to UIDs?
  • 0: No
  • 1: Only if $ids is not already a UIDs object
  • 2: Always
Return values
Horde_Imap_Client_IdsThe list of IDs.

◆ search()

search ( $mailbox,
$query = null,
array $options = array() )

Search a mailbox.

Parameters
mixed$mailboxThe mailbox to search. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Horde_Imap_Client_Search_Query$queryThe search query. Defaults to an ALL search.
array$optionsAdditional options:
  - nocache: (boolean) Don't cache the results.
             DEFAULT: false (results cached, if possible)
  - partial: (mixed) The range of results to return (message sequence
             numbers) Only a single range is supported (represented by
             the minimum and maximum values contained in the range
             given).
             DEFAULT: All messages are returned.
  - results: (array) The data to return. Consists of zero or more of
             the following flags:
    - Horde_Imap_Client\SEARCH_RESULTS_COUNT
    - Horde_Imap_Client\SEARCH_RESULTS_MATCH (DEFAULT)
    - Horde_Imap_Client\SEARCH_RESULTS_MAX
    - Horde_Imap_Client\SEARCH_RESULTS_MIN
    - Horde_Imap_Client\SEARCH_RESULTS_SAVE
    - Horde_Imap_Client\SEARCH_RESULTS_RELEVANCY
  - sequence: (boolean) If true, returns an array of sequence numbers.
              DEFAULT: Returns an array of UIDs
  - sort: (array) Sort the returned list of messages. Multiple sort
          criteria can be specified. Any sort criteria can be sorted in
          reverse order (instead of the default ascending order) by
          adding a Horde_Imap_Client\SORT_REVERSE element to the array
          directly before adding the sort element. The following sort
          criteria are available:
    - Horde_Imap_Client\SORT_ARRIVAL
    - Horde_Imap_Client\SORT_CC
    - Horde_Imap_Client\SORT_DATE
    - Horde_Imap_Client\SORT_DISPLAYFROM
      On servers that don't support SORT=DISPLAY, this criteria will
      fallback to doing client-side sorting.
    - Horde_Imap_Client\SORT_DISPLAYFROM_FALLBACK
      On servers that don't support SORT=DISPLAY, this criteria will
      fallback to Horde_Imap_Client\SORT_FROM [since 2.4.0].
    - Horde_Imap_Client\SORT_DISPLAYTO
      On servers that don't support SORT=DISPLAY, this criteria will
      fallback to doing client-side sorting.
    - Horde_Imap_Client\SORT_DISPLAYTO_FALLBACK
      On servers that don't support SORT=DISPLAY, this criteria will
      fallback to Horde_Imap_Client\SORT_TO [since 2.4.0].
    - Horde_Imap_Client\SORT_FROM
    - Horde_Imap_Client\SORT_SEQUENCE
    - Horde_Imap_Client\SORT_SIZE
    - Horde_Imap_Client\SORT_SUBJECT
    - Horde_Imap_Client\SORT_TO

    [On servers that support SEARCH=FUZZY, this criteria is also
    available:]
    - Horde_Imap_Client\SORT_RELEVANCY
Return values
arrayAn array with the following keys:
  - count: (integer) The number of messages that match the search
           criteria. Always returned.
  - match: (Horde_Imap_Client_Ids) The IDs that match $criteria, sorted
           if the 'sort' modifier was set. Returned if
           Horde_Imap_Client\SEARCH_RESULTS_MATCH is set.
  - max: (integer) The UID (default) or message sequence number (if
         'sequence' is true) of the highest message that satisifies
         $criteria. Returns null if no matches found. Returned if
         Horde_Imap_Client\SEARCH_RESULTS_MAX is set.
  - min: (integer) The UID (default) or message sequence number (if
         'sequence' is true) of the lowest message that satisifies
         $criteria. Returns null if no matches found. Returned if
         Horde_Imap_Client\SEARCH_RESULTS_MIN is set.
  - modseq: (integer) The highest mod-sequence for all messages being
           returned. Returned if 'sort' is false, the search query
           includes a MODSEQ command, and the server supports the
           CONDSTORE IMAP extension.
  - relevancy: (array) The list of relevancy scores. Returned if
               Horde_Imap_Client\SEARCH_RESULTS_RELEVANCY is set and
               the server supports FUZZY search matching.
  - save: (boolean) Whether the search results were saved. Returned if
          Horde_Imap_Client\SEARCH_RESULTS_SAVE is set.
Exceptions
Horde_Imap_Client_Exception

◆ sendID()

sendID ( $info = null)

Send ID information to the IMAP server (RFC 2971).

Parameters
array$infoOverrides the value of the 'id' param and sends this information instead.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ server()

server ( $msg)

Write server output to debug log.

Parameters
string$msgDebug message.

◆ set()

set ( $mailbox,
$data,
$uidvalid )
abstract

Store information in cache.

Store data in cache.

Parameters
string$mailboxAn IMAP mailbox string.
array$dataThe list of data to save. The keys are the UIDs, the values are an array of information to save. If empty, do a check to make sure the uidvalidity is still valid.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.
string$mailboxAn IMAP mailbox string.
array$dataThe list of data to save. The keys are the UIDs, the values are an array of information to save.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.

◆ setACL()

setACL ( $mailbox,
$identifier,
$options )

Set ACL rights for a given mailbox/identifier.

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
string$identifierThe identifier to alter (UTF-8).
array$optionsAdditional options:
  • rights: (string) The rights to alter or set.
  • action: (string, optional) If 'add' or 'remove', adds or removes the specified rights. Sets the rights otherwise.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ setBodyPart()

setBodyPart ( $id,
$text,
$decode = null )

Set a body part entry.

Parameters
string$idThe MIME ID.
mixed$textThe body part text, as either a string or stream resource.
string$decodeEither '8bit', 'binary', or null.

◆ setBodyPartSize()

setBodyPartSize ( $id,
$size )

Set the body part size for a body part.

Parameters
string$idThe MIME ID.
integer$sizeThe size (in bytes).

◆ setBodyText()

setBodyText ( $id,
$text )

Set a body text entry.

Parameters
string$idThe MIME ID.
mixed$textThe body part text, as either a string or stream resource.

◆ setCode()

setCode ( $code)

Allow the error code to be altered.

Parameters
integer$codeError code.

◆ setComparator()

setComparator ( $comparator = null)

Set the comparator to use for searching/sorting (RFC 5255).

Parameters
string$comparatorThe comparator string (see RFC 4790 [3.1] - "collation-id" - for format). The reserved string 'default' can be used to select the default comparator.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ setDowngraded()

setDowngraded ( $downgraded)

Set the internationalized downgraded status for the message.

Since
2.11.0
Parameters
boolean$downgradedTrue if at least one message component has been downgraded.

◆ setEnvelope()

setEnvelope ( $data)

Set envelope data.

Parameters
array$dataThe envelope data to pass to the Envelope object constructor, or an Envelope object.

◆ setFlags()

setFlags ( array $flags)

Set IMAP flags.

Parameters
array$flagsAn array of IMAP flags.

◆ setFullMsg()

setFullMsg ( $msg)

Set the full message property.

Parameters
mixed$msgThe full message text, as either a string or stream resource.

◆ setHeaders()

setHeaders ( $label,
$data )

Set a header entry.

Parameters
string$labelThe search label.
mixed$dataEither a Horde_Mime_Headers object or the raw header text.

◆ setHeaderText()

setHeaderText ( $id,
$text )

Set a header text entry.

Parameters
string$idThe MIME ID.
mixed$textThe header text, as either a string or stream resource.

◆ setImapDate()

setImapDate ( $date)

Set IMAP internal date.

Parameters
mixed$dateEither a Horde_Imap_Client_DateTime object or a date string.

◆ setLanguage()

setLanguage ( $langs = null)

Sets the preferred language for server response messages (RFC 5255).

Parameters
array$langsOverrides the value of the 'lang' param and sends this list of preferred languages instead. The special string 'i-default' can be used to restore the language to the server default.
Return values
stringThe language accepted by the server, or null if the default language is used.
Exceptions
Horde_Imap_Client_Exception

◆ setMessage()

setMessage ( $msg)

Allow the error message to be altered.

Parameters
string$msgError message.

◆ setMetaData() [1/2]

setMetaData ( $mailbox,
$data )
abstract

Set metadata information for a mailbox.

Parameters
string$mailboxAn IMAP mailbox string.
array$dataThe list of data to save. The keys are the metadata IDs, the values are the associated data. (If present, uidvalidity appears as the 'uidvalid' key in $data.)

◆ setMetaData() [2/2]

setMetaData ( $mailbox,
$uidvalid,
array $data = array() )

Set metadata information for a mailbox.

Parameters
string$mailboxAn IMAP mailbox string.
integer$uidvalidThe IMAP uidvalidity value of the mailbox.
array$dataThe list of data to save. The keys are the metadata IDs, the values are the associated data. The following labels are reserved: 'uidvalid'.

◆ setMetadata()

setMetadata ( $mailbox,
$data )

Set metadata for a given mailbox/identifier.

Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8). If empty, sets a server annotation.
array$dataA set of data values. The metadata values corresponding to the keys of the array will be set to the values in the array.
Exceptions
Horde_Imap_Client_Exception

◆ setMimeHeader()

setMimeHeader ( $id,
$text )

Set a MIME header entry.

Parameters
string$idThe MIME ID.
mixed$textThe header text, as either a string or stream resource.

◆ setModSeq()

setModSeq ( $modseq)

Set the modified sequence value for the message.

Parameters
integer$modseqThe modseq value.

◆ setParam()

setParam ( $key,
$val )

Sets a configuration parameter value.

Parameters
string$keyThe param key.
mixed$valThe param value.

◆ setParams()

setParams ( array $params = array())

Add configuration parameters.

Parameters
array$paramsConfiguration parameters.

◆ setQuota()

setQuota ( $root,
array $resources = array() )

Set quota limits.

The server must support the IMAP QUOTA extension (RFC 2087).

Parameters
mixed$rootThe quota root. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$resourcesThe resource values to set. Keys are the resource atom name; value is the resource value.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ setSeq()

setSeq ( $seq)

Set message sequence number.

Parameters
integer$seqThe message sequence number.

◆ setSize()

setSize ( $size)

Set message size.

Parameters
integer$sizeThe size of the message, in bytes.

◆ setStatus()

setStatus ( $entry,
$value )

Set status information for the mailbox.

Parameters
integer$entrySTATUS_* constant.
mixed$valueStatus information.

◆ setStructure()

setStructure ( Horde_Mime_Part $structure)

Set the message structure.

Parameters
Horde_Mime_Part$structureThe base MIME part of the message.

◆ setUid()

setUid ( $uid)

Set UID.

Parameters
integer$uidThe message UID.

◆ setValid()

setValid ( $charset,
$valid = true )

Set the validity of a given charset.

Parameters
string$charsetThe charset.
boolean$validIs charset valid?

◆ shutdown()

shutdown ( )

Shutdown actions.

Shutdown function.

◆ size()

size ( $size,
$larger = false,
$not = false,
array $opts = array() )

Search for messages smaller/larger than a certain size.

Todo
: Remove $not for 3.0
Parameters
integer$sizeThe size (in bytes).
boolean$largerSearch for messages larger than $size?
boolean$notIf true, do a 'NOT' search of $text.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ sort() [1/2]

sort ( )

Sorts the IDs.

Sort the map.

◆ sort() [2/2]

sort ( array $opts = array())

Sort the list of mailboxes.

Parameters
array$optsOptions:
  • delimiter: (string) The delimiter to use. DEFAULT: '.'
  • inbox: (boolean) Always put INBOX at the head of the list? DEFAULT: Yes
  • noupdate: (boolean) Do not update the object's mailbox list? DEFAULT: true
Return values
arrayList of sorted mailboxes (index association is kept).

◆ split()

split ( $length)

Split the sequence string at an approximate length.

Since
2.7.0
Parameters
integer$lengthLength to split.
Return values
arrayA list containing individual sequence strings.

◆ status()

status ( $mailbox,
$flags = Horde_Imap_Client::STATUS_ALL,
array $opts = array() )

Obtain status information for a mailbox.

Parameters
mixed$mailboxThe mailbox(es) to query. Either a Horde_Imap_Client_Mailbox object, a string (UTF-8), or an array of objects/strings (since 2.10.0).
integer$flagsA bitmask of information requested from the server. Allowed flags:
  - Horde_Imap_Client\STATUS_MESSAGES
    Return key: messages
    Return format: (integer) The number of messages in the mailbox.

  - Horde_Imap_Client\STATUS_RECENT
    Return key: recent
    Return format: (integer) The number of messages with the Recent
                   flag set as currently reported in the mailbox

  - Horde_Imap_Client\STATUS_RECENT_TOTAL
    Return key: recent_total
    Return format: (integer) The number of messages with the Recent
                   flag set. This returns the total number of messages
                   that have been marked as recent in this mailbox
                   since the PHP process began. (since 2.12.0)

  - Horde_Imap_Client\STATUS_UIDNEXT
    Return key: uidnext
    Return format: (integer) The next UID to be assigned in the
                   mailbox. Only returned if the server automatically
                   provides the data.

  - Horde_Imap_Client\STATUS_UIDNEXT_FORCE
    Return key: uidnext
    Return format: (integer) The next UID to be assigned in the
                   mailbox. This option will always determine this
                   value, even if the server does not automatically
                   provide this data.

  - Horde_Imap_Client\STATUS_UIDVALIDITY
    Return key: uidvalidity
    Return format: (integer) The unique identifier validity of the
                   mailbox.

  - Horde_Imap_Client\STATUS_UNSEEN
    Return key: unseen
    Return format: (integer) The number of messages which do not have
                   the Seen flag set.

  - Horde_Imap_Client\STATUS_FIRSTUNSEEN
    Return key: firstunseen
    Return format: (integer) The sequence number of the first unseen
                   message in the mailbox.

  - Horde_Imap_Client\STATUS_FLAGS
    Return key: flags
    Return format: (array) The list of defined flags in the mailbox
                   (all flags are in lowercase).

  - Horde_Imap_Client\STATUS_PERMFLAGS
    Return key: permflags
    Return format: (array) The list of flags that a client can change
                   permanently (all flags are in lowercase).

  - Horde_Imap_Client\STATUS_HIGHESTMODSEQ
    Return key: highestmodseq
    Return format: (integer) If the server supports the CONDSTORE
                   IMAP extension, this will be the highest
                   mod-sequence value of all messages in the mailbox.
                   Else 0 if CONDSTORE not available or the mailbox
                   does not support mod-sequences.

  - Horde_Imap_Client\STATUS_SYNCMODSEQ
    Return key: syncmodseq
    Return format: (integer) If caching, and the server supports the
                   CONDSTORE IMAP extension, this is the cached
                   mod-sequence value of the mailbox when it was opened
                   for the first time in this access. Will be null if
                   not caching, CONDSTORE not available, or the mailbox
                   does not support mod-sequences.

  - Horde_Imap_Client\STATUS_SYNCFLAGUIDS
    Return key: syncflaguids
    Return format: (Horde_Imap_Client_Ids) If caching, the server
                   supports the CONDSTORE IMAP extension, and the
                   mailbox contained cached data when opened for the
                   first time in this access, this is the list of UIDs
                   in which flags have changed since STATUS_SYNCMODSEQ.

  - Horde_Imap_Client\STATUS_SYNCVANISHED
    Return key: syncvanished
    Return format: (Horde_Imap_Client_Ids) If caching, the server
                   supports the CONDSTORE IMAP extension, and the
                   mailbox contained cached data when opened for the
                   first time in this access, this is the list of UIDs
                   which have been deleted since STATUS_SYNCMODSEQ.

  - Horde_Imap_Client\STATUS_UIDNOTSTICKY
    Return key: uidnotsticky
    Return format: (boolean) If the server supports the UIDPLUS IMAP
                   extension, and the queried mailbox does not support
                   persistent UIDs, this value will be true. In all
                   other cases, this value will be false.

  - Horde_Imap_Client\STATUS_FORCE_REFRESH
    Normally, the status information will be cached for a given
    mailbox. Since most PHP requests are generally less than a second,
    this is fine. However, if your script is long running, the status
    information may not be up-to-date. Specifying this flag will ensure
    that the server is always polled for the current mailbox status
    before results are returned. (since 2.14.0)

  - Horde_Imap_Client\STATUS_ALL (DEFAULT)
    Shortcut to return 'messages', 'recent', 'uidnext', 'uidvalidity',
    and 'unseen' values.

array$opts
    Additional options:
  - sort: (boolean) If true, sort the list of mailboxes? (since 2.10.0)
          DEFAULT: Do not sort the list.
  - sort_delimiter: (string) If 'sort' is true, this is the delimiter
                    used to sort the mailboxes. (since 2.10.0)
                    DEFAULT: '.'
Return values
array
 If $mailbox contains multiple mailboxes, an array with
               keys being the UTF-8 mailbox name and values as arrays
               containing the requested keys (see above).
               Otherwise, an array with keys as the requested keys (see
               above) and values as the key data.
Exceptions
Horde_Imap_Client_Exception

◆ statusMultiple()

statusMultiple ( $mailboxes,
$flags = Horde_Imap_Client::STATUS_ALL,
array $opts = array() )

Perform a STATUS call on multiple mailboxes at the same time.

This method leverages the LIST-EXTENDED and LIST-STATUS extensions on the IMAP server to improve the efficiency of this operation.

Deprecated
Use status() instead.
Parameters
array$mailboxesThe mailboxes to query. Either Horde_Imap_Client_Mailbox objects, strings (UTF-8), or a combination of the two.
integer$flagsSee status().
array$optsAdditional options:
  • sort: (boolean) If true, sort the list of mailboxes? DEFAULT: Do not sort the list.
  • sort_delimiter: (string) If 'sort' is true, this is the delimiter used to sort the mailboxes. DEFAULT: '.'
Return values
arrayAn array with the keys as the mailbox names (UTF-8) and the values as arrays with the requested keys (from the mask given in $flags).

◆ store()

store ( $mailbox,
array $options = array() )

Store message flag data (see RFC 3501 [6.4.6]).

Parameters
mixed$mailboxThe mailbox containing the messages to modify. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$optionsAdditional options:
  • add: (array) An array of flags to add. DEFAULT: No flags added.
  • ids: (Horde_Imap_Client_Ids) The list of messages to modify. DEFAULT: All messages in $mailbox will be modified.
  • remove: (array) An array of flags to remove. DEFAULT: No flags removed.
  • replace: (array) Replace the current flags with this set of flags. Overrides both the 'add' and 'remove' options. DEFAULT: No replace is performed.
  • unchangedsince: (integer) Only changes flags if the mod-sequence ID of the message is equal or less than this value. Requires the CONDSTORE IMAP extension on the server. Also requires the mailbox to support mod-sequences. Will throw an exception if either condition is not met. DEFAULT: mod-sequence is ignored when applying changes
Return values
Horde_Imap_Client_IdsA Horde_Imap_Client_Ids object containing the list of IDs that failed the 'unchangedsince' test.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_NoSupportExtension

◆ stripNamespace()

stripNamespace ( $mbox)

Strips namespace information from the given mailbox name.

Parameters
string$mboxMailbox name.
Return values
stringMailbox name with namespace prefix stripped.

◆ stripNonAtomCharacters()

stripNonAtomCharacters ( )

Strip out any characters that are not allowed in an IMAP atom.

Return values
stringThe atom data disallowed characters removed.

◆ subscribeMailbox()

subscribeMailbox ( $mailbox,
$subscribe = true )

Manage subscription status for a mailbox.

Parameters
mixed$mailboxThe mailbox to [un]subscribe to. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
boolean$subscribeTrue to subscribe, false to unsubscribe.
Exceptions
Horde_Imap_Client_Exception

◆ sync()

sync ( $mailbox,
$token,
array $opts = array() )

Synchronize a mailbox from a sync token.

Since
2.2.0
Parameters
mixed$mailboxA mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
string$tokenA sync token generated by getSyncToken().
array$optsAdditional options:
  • criteria: (integer) Mask of Horde_Imap_Client\SYNC_* criteria to return. Defaults to SYNC_ALL.
  • ids: (Horde_Imap_Client_Ids) A cached list of UIDs. Unless QRESYNC is available on the server, failure to specify this option means SYNC_VANISHEDUIDS information cannot be returned.
Return values
Horde_Imap_Client_Data_SyncA sync object.
Exceptions
Horde_Imap_Client_Exception
Horde_Imap_Client_Exception_Sync

◆ text()

text ( $text,
$bodyonly = true,
$not = false,
array $opts = array() )

Search for text in either the entire message, or just the body.

Parameters
string$textThe search text.
boolean$bodyonlyIf true, only search in the body of the message. If false, also search in the headers.
boolean$notIf true, do a 'NOT' search of $text.
array$optsAdditional options:
  • fuzzy: (boolean) If true, perform a fuzzy search. The IMAP server MUST support RFC 6203.

◆ thread()

thread ( $mailbox,
array $options = array() )

Thread sort a given list of messages (RFC 5256).

Parameters
mixed$mailboxThe mailbox to query. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
array$optionsAdditional options:
  - criteria: (mixed) The following thread criteria are available:
    - Horde_Imap_Client\THREAD_ORDEREDSUBJECT
    - Horde_Imap_Client\THREAD_REFERENCES
    - Horde_Imap_Client\THREAD_REFS
      Other algorithms can be explicitly specified by passing the IMAP
      thread algorithm in as a string value.
    DEFAULT: Horde_Imap_Client\THREAD_ORDEREDSUBJECT
  - search: (Horde_Imap_Client_Search_Query) The search query.
            DEFAULT: All messages in mailbox included in thread sort.
  - sequence: (boolean) If true, each message is stored and referred to
              by its message sequence number.
              DEFAULT: Stored/referred to by UID.
Return values
Horde_Imap_Client_Data_ThreadA thread data object.
Exceptions
Horde_Imap_Client_Exception

◆ threadOrderedSubject()

threadOrderedSubject ( Horde_Imap_Client_Fetch_Results $data,
$uids )

If server does not support the THREAD IMAP extension (RFC 5256), do ORDEREDSUBJECT threading on the client side.

Parameters
Horde_Imap_Client_Fetch_Results$dataFetch results.
boolean$uidsAre IDs UIDs?
Return values
arrayThe thread sort results.

◆ toArray()

toArray ( )

Returns the raw data.

Deprecated
Return values
arrayCapability data.

◆ update()

update ( $ids)

Updates the mapping.

Parameters
array$idsArray of sequence -> UID mapping.
Return values
booleanTrue if the mapping changed.

◆ Utf7ImapToUtf8()

static Utf7ImapToUtf8 ( $str)
static

Convert a string from UTF7-IMAP to UTF-8.

Parameters
string$strThe UTF7-IMAP string.
Return values
stringThe converted UTF-8 string.
Exceptions
Horde_Imap_Client_Exception

◆ Utf8ToUtf7Imap()

static Utf8ToUtf7Imap ( $str,
$force = true )
static

Convert a string from UTF-8 to UTF7-IMAP.

Parameters
string$strThe UTF-8 string.
boolean$forceAssume $str is UTF-8 (no-autodetection)? If false, attempts to auto-detect if string is already in UTF7-IMAP.
Return values
stringThe converted UTF7-IMAP string.
Exceptions
Horde_Imap_Client_Exception

◆ validSearchCharset()

validSearchCharset ( $charset)

Determines if the given charset is valid for search-related queries.

This check pertains just to the basic IMAP SEARCH command.

Deprecated
Use $search_charset property instead.
Parameters
string$charsetThe query charset.
Return values
booleanTrue if server supports this charset.

◆ vanished()

vanished ( $mailbox,
$modseq,
array $opts = array() )

Get the list of vanished messages (UIDs that have been expunged since a given mod-sequence value).

Parameters
mixed$mailboxThe mailbox to query. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
integer$modseqSearch for expunged messages after this mod-sequence value.
array$optsAdditional options:
  • ids: (Horde_Imap_Client_Ids) Restrict to these UIDs. DEFAULT: Returns full list of UIDs vanished (QRESYNC only). This option is REQUIRED for non-QRESYNC servers or else an empty list will be returned.
Return values
Horde_Imap_Client_IdsList of UIDs that have vanished.
Exceptions
Horde_Imap_Client_NoSupportExtension

◆ verify()

verify ( )

Verify the data.

Exceptions
Horde_Imap_Client_Data_Format_Exception

◆ write()

write ( $data,
$eol = true )

Writes data to the POP3 output stream.

Writes data to the IMAP output stream.

Parameters
string$dataString data.
boolean$debugOutput line to debug?
Exceptions
Horde_Imap_Client_Exception
Parameters
string$dataString data.
boolean$eolAppend EOL?
Exceptions
Horde_Imap_Client_Exception

◆ writeLiteral()

writeLiteral ( $data,
$length,
$binary = false )

Writes literal data to the IMAP output stream.

Parameters
mixed$dataEither a stream resource, or Horde_Stream object.
integer$lengthThe literal length.
boolean$binaryIf true, this is binary data.
Exceptions
Horde_Imap_Client_Exception

Variable Documentation

◆ $_charset

string $_charset = null
protected

The charset of the search strings.

All text strings must be in this charset. By default, this is 'US-ASCII' (see RFC 3501 [6.4.4]).

◆ $_charsets

array $_charsets
protected
Initial value:
= array(
'US-ASCII' => true
)

Charset data.

◆ $_data [1/2]

array $_data = array()
protected

The working data for the current pageload.

All changes take place to this data.

◆ $_data [2/2]

array $_data = array()
protected

The working data for the current pageload.

All changes take place to this data.

◆ $_defaultPorts

array $_defaultPorts = array()
protected

The default ports to use for a connection.

First element is non-secure, second is SSL.

◆ $_indices

array $_indices
protected
Initial value:
= array(
self::BASE => array(
'base_index_1' => array(
self::BASE_HOSTSPEC => 1,
self::BASE_MAILBOX => 1,
self::BASE_PORT => 1,
self::BASE_USERNAME => 1,
)
),
self::MSG => array(
'msg_index_1' => array(
self::MSG_MSGUID => 1,
self::MSG_UID => 1
)
)
)

The list of indices.

◆ $_params

array $_params = array()
protected

Hash containing connection parameters.

This hash never changes.

◆ $_statusFields

array $_statusFields
protected
Initial value:
= array(
'messages' => Horde_Imap_Client::STATUS_MESSAGES,
'recent' => Horde_Imap_Client::STATUS_RECENT,
'uidnext' => Horde_Imap_Client::STATUS_UIDNEXT,
'uidvalidity' => Horde_Imap_Client::STATUS_UIDVALIDITY,
'unseen' => Horde_Imap_Client::STATUS_UNSEEN,
'firstunseen' => Horde_Imap_Client::STATUS_FIRSTUNSEEN,
'flags' => Horde_Imap_Client::STATUS_FLAGS,
'permflags' => Horde_Imap_Client::STATUS_PERMFLAGS,
'uidnotsticky' => Horde_Imap_Client::STATUS_UIDNOTSTICKY,
'highestmodseq' => Horde_Imap_Client::STATUS_HIGHESTMODSEQ
)

Mapping of status fields to IMAP names.

◆ $_update [1/2]

array $_update = array()
protected

The list of items to update:

  • add: (array) List of IDs that were added.
  • slice: (array) List of slices that were modified.
  • slicemap: (boolean) Was slicemap info changed?

◆ $_update [2/2]

array $_update = array()
protected

List of mailbox/UIDs to update.

Keys are mailboxes. Values are arrays with three possible keys:

  - d: UIDs to delete
  - m: Was metadata updated?
  - u: UIDs to update

◆ $_virtual

array $_virtual
protected
Initial value:
= array(
Horde_Imap_Client::ACL_CREATE => array(
Horde_Imap_Client::ACL_CREATEMBOX,
Horde_Imap_Client::ACL_DELETEMBOX
),
Horde_Imap_Client::ACL_DELETE => array(
Horde_Imap_Client::ACL_DELETEMSGS,
Horde_Imap_Client::ACL_DELETEMBOX,
Horde_Imap_Client::ACL_EXPUNGE
)
)

List of virtual rights (RFC 4314 [2.1.1]).

◆ $cacheFields

array $cacheFields
Initial value:
= array(
Horde_Imap_Client::FETCH_ENVELOPE => 'HICenv',
Horde_Imap_Client::FETCH_FLAGS => 'HICflags',
Horde_Imap_Client::FETCH_HEADERS => 'HIChdrs',
Horde_Imap_Client::FETCH_IMAPDATE => 'HICdate',
Horde_Imap_Client::FETCH_SIZE => 'HICsize',
Horde_Imap_Client::FETCH_STRUCTURE => 'HICstruct'
)

The list of fetch fields that can be cached, and their cache names.

◆ $capability_deps

array $capability_deps
static
Initial value:
= array(
'QRESYNC' => array(
'ENABLE'
),
'SEARCHRES' => array(
'ESEARCH'
),
'LANGUAGE' => array(
'NAMESPACE'
),
'SORT=DISPLAY' => array(
'SORT'
)
)

Capability dependencies.

Deprecated

◆ $highestmodseq

integer $highestmodseq = null

The previous value of HIGHESTMODSEQ.

Since
2.8.0

◆ $mailbox

string $mailbox = null

The IMAP mailbox.

Todo
Make this a Horde_Imap_Client_Mailbox object.

◆ $messages

integer $messages = null

The previous number of messages in the mailbox.

Since
2.8.0

◆ $on_error

callback $on_error = null

A callback to run on error.

If callback returns true, the command will be treated as successful.

Since
2.24.0

◆ $on_success

callback $on_success = null

A callback to run on success.

Since
2.28.0

◆ $pipeline

Horde_Imap_Client_Interaction_Pipeline $pipeline

Pipeline object associated with this command.

Since
2.28.0

◆ $protocol

string $protocol = null

The protocol type.

Either 'imap' or 'pop' (not present for relative URLs).

◆ $raw_msg

string $raw_msg = ''

Raw error message (in English).

Since
2.18.0

◆ $responseCode

object $responseCode = null

Response code (RFC 3501 [7.1]).

Properties:

  • code: (string) Response code.
  • data: (array) Data associated with response.

◆ $statuscache

boolean $statuscache = true

Horde_Imap_Client is optimized for short (i.e.

1 seconds) scripts. It makes heavy use of mailbox caching to save on server accesses. This property should be set to false for long-running scripts, or else status() data may not reflect the current state of the mailbox on the server.

Since
2.14.0

◆ $uidnext

integer $uidnext = null

The previous value of UIDNEXT.

Since
2.8.0

◆ $uidvalid

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see $uidvalid
Initial value:
{
return array()

◆ $uidvalidity

integer $uidvalidity = null

The previous value of UIDVALIDITY.

Since
2.8.0

◆ $vanished

Horde_Imap_Client_Ids $vanished = null

The UIDs of messages that are guaranteed to have vanished.

This list is only guaranteed to be available if the server supports QRESYNC or a list of known UIDs is passed to the sync() method.

◆ CACHE_DOWNGRADED

const CACHE_DOWNGRADED = 'HICdg'

Cache names used exclusively within this class.

Since
2.11.0

◆ else

else
Initial value:
{
parent::__construct($data)

◆ INUSE

const INUSE = 18

The operation was not successful because another user is holding a necessary resource.

The operation may succeed if attempted later.

◆ Iterator

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see Iterator
Initial value:
{
protected array $_data = array()
array $_data
The working data for the current pageload.
Definition Cache.php:43

◆ IteratorAggregate [1/4]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see IteratorAggregate
Initial value:
{
const SEQUENCE = 1

◆ IteratorAggregate [2/4]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see IteratorAggregate
Initial value:
{
public array $data = array(
'modseqs' => array(),
'modseqs_nouid' => array()
)

◆ IteratorAggregate [3/4]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see IteratorAggregate
Initial value:
{
protected string $_delimiter

◆ IteratorAggregate [4/4]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see IteratorAggregate
Initial value:
{
protected array $_ns = array()

◆ METADATA_MAXSIZE

const METADATA_MAXSIZE = 24

Setting metadata failed because the size of its value is too large.

The maximum octet count the server is willing to accept will be in the exception message string.

◆ POP3_TEMP_ERROR

const POP3_TEMP_ERROR = 300

Temporary issue.

Generally, there is no need to alarm the user for errors of this type.

◆ Serializable [1/5]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see Serializable
Initial value:
{
protected array $_rights

◆ Serializable [2/5]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see Serializable
Initial value:
{
protected array $_optional = array()

◆ Serializable [3/5]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see Serializable
Initial value:
{
protected array $_thread = array()

◆ Serializable [4/5]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see Serializable
Initial value:
{
const ALL = "\01"

◆ Serializable [5/5]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see Serializable
Initial value:
{
protected array $_ids = array()
mixed $_ids
List of IDs.
Definition Ids.php:62

◆ SplObserver

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see SplObserver
Initial value:
{
const VERSION = 3

◆ SplSubject [1/2]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see SplSubject
Initial value:
{
protected array $_data = array()

◆ SplSubject [2/2]

*See the enclosed file LICENSE for license information (LGPL). If you *did not receive this file see SplSubject
Initial value:
{
protected Horde_Imap_Client_Base $_baseob