PHP Class Horde_Imap_Client_Socket, horde

Implements the following IMAP-related RFCs (see http://www.iana.org/assignments/imap4-capabilities): - RFC 2086/4314: ACL - RFC 2087: QUOTA - RFC 2088: LITERAL+ - RFC 2195: AUTH=CRAM-MD5 - RFC 2221: LOGIN-REFERRALS - RFC 2342: NAMESPACE - RFC 2595/4616: TLS & AUTH=PLAIN - RFC 2831: DIGEST-MD5 authentication mechanism (obsoleted by RFC 6331) - RFC 2971: ID - RFC 3348: CHILDREN - RFC 3501: IMAP4rev1 specification - RFC 3502: MULTIAPPEND - RFC 3516: BINARY - RFC 3691: UNSELECT - RFC 4315: UIDPLUS - RFC 4422: SASL Authentication (for DIGEST-MD5) - RFC 4466: Collected extensions (updates RFCs 2088, 3501, 3502, 3516) - RFC 4469/5550: CATENATE - RFC 4551: CONDSTORE - RFC 4731: ESEARCH - RFC 4959: SASL-IR - RFC 5032: WITHIN - RFC 5161: ENABLE - RFC 5162: QRESYNC - RFC 5182: SEARCHRES - RFC 5255: LANGUAGE/I18NLEVEL - RFC 5256: THREAD/SORT - RFC 5258: LIST-EXTENDED - RFC 5267: ESORT; PARTIAL search return option - RFC 5464: METADATA - RFC 5530: IMAP Response Codes - RFC 5819: LIST-STATUS - RFC 5957: SORT=DISPLAY - RFC 6154: SPECIAL-USE/CREATE-SPECIAL-USE - RFC 6203: SEARCH=FUZZY Implements the following non-RFC extensions:
  • draft-ietf-morg-inthread-01: THREAD=REFS
  • draft-daboo-imap-annotatemore-07: ANNOTATEMORE
  • draft-daboo-imap-annotatemore-08: ANNOTATEMORE2
  • XIMAPPROXY
    • Requires imapproxy v1.2.7-rc1 or later
    • See https://squirrelmail.svn.sourceforge.net/svnroot/squirrelmail/trunk/imap_proxy/README
TODO (or not necessary?):
  • RFC 2177: IDLE
    • Probably not necessary due to the limited connection time of each HTTP/PHP request
  • RFC 2193: MAILBOX-REFERRALS
  • RFC 4467/5092/5524/5550/5593: URLAUTH, URLAUTH=BINARY, URL-PARTIAL
  • RFC 4978: COMPRESS=DEFLATE
    • See: http://bugs.php.net/bug.php?id=48725
  • RFC 5257: ANNOTATE (Experimental)
  • RFC 5259: CONVERT
  • RFC 5267: CONTEXT=SEARCH; CONTEXT=SORT
  • RFC 5465: NOTIFY
  • RFC 5466: FILTERS
  • RFC 5738: UTF8 (Very limited support currently)
  • RFC 6237: MULTISEARCH
  • draft-ietf-morg-inthread-01: SEARCH=INTHREAD
    • Appears to be dead
  • draft-krecicki-imap-move-01.txt: MOVE
    • Appears to be dead
Originally based on code from: - auth.php (1.49) - imap_general.php (1.212) - imap_messages.php (revision 13038) - strings.php (1.184.2.35) from the Squirrelmail project. Copyright (c) 1999-2007 The SquirrelMail Project Team Copyright 2005-2012 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Michael Slusarz ([email protected])
Inheritance: extends Horde_Imap_Client_Base
Datei anzeigen Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_cmdQueue array Queued commands to send to the server.
$_defaultPorts array The default ports to use for a connection.
$_statusFields array Mapping of status fields to IMAP names.
$_tag integer The unique tag to use when making an IMAP query.

Public Methods

Method Description
__construct ( array $params = [] )
__get ( $name )
getParam ( $key )
update ( SplSubject $subject )

Protected Methods

Method Description
_append ( Horde_Imap_Client_Mailbox $mailbox, $data, $options )
_appendData ( mixed $data, &$asize ) : Horde_Imap_Client_Data_Format_String_Nonascii Prepares append message data for insertion into the IMAP command string.
_authInitialResponse ( string $method, string $ir, string $username = null ) : Horde_Imap_Client_Interaction_Command Create the AUTHENTICATE command for the initial client response.
_check ( )
_close ( $options )
_command ( string $cmd ) : Horde_Imap_Client_Interaction_Command Shortcut to creating a new IMAP client command object.
_connect ( ) Connects to the IMAP server.
_convertCatenateUrl ( string $url ) : resource Converts a CATENATE URL to stream data.
_copy ( Horde_Imap_Client_Mailbox $dest, $options )
_createMailbox ( Horde_Imap_Client_Mailbox $mailbox, $opts )
_deleteACL ( Horde_Imap_Client_Mailbox $mailbox, $identifier )
_deleteMailbox ( Horde_Imap_Client_Mailbox $mailbox )
_deleteMsgs ( Horde_Imap_Client_Mailbox $mailbox, Horde_Imap_Client_Ids $ids, array $opts = [] )
_enable ( array $exts ) Enable an IMAP extension (see RFC 5161).
_expunge ( $options )
_fetch ( Horde_Imap_Client_Fetch_Results $results, $queries )
_fetchCmd ( Horde_Imap_Client_Interaction_Pipeline $pipeline, array $options ) Add a FETCH command to the given pipeline.
_getACL ( Horde_Imap_Client_Mailbox $mailbox )
_getAnnotateMoreEntry ( string $name ) : array Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.
_getComparator ( )
_getID ( )
_getLanguage ( $list )
_getLine ( Horde_Imap_Client_Interaction_Pipeline $pipeline ) : Horde_Imap_Client_Interaction_Server Gets data from the IMAP server stream and parses it.
_getMailboxList ( array $pattern, integer $mode, array $options, array $subscribed = null ) : array Obtain a list of mailboxes.
_getMboxFormatOb ( string $mailbox, boolean $list = false ) : Horde_Imap_Client_Data_Format_Mailbox Return the proper mailbox format object based on the server's capabilities.
_getMetadata ( Horde_Imap_Client_Mailbox $mailbox, $entries, $options )
_getMyACLRights ( Horde_Imap_Client_Mailbox $mailbox )
_getNamespaces ( )
_getQuota ( Horde_Imap_Client_Mailbox $root )
_getQuotaRoot ( Horde_Imap_Client_Mailbox $mailbox )
_initCapability ( )
_listACLRights ( Horde_Imap_Client_Mailbox $mailbox, $identifier )
_listMailboxes ( $pattern, $mode, $options )
_login ( )
_loginTasks ( boolean $firstlogin = true, array $resp = [] ) : boolean Perform login tasks.
_logout ( )
_noop ( )
_openMailbox ( Horde_Imap_Client_Mailbox $mailbox, $mode )
_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 ) : Horde_Mime_Part Recursively parse BODYSTRUCTURE data from a FETCH return (see RFC 3501 [7.4.2]).
_parseCapability ( Horde_Imap_Client_Interaction_Pipeline $pipeline, array $data ) Parse a CAPABILITY Response (RFC 3501 [7.2.1]).
_parseComparator ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $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 ) : Horde_Imap_Client_Data_Envelope 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, integer $id, Horde_Imap_Client_Tokenize $data ) 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.
_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]).
_parseSearch ( Horde_Imap_Client_Interaction_Pipeline $pipeline, array $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 ( mixed $data ) : array 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 ( array &$thread, Horde_Imap_Client_Tokenize $data, integer $level ) Parse a level of a THREAD response (RFC 5256 [4]).
_parseVanished ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data ) Parse a VANISHED response (RFC 7162 [3.2.10]).
_partialAtom ( array $opts ) : string Add a partial atom to an IMAP command based on the criteria options.
_pipeline ( Horde_Imap_Client_Interaction_Command $cmd = null ) : Horde_Imap_Client_Interaction_Pipeline Shortcut to creating a new pipeline object.
_prepareStatusResponse ( array $request, string $mailbox ) Prepares a status response for a mailbox.
_processCmd ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Interaction_Command $cmd, Horde_Imap_Client_Data_Format_List $data ) : boolean Process/send a command to the remote server.
_processCmdContinuation ( Horde_Imap_Client_Interaction_Pipeline $pipeline, boolean $noexception = false ) : mixed Process a command continuation response.
_renameMailbox ( Horde_Imap_Client_Mailbox $old, Horde_Imap_Client_Mailbox $new )
_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. This driver supports all IMAP4rev1 search criteria as defined in RFC 3501.
_sendCmd ( mixed $cmd ) : Horde_Imap_Client_Interaction_Pipeline Sends command(s) to the IMAP server. A connection to the server must have already been made.
_sendCmdChunk ( Horde_Imap_Client_Interaction_Pipeline $pipeline, array $chunk ) Send a chunk of commands and/or continuation fragments to the server.
_sendID ( $info )
_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 )
_setComparator ( $comparator )
_setLanguage ( $langs )
_setMetadata ( Horde_Imap_Client_Mailbox $mailbox, $data )
_setQuota ( Horde_Imap_Client_Mailbox $root, $resources )
_status ( $mboxes, $flags )
_store ( $options )
_storeCmd ( array $options ) : Horde_Imap_Client_Interaction_Pipeline Create a store command.
_subscribeMailbox ( Horde_Imap_Client_Mailbox $mailbox, $subscribe )
_thread ( $options )
_tryLogin ( string $method ) : Horde_Imap_Client_Interaction_Pipeline Authenticate to the IMAP server.
_vanished ( $modseq, Horde_Imap_Client_Ids $ids )

Method Details

__construct() public method

public __construct ( array $params = [] )
$params array A 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).

__get() public method

public __get ( $name )

_append() protected method

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

_appendData() protected method

Prepares append message data for insertion into the IMAP command string.
protected _appendData ( mixed $data, &$asize ) : Horde_Imap_Client_Data_Format_String_Nonascii
$data mixed Either a resource or a string.
return Horde_Imap_Client_Data_Format_String_Nonascii The data object.

_authInitialResponse() protected method

Create the AUTHENTICATE command for the initial client response.
protected _authInitialResponse ( string $method, string $ir, string $username = null ) : Horde_Imap_Client_Interaction_Command
$method string AUTHENTICATE SASL method.
$ir string Initial client response.
$username string If set, log a username message in debug log instead of raw data.
return Horde_Imap_Client_Interaction_Command A command object.

_check() protected method

protected _check ( )

_close() protected method

protected _close ( $options )

_command() protected method

Shortcut to creating a new IMAP client command object.
protected _command ( string $cmd ) : Horde_Imap_Client_Interaction_Command
$cmd string The IMAP command.
return Horde_Imap_Client_Interaction_Command A command object.

_connect() protected method

Connects to the IMAP server.
protected _connect ( )

_convertCatenateUrl() protected method

Converts a CATENATE URL to stream data.
protected _convertCatenateUrl ( string $url ) : resource
$url string The CATENATE URL.
return resource A stream containing the data.

_copy() protected method

protected _copy ( Horde_Imap_Client_Mailbox $dest, $options )
$dest Horde_Imap_Client_Mailbox

_createMailbox() protected method

protected _createMailbox ( Horde_Imap_Client_Mailbox $mailbox, $opts )
$mailbox Horde_Imap_Client_Mailbox

_deleteACL() protected method

protected _deleteACL ( Horde_Imap_Client_Mailbox $mailbox, $identifier )
$mailbox Horde_Imap_Client_Mailbox

_deleteMailbox() protected method

protected _deleteMailbox ( Horde_Imap_Client_Mailbox $mailbox )
$mailbox Horde_Imap_Client_Mailbox

_deleteMsgs() protected method

protected _deleteMsgs ( Horde_Imap_Client_Mailbox $mailbox, Horde_Imap_Client_Ids $ids, array $opts = [] )
$mailbox Horde_Imap_Client_Mailbox
$ids Horde_Imap_Client_Ids
$opts array Options: - decrement: (boolean) If true, decrement the message count. - pipeline: (Horde_Imap_Client_Interaction_Pipeline) Pipeline object.

_enable() protected method

Enable an IMAP extension (see RFC 5161).
protected _enable ( array $exts )
$exts array The extensions to enable.

_expunge() protected method

protected _expunge ( $options )

_fetch() protected method

protected _fetch ( Horde_Imap_Client_Fetch_Results $results, $queries )
$results Horde_Imap_Client_Fetch_Results

_fetchCmd() protected method

Add a FETCH command to the given pipeline.
protected _fetchCmd ( Horde_Imap_Client_Interaction_Pipeline $pipeline, array $options )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$options array Fetch query options

_getACL() protected method

protected _getACL ( Horde_Imap_Client_Mailbox $mailbox )
$mailbox Horde_Imap_Client_Mailbox

_getAnnotateMoreEntry() protected method

Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.
protected _getAnnotateMoreEntry ( string $name ) : array
$name string A name for a metadata entry.
return array A list of two elements: The entry name and the value type.

_getComparator() protected method

protected _getComparator ( )

_getID() protected method

protected _getID ( )

_getLanguage() protected method

protected _getLanguage ( $list )

_getLine() protected method

Gets data from the IMAP server stream and parses it.
protected _getLine ( Horde_Imap_Client_Interaction_Pipeline $pipeline ) : Horde_Imap_Client_Interaction_Server
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
return Horde_Imap_Client_Interaction_Server Server object.

_getMailboxList() protected method

Obtain a list of mailboxes.
protected _getMailboxList ( array $pattern, integer $mode, array $options, array $subscribed = null ) : array
$pattern array The mailbox search pattern(s).
$mode integer Which mailboxes to return.
$options array Additional options. 'no_listext' will skip using the LIST-EXTENDED capability.
$subscribed array A list of subscribed mailboxes.
return array See listMailboxes(().

_getMboxFormatOb() protected method

Return the proper mailbox format object based on the server's capabilities.
protected _getMboxFormatOb ( string $mailbox, boolean $list = false ) : Horde_Imap_Client_Data_Format_Mailbox
$mailbox string The mailbox.
$list boolean Is this object used in a LIST command?
return Horde_Imap_Client_Data_Format_Mailbox A mailbox format object.

_getMetadata() protected method

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

_getMyACLRights() protected method

protected _getMyACLRights ( Horde_Imap_Client_Mailbox $mailbox )
$mailbox Horde_Imap_Client_Mailbox

_getNamespaces() protected method

protected _getNamespaces ( )

_getQuota() protected method

protected _getQuota ( Horde_Imap_Client_Mailbox $root )
$root Horde_Imap_Client_Mailbox

_getQuotaRoot() protected method

protected _getQuotaRoot ( Horde_Imap_Client_Mailbox $mailbox )
$mailbox Horde_Imap_Client_Mailbox

_initCapability() protected method

protected _initCapability ( )

_listACLRights() protected method

protected _listACLRights ( Horde_Imap_Client_Mailbox $mailbox, $identifier )
$mailbox Horde_Imap_Client_Mailbox

_listMailboxes() protected method

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

_login() protected method

protected _login ( )

_loginTasks() protected method

Perform login tasks.
protected _loginTasks ( boolean $firstlogin = true, array $resp = [] ) : boolean
$firstlogin boolean Is this the first login?
$resp array The 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 boolean True if global login tasks should be performed.

_logout() protected method

protected _logout ( )

_noop() protected method

protected _noop ( )

_openMailbox() protected method

protected _openMailbox ( Horde_Imap_Client_Mailbox $mailbox, $mode )
$mailbox Horde_Imap_Client_Mailbox

_parseACL() protected method

Parse an ACL response (RFC 4314 [3.6]).
protected _parseACL ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseAnnotation() protected method

Parse an ANNOTATION response (ANNOTATEMORE/ANNOTATEMORE2).
protected _parseAnnotation ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseBodystructure() protected method

Recursively parse BODYSTRUCTURE data from a FETCH return (see RFC 3501 [7.4.2]).
protected _parseBodystructure ( Horde_Imap_Client_Tokenize $data ) : Horde_Mime_Part
$data Horde_Imap_Client_Tokenize Data returned from the server.
return Horde_Mime_Part Mime part object.

_parseCapability() protected method

Parse a CAPABILITY Response (RFC 3501 [7.2.1]).
protected _parseCapability ( Horde_Imap_Client_Interaction_Pipeline $pipeline, array $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data array An array of CAPABILITY strings.

_parseComparator() protected method

Parse a COMPARATOR response (RFC 5255 [4.8])
protected _parseComparator ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseEnabled() protected method

Parse an ENABLED response (RFC 5161 [3.2]).
protected _parseEnabled ( Horde_Imap_Client_Tokenize $data )
$data Horde_Imap_Client_Tokenize The server response.

_parseEnvelope() protected method

Parse ENVELOPE data from a FETCH return (see RFC 3501 [7.4.2]).
protected _parseEnvelope ( Horde_Imap_Client_Tokenize $data ) : Horde_Imap_Client_Data_Envelope
$data Horde_Imap_Client_Tokenize Data returned from the server.
return Horde_Imap_Client_Data_Envelope An envelope object.

_parseEsearch() protected method

Parse an ESEARCH response (RFC 4466 [2.6.2]) Format: (TAG "a567") UID COUNT 5 ALL 4:19,21,28
protected _parseEsearch ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseFetch() protected method

the flags change).
protected _parseFetch ( Horde_Imap_Client_Interaction_Pipeline $pipeline, integer $id, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$id integer The message sequence number.
$data Horde_Imap_Client_Tokenize The server response.

_parseID() protected method

Parse an ID response (RFC 2971 [3.2]).
protected _parseID ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseLanguage() protected method

Parse a LANGUAGE response (RFC 5255 [3.3]).
protected _parseLanguage ( Horde_Imap_Client_Tokenize $data )
$data Horde_Imap_Client_Tokenize The server response.

_parseList() protected method

Parse a LIST/LSUB response (RFC 3501 [7.2.2 & 7.2.3]).
protected _parseList ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response (includes type as first token).

_parseListRights() protected method

Parse a LISTRIGHTS response (RFC 4314 [3.7]).
protected _parseListRights ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseMetadata() protected method

Parse a METADATA response (RFC 5464 [4.4]).
protected _parseMetadata ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseMyRights() protected method

Parse a MYRIGHTS response (RFC 4314 [3.8]).
protected _parseMyRights ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseNamespace() protected method

Parse a NAMESPACE response (RFC 2342 [5] & RFC 5255 [3.4]).
protected _parseNamespace ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The NAMESPACE data.

_parseQuota() protected method

Parse a QUOTA response (RFC 2087 [5.1]).
protected _parseQuota ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The server response.

_parseSearch() protected method

Parse a SEARCH/SORT response (RFC 3501 [7.2.5]; RFC 4466 [3]; RFC 5256 [4]; RFC 5267 [3]).
protected _parseSearch ( Horde_Imap_Client_Interaction_Pipeline $pipeline, array $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data array A list of IDs (message sequence numbers or UIDs).

_parseStatus() protected method

Parse a STATUS response (RFC 3501 [7.2.4]).
protected _parseStatus ( Horde_Imap_Client_Tokenize $data )
$data Horde_Imap_Client_Tokenize Token data

_parseStructureParams() protected method

Helper function to parse a parameters-like tokenized array.
protected _parseStructureParams ( mixed $data ) : array
$data mixed Message data. Either a Horde_Imap_Client_Tokenize object or null.
return array The parameter array.

_parseThread() protected method

Parse a THREAD response (RFC 5256 [4]).
protected _parseThread ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize Thread data.

_parseThreadLevel() protected method

Parse a level of a THREAD response (RFC 5256 [4]).
protected _parseThreadLevel ( array &$thread, Horde_Imap_Client_Tokenize $data, integer $level )
$thread array Results.
$data Horde_Imap_Client_Tokenize Thread data.
$level integer The current tree level.

_parseVanished() protected method

Parse a VANISHED response (RFC 7162 [3.2.10]).
protected _parseVanished ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Tokenize $data )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$data Horde_Imap_Client_Tokenize The response data.

_partialAtom() protected method

Add a partial atom to an IMAP command based on the criteria options.
protected _partialAtom ( array $opts ) : string
$opts array Criteria options.
return string The partial atom.

_pipeline() protected method

Shortcut to creating a new pipeline object.
protected _pipeline ( Horde_Imap_Client_Interaction_Command $cmd = null ) : Horde_Imap_Client_Interaction_Pipeline
$cmd Horde_Imap_Client_Interaction_Command An IMAP command to add.
return Horde_Imap_Client_Interaction_Pipeline A pipeline object.

_prepareStatusResponse() protected method

Prepares a status response for a mailbox.
protected _prepareStatusResponse ( array $request, string $mailbox )
$request array The status keys to return.
$mailbox string The mailbox to query.

_processCmd() protected method

Process/send a command to the remote server.
protected _processCmd ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Interaction_Command $cmd, Horde_Imap_Client_Data_Format_List $data ) : boolean
$pipeline Horde_Imap_Client_Interaction_Pipeline The pipeline object.
$cmd Horde_Imap_Client_Interaction_Command The master command.
$data Horde_Imap_Client_Data_Format_List Commands to send.
return boolean True if EOL needed to finish command.

_processCmdContinuation() protected method

Process a command continuation response.
protected _processCmdContinuation ( Horde_Imap_Client_Interaction_Pipeline $pipeline, boolean $noexception = false ) : mixed
$pipeline Horde_Imap_Client_Interaction_Pipeline The pipeline object.
$noexception boolean Don't throw exception if continuation does not occur.
return mixed A Horde_Imap_Client_Interaction_Server_Continuation object or false.

_renameMailbox() protected method

protected _renameMailbox ( Horde_Imap_Client_Mailbox $old, Horde_Imap_Client_Mailbox $new )
$old Horde_Imap_Client_Mailbox
$new Horde_Imap_Client_Mailbox

_responseCode() protected method

Handle status responses (see RFC 3501 [7.1]).
protected _responseCode ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Interaction_Server $ob )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$ob Horde_Imap_Client_Interaction_Server Server object.

_sendCmd() protected method

Sends command(s) to the IMAP server. A connection to the server must have already been made.
protected _sendCmd ( mixed $cmd ) : Horde_Imap_Client_Interaction_Pipeline
$cmd mixed Either a Command object or a Pipeline object.
return Horde_Imap_Client_Interaction_Pipeline A pipeline object.

_sendCmdChunk() protected method

Send a chunk of commands and/or continuation fragments to the server.
protected _sendCmdChunk ( Horde_Imap_Client_Interaction_Pipeline $pipeline, array $chunk )
$pipeline Horde_Imap_Client_Interaction_Pipeline The pipeline object.
$chunk array List of commands to send.

_sendID() protected method

protected _sendID ( $info )

_serverResponse() protected method

Handle untagged server responses (see RFC 3501 [2.2.2]).
protected _serverResponse ( Horde_Imap_Client_Interaction_Pipeline $pipeline, Horde_Imap_Client_Interaction_Server $ob )
$pipeline Horde_Imap_Client_Interaction_Pipeline Pipeline object.
$ob Horde_Imap_Client_Interaction_Server Server response.

_setACL() protected method

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

_setComparator() protected method

protected _setComparator ( $comparator )

_setLanguage() protected method

protected _setLanguage ( $langs )

_setMetadata() protected method

protected _setMetadata ( Horde_Imap_Client_Mailbox $mailbox, $data )
$mailbox Horde_Imap_Client_Mailbox

_setQuota() protected method

protected _setQuota ( Horde_Imap_Client_Mailbox $root, $resources )
$root Horde_Imap_Client_Mailbox

_status() protected method

protected _status ( $mboxes, $flags )

_store() protected method

protected _store ( $options )

_storeCmd() protected method

Create a store command.
protected _storeCmd ( array $options ) : Horde_Imap_Client_Interaction_Pipeline
$options array See Horde_Imap_Client_Base#_store().
return Horde_Imap_Client_Interaction_Pipeline Pipeline object.

_subscribeMailbox() protected method

protected _subscribeMailbox ( Horde_Imap_Client_Mailbox $mailbox, $subscribe )
$mailbox Horde_Imap_Client_Mailbox

_thread() protected method

protected _thread ( $options )

_tryLogin() protected method

Authenticate to the IMAP server.
protected _tryLogin ( string $method ) : Horde_Imap_Client_Interaction_Pipeline
$method string IMAP login method.
return Horde_Imap_Client_Interaction_Pipeline Pipeline object.

_vanished() protected method

protected _vanished ( $modseq, Horde_Imap_Client_Ids $ids )
$ids Horde_Imap_Client_Ids

getParam() public method

public getParam ( $key )

update() public method

public update ( SplSubject $subject )
$subject SplSubject

Property Details

$_cmdQueue protected_oe property

Queued commands to send to the server.
protected array $_cmdQueue
return array

$_defaultPorts protected_oe property

The default ports to use for a connection.
protected array $_defaultPorts
return array

$_statusFields protected_oe property

Mapping of status fields to IMAP names.
protected array $_statusFields
return array

$_tag protected_oe property

The unique tag to use when making an IMAP query.
protected int $_tag
return integer