Documentation

Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
in package

An interface to an IMAP4rev1 server (RFC 3501) using standard PHP code.

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 4731: ESEARCH
  - RFC 4959: SASL-IR
  - RFC 5032: WITHIN
  - RFC 5161: ENABLE
  - 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 5802: AUTH=SCRAM-SHA-1
  - RFC 5819: LIST-STATUS
  - RFC 5957: SORT=DISPLAY
  - RFC 6154: SPECIAL-USE/CREATE-SPECIAL-USE
  - RFC 6203: SEARCH=FUZZY
  - RFC 6851: MOVE
  - RFC 6855: UTF8=ACCEPT/UTF8=ONLY
  - RFC 6858: DOWNGRADED response code
  - RFC 7162: CONDSTORE/QRESYNC

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
  - AUTH=XOAUTH2
    https://developers.google.com/gmail/xoauth2_protocol

TODO (or not necessary?):

  - RFC 2177: IDLE
  - 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 6785: IMAPSIEVE
  - RFC 7377: MULTISEARCH
Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

1999-2007 The SquirrelMail Project Team

copyright

2005-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

CACHE_DOWNGRADED  = 'HICdg'
Cache names used exclusively within this class.
CACHE_FLAGS  = 'HICflags'
Cache names used exclusively within this class.
CACHE_MODSEQ  = '_m'
Cache names for miscellaneous data.
CACHE_SEARCH  = '_s'
CACHE_SEARCHID  = '_i'
VERSION  = 3
Serialized version.
$alerts_ob  : Horde_Imap_Client_Base_Alert
$cacheFields  : array<string|int, mixed>
The list of fetch fields that can be cached, and their cache names.
$capability  : Horde_Imap_Client_Data_Capability
$changed  : bool
Has the internal configuration changed?
$search_charset  : Horde_Imap_Client_Data_SearchCharset
$statuscache  : bool
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.
$url  : Horde_Imap_Client_Url
$_alerts  : Horde_Imap_Client_Base_Alerts
Alerts reporting object.
$_cache  : Horde_Imap_Client_Cache
The Horde_Imap_Client_Cache object.
$_cmdQueue  : array<string|int, mixed>
Queued commands to send to the server.
$_connection  : Client
Connection to the IMAP server.
$_debug  : Horde_Imap_Client_Base_Debug
The debug object.
$_defaultPorts  : array<string|int, mixed>
The default ports to use for a connection.
$_fetchDataClass  : string
The fetch data object type to return.
$_init  : array<string|int, mixed>
Cached server data.
$_isAuthenticated  : bool
Is there an active authenticated connection to the IMAP Server?
$_mode  : int
The current mailbox selection mode.
$_params  : array<string|int, mixed>
Hash containing connection parameters.
$_selected  : Horde_Imap_Client_Mailbox
The currently selected mailbox.
$_statusFields  : array<string|int, mixed>
Mapping of status fields to IMAP names.
$_tag  : int
The unique tag to use when making an IMAP query.
$_temp  : array<string|int, mixed>
Temp array (destroyed at end of process).
__clone()  : mixed
This object can not be cloned.
__construct()  : mixed
Constructor.
__get()  : mixed
__serialize()  : array<string|int, mixed>
__unserialize()  : mixed
_setInit()  : mixed
Set an initialization value.
alerts()  : array<string|int, mixed>
Return a list of alerts that MUST be presented to the user (RFC 3501 [7.1]).
allAclRights()  : array<string|int, mixed>
Return master list of ACL rights available on the server.
append()  : Horde_Imap_Client_Ids
Append message(s) to a mailbox.
capability()  : array<string|int, mixed>
Get CAPABILITY information from the IMAP server.
check()  : mixed
Request a checkpoint of the currently selected mailbox (RFC 3501 [6.4.1]).
close()  : mixed
Close the connection to the currently selected mailbox, optionally expunging all deleted messages (RFC 3501 [6.4.2]).
copy()  : mixed
Copy messages to another mailbox.
createMailbox()  : mixed
Create a mailbox.
currentMailbox()  : mixed
Return the currently opened mailbox and access mode.
deleteACL()  : mixed
Deletes ACL rights for a given mailbox/identifier.
deleteMailbox()  : mixed
Delete a mailbox.
expunge()  : Horde_Imap_Client_Ids
Expunge deleted messages from the given mailbox.
fetch()  : Horde_Imap_Client_Fetch_Results
Fetch message data (see RFC 3501 [6.4.5]).
getACL()  : array<string|int, mixed>
Get the ACL rights for a given mailbox. The server must support the IMAP ACL extension (RFC 2086/4314).
getCache()  : mixed
Returns the Horde_Imap_Client_Cache object used, if available.
getCacheId()  : string
Returns a unique identifier for the current mailbox status.
getComparator()  : mixed
Get the comparator used for searching/sorting (RFC 5255).
getID()  : array<string|int, mixed>
Return ID information from the IMAP server (RFC 2971).
getIdsOb()  : Horde_Imap_Client_Ids
Returns the correct IDs object for use with this driver.
getLanguage()  : mixed
Gets the preferred language for server response messages (RFC 5255).
getMetadata()  : array<string|int, mixed>
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/).
getMyACLRights()  : Horde_Imap_Client_Data_Acl
Get the ACL rights for the current user for a given mailbox. The server must support the IMAP ACL extension (RFC 2086/4314).
getNamespaces()  : mixed
Get the NAMESPACE information from the IMAP server (RFC 2342).
getParam()  : mixed
Returns a value from the internal params array.
getQuota()  : mixed
Get quota limits. The server must support the IMAP QUOTA extension (RFC 2087).
getQuotaRoot()  : mixed
Get quota limits for a mailbox. The server must support the IMAP QUOTA extension (RFC 2087).
getSyncToken()  : string
Returns a unique token for the current mailbox synchronization status.
isSecureConnection()  : bool
Display if connection to the server has been secured via TLS or SSL.
listACLRights()  : Horde_Imap_Client_Data_AclRights
List the ACL rights for a given mailbox/identifier. The server must support the IMAP ACL extension (RFC 2086/4314).
listMailboxes()  : array<string|int, mixed>
Obtain a list of mailboxes matching a pattern.
login()  : mixed
Login to the IMAP server.
logout()  : mixed
Logout from the IMAP server (see RFC 3501 [6.1.3]).
noop()  : mixed
Send a NOOP command (RFC 3501 [6.1.2]).
openMailbox()  : mixed
Open a mailbox.
parseCacheId()  : array<string|int, mixed>
Parses a cacheID created by getCacheId().
queryCapability()  : mixed
Returns whether the IMAP server supports the given capability (See RFC 3501 [6.1.1]).
renameMailbox()  : mixed
Rename a mailbox.
resolveIds()  : Horde_Imap_Client_Ids
Resolves an IDs object into a list of IDs.
search()  : array<string|int, mixed>
Search a mailbox.
sendID()  : mixed
Send ID information to the IMAP server (RFC 2971).
serialize()  : mixed
setACL()  : mixed
Set ACL rights for a given mailbox/identifier.
setComparator()  : mixed
Set the comparator to use for searching/sorting (RFC 5255).
setLanguage()  : string
Sets the preferred language for server response messages (RFC 5255).
setMetadata()  : mixed
Set metadata for a given mailbox/identifier.
setParam()  : mixed
Sets a configuration parameter value.
setQuota()  : mixed
Set quota limits. The server must support the IMAP QUOTA extension (RFC 2087).
shutdown()  : mixed
Shutdown actions.
status()  : array<string|int, mixed>
Obtain status information for a mailbox.
statusMultiple()  : array<string|int, mixed>
Perform a STATUS call on multiple mailboxes at the same time.
store()  : Horde_Imap_Client_Ids
Store message flag data (see RFC 3501 [6.4.6]).
subscribeMailbox()  : mixed
Manage subscription status for a mailbox.
sync()  : Horde_Imap_Client_Data_Sync
Synchronize a mailbox from a sync token.
thread()  : Horde_Imap_Client_Data_Thread
Thread sort a given list of messages (RFC 5256).
unserialize()  : mixed
update()  : mixed
validSearchCharset()  : bool
Determines if the given charset is valid for search-related queries.
vanished()  : Horde_Imap_Client_Ids
Get the list of vanished messages (UIDs that have been expunged since a given mod-sequence value).
_append()  : mixed
Append message(s) to a mailbox.
_appendData()  : Horde_Imap_Client_Data_Format_String_Nonascii
Prepares append message data for insertion into the IMAP command string.
_authInitialResponse()  : Horde_Imap_Client_Interaction_Command
Create the AUTHENTICATE command for the initial client response.
_cacheFields()  : array<string|int, mixed>
Provide the list of available caching fields.
_capability()  : mixed
Query server capability.
_changeSelected()  : mixed
Called when the selected mailbox is changed.
_check()  : mixed
Request a checkpoint of the currently selected mailbox.
_close()  : mixed
Close the connection to the currently selected mailbox, optionally expunging all deleted messages (RFC 3501 [6.4.2]).
_command()  : Horde_Imap_Client_Interaction_Command
Shortcut to creating a new IMAP client command object.
_condstoreSync()  : mixed
Synchronizes the current mailbox cache with the server (using CONDSTORE or QRESYNC).
_connect()  : mixed
Connects to the IMAP server.
_convertCatenateUrl()  : resource
Converts a CATENATE URL to stream data.
_copy()  : mixed
Copy messages to another mailbox.
_createMailbox()  : mixed
Create a mailbox.
_deleteACL()  : mixed
Deletes ACL rights for a given mailbox/identifier.
_deleteMailbox()  : mixed
Delete a mailbox.
_deleteMailboxPost()  : mixed
Actions to perform after a mailbox delete.
_deleteMsgs()  : Horde_Imap_Client_Ids
Delete messages in the cache.
_enable()  : mixed
Enable an IMAP extension (see RFC 5161).
_expunge()  : Horde_Imap_Client_Ids
Expunge all deleted messages from the given mailbox.
_fetch()  : mixed
Fetch message data.
_fetchCmd()  : mixed
Add a FETCH command to the given pipeline.
_getACL()  : array<string|int, mixed>
Get ACL rights for a given mailbox.
_getAnnotateMoreEntry()  : array<string|int, mixed>
Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.
_getComparator()  : mixed
Get the comparator used for searching/sorting (RFC 5255).
_getEncryptKey()  : string
Get encryption key.
_getID()  : array<string|int, mixed>
Return ID information from the IMAP server (RFC 2971).
_getLanguage()  : mixed
Gets the preferred language for server response messages (RFC 5255).
_getLine()  : Horde_Imap_Client_Interaction_Server
Gets data from the IMAP server stream and parses it.
_getMailboxList()  : array<string|int, mixed>
Obtain a list of mailboxes.
_getMboxFormatOb()  : Horde_Imap_Client_Data_Format_Mailbox
Return the proper mailbox format object based on the server's capabilities.
_getMetadata()  : array<string|int, mixed>
Get metadata for a given mailbox.
_getMyACLRights()  : Horde_Imap_Client_Data_Acl
Get the ACL rights for the current user for a given mailbox.
_getNamespaces()  : Horde_Imap_Client_Namespace_List
Get the NAMESPACE information from the IMAP server.
_getQuota()  : mixed
Get quota limits.
_getQuotaRoot()  : mixed
Get quota limits for a mailbox.
_getSearchCache()  : mixed
Retrieve data from the search cache.
_getUidByMessageId()  : string
Get a message UID by the Message-ID. Returns the last message in a mailbox that matches.
_initCache()  : bool
Initialize the Horde_Imap_Client_Cache object, if necessary.
_initCapability()  : mixed
Retrieve capability information from the IMAP server.
_initOb()  : mixed
Do initialization tasks.
_listACLRights()  : Horde_Imap_Client_Data_AclRights
Get ACL rights for a given mailbox/identifier.
_listMailboxes()  : array<string|int, mixed>
Obtain a list of mailboxes matching a pattern.
_login()  : bool
Login to the IMAP server.
_loginTasks()  : bool
Perform login tasks.
_logout()  : mixed
Logout from the IMAP server (see RFC 3501 [6.1.3]).
_mailboxOb()  : Horde_Imap_Client_Base_Mailbox
Return the Horde_Imap_Client_Base_Mailbox object.
_moveCache()  : mixed
Moves cache entries from the current mailbox to another mailbox.
_noop()  : mixed
Send a NOOP command.
_openMailbox()  : mixed
Open a mailbox.
_parseACL()  : mixed
Parse an ACL response (RFC 4314 [3.6]).
_parseAnnotation()  : mixed
Parse an ANNOTATION response (ANNOTATEMORE/ANNOTATEMORE2).
_parseBodystructure()  : Horde_Mime_Part
Recursively parse BODYSTRUCTURE data from a FETCH return (see RFC 3501 [7.4.2]).
_parseCapability()  : mixed
Parse a CAPABILITY Response (RFC 3501 [7.2.1]).
_parseComparator()  : mixed
Parse a COMPARATOR response (RFC 5255 [4.8])
_parseEnabled()  : mixed
Parse an ENABLED response (RFC 5161 [3.2]).
_parseEnvelope()  : Horde_Imap_Client_Data_Envelope
Parse ENVELOPE data from a FETCH return (see RFC 3501 [7.4.2]).
_parseEsearch()  : mixed
Parse an ESEARCH response (RFC 4466 [2.6.2]) Format: (TAG "a567") UID COUNT 5 ALL 4:19,21,28
_parseFetch()  : mixed
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()  : mixed
Parse an ID response (RFC 2971 [3.2]).
_parseLanguage()  : mixed
Parse a LANGUAGE response (RFC 5255 [3.3]).
_parseList()  : mixed
Parse a LIST/LSUB response (RFC 3501 [7.2.2 & 7.2.3]).
_parseListRights()  : mixed
Parse a LISTRIGHTS response (RFC 4314 [3.7]).
_parseMetadata()  : mixed
Parse a METADATA response (RFC 5464 [4.4]).
_parseMyRights()  : mixed
Parse a MYRIGHTS response (RFC 4314 [3.8]).
_parseNamespace()  : mixed
Parse a NAMESPACE response (RFC 2342 [5] & RFC 5255 [3.4]).
_parseQuota()  : mixed
Parse a QUOTA response (RFC 2087 [5.1]).
_parseSearch()  : mixed
Parse a SEARCH/SORT response (RFC 3501 [7.2.5]; RFC 4466 [3]; RFC 5256 [4]; RFC 5267 [3]).
_parseStatus()  : mixed
Parse a STATUS response (RFC 3501 [7.2.4]).
_parseStructureParams()  : array<string|int, mixed>
Helper function to parse a parameters-like tokenized array.
_parseThread()  : mixed
Parse a THREAD response (RFC 5256 [4]).
_parseThreadLevel()  : mixed
Parse a level of a THREAD response (RFC 5256 [4]).
_parseVanished()  : mixed
Parse a VANISHED response (RFC 7162 [3.2.10]).
_partialAtom()  : string
Add a partial atom to an IMAP command based on the criteria options.
_pipeline()  : Horde_Imap_Client_Interaction_Pipeline
Shortcut to creating a new pipeline object.
_prepareStatusResponse()  : mixed
Prepares a status response for a mailbox.
_processCmd()  : bool
Process/send a command to the remote server.
_processCmdContinuation()  : mixed
Process a command continuation response.
_renameMailbox()  : mixed
Rename a mailbox.
_responseCode()  : mixed
Handle status responses (see RFC 3501 [7.1]).
_search()  : Horde_Imap_Client_Ids
Search a mailbox. This driver supports all IMAP4rev1 search criteria as defined in RFC 3501.
_sendCmd()  : Horde_Imap_Client_Interaction_Pipeline
Sends command(s) to the IMAP server. A connection to the server must have already been made.
_sendCmdChunk()  : mixed
Send a chunk of commands and/or continuation fragments to the server.
_sendID()  : mixed
Send ID information to the IMAP server (RFC 2971).
_serverResponse()  : mixed
Handle untagged server responses (see RFC 3501 [2.2.2]).
_setACL()  : mixed
Set ACL rights for a given mailbox/identifier.
_setComparator()  : mixed
Set the comparator to use for searching/sorting (RFC 5255).
_setLanguage()  : string
Sets the preferred language for server response messages (RFC 5255).
_setMetadata()  : mixed
Set metadata for a given mailbox/identifier.
_setQuota()  : bool
Set quota limits.
_setSearchCache()  : mixed
Set data in the search cache.
_status()  : array<string|int, mixed>
Obtain status information for mailboxes.
_store()  : Horde_Imap_Client_Ids
Store message flag data.
_storeCmd()  : Horde_Imap_Client_Interaction_Pipeline
Create a store command.
_subscribeMailbox()  : mixed
Manage subscription status for a mailbox.
_syncStatus()  : array<string|int, mixed>
Return the current mailbox synchronization status.
_thread()  : Horde_Imap_Client_Data_Thread
Thread sort a given list of messages (RFC 5256).
_tryLogin()  : Horde_Imap_Client_Interaction_Pipeline
Authenticate to the IMAP server.
_updateCache()  : mixed
Store FETCH data in cache.
_updateModSeq()  : mixed
Updates the cached MODSEQ value.
_vanished()  : Horde_Imap_Client_Ids
Get the list of vanished messages.

Constants

CACHE_DOWNGRADED

Cache names used exclusively within this class.

public mixed CACHE_DOWNGRADED = 'HICdg'

@since 2.11.0

CACHE_FLAGS

Cache names used exclusively within this class.

public mixed CACHE_FLAGS = 'HICflags'

CACHE_MODSEQ

Cache names for miscellaneous data.

public mixed CACHE_MODSEQ = '_m'
public mixed CACHE_SEARCH = '_s'

CACHE_SEARCHID

public mixed CACHE_SEARCHID = '_i'

VERSION

Serialized version.

public mixed VERSION = 3

Properties

$alerts_ob read-only

public Horde_Imap_Client_Base_Alert $alerts_ob

The alert reporting object (@since 2.26.0)

$cacheFields

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

public array<string|int, mixed> $cacheFields = 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')

$changed

Has the internal configuration changed?

public bool $changed = \false

$statuscache

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.

public bool $statuscache = \true
Tags
since
2.14.0

$_cmdQueue

Queued commands to send to the server.

protected array<string|int, mixed> $_cmdQueue = array()

$_connection

Connection to the IMAP server.

protected Client $_connection = \null

$_debug

The debug object.

protected Horde_Imap_Client_Base_Debug $_debug = \null

$_defaultPorts

The default ports to use for a connection.

protected array<string|int, mixed> $_defaultPorts = array(143, 993)

$_fetchDataClass

The fetch data object type to return.

protected string $_fetchDataClass = 'Horde_Imap_Client_Data_Fetch'

$_init

Cached server data.

protected array<string|int, mixed> $_init

$_isAuthenticated

Is there an active authenticated connection to the IMAP Server?

protected bool $_isAuthenticated = \false

$_mode

The current mailbox selection mode.

protected int $_mode = 0

$_params

Hash containing connection parameters.

protected array<string|int, mixed> $_params = array()

This hash never changes.

$_statusFields

Mapping of status fields to IMAP names.

protected array<string|int, mixed> $_statusFields = 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)

$_tag

The unique tag to use when making an IMAP query.

protected int $_tag = 0

$_temp

Temp array (destroyed at end of process).

protected array<string|int, mixed> $_temp = array()

Methods

__clone()

This object can not be cloned.

public __clone() : mixed
Return values
mixed

__construct()

Constructor.

public __construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = 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).
Return values
mixed

__get()

public __get(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

__serialize()

public __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__unserialize()

public __unserialize(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

_setInit()

Set an initialization value.

public _setInit([string $key = null ][, mixed $val = null ]) : mixed
Parameters
$key : string = null

The initialization key. If null, resets all keys.

$val : mixed = null

The cached value. If null, removes the key.

Return values
mixed

alerts()

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

public alerts() : array<string|int, mixed>
Tags
deprecated

Add an observer to the $alerts_ob property instead.

Return values
array<string|int, mixed>

An array of alert messages.

allAclRights()

Return master list of ACL rights available on the server.

public allAclRights() : array<string|int, mixed>
Return values
array<string|int, mixed>

A list of ACL rights.

append()

Append message(s) to a mailbox.

public append(mixed $mailbox, array<string|int, mixed> $data[, array<string|int, mixed> $options = array() ]) : Horde_Imap_Client_Ids
Parameters
$mailbox : mixed

The mailbox to append the message(s) to. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$data : array<string|int, mixed>

The 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.
$options : array<string|int, mixed> = array()

Additonal options:

  - create: (boolean) Try to create $mailbox if it does not exist?
            DEFAULT: No.
Tags
throws
Horde_Imap_Client_Exception
Return values
Horde_Imap_Client_Ids

The UIDs of the appended messages.

capability()

Get CAPABILITY information from the IMAP server.

public capability() : array<string|int, mixed>
Tags
deprecated

Use $capability property instead.

throws
Horde_Imap_Client_Exception
Return values
array<string|int, mixed>

The capability array.

check()

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

public check() : mixed
Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

close()

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

public close([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

Additional options:

  • expunge: (boolean) Expunge all messages flagged as deleted? DEFAULT: No
Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

copy()

Copy messages to another mailbox.

public copy(mixed $source, mixed $dest[, array<string|int, mixed> $options = array() ]) : mixed
Parameters
$source : mixed

The source mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$dest : mixed

The destination mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$options : array<string|int, mixed> = array()

Additional 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.
Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
mixed

An array mapping old UIDs (keys) to new UIDs (values) on success (only guaranteed if 'force_map' is true) or true.

createMailbox()

Create a mailbox.

public createMailbox(mixed $mailbox[, array<string|int, mixed> $opts = array() ]) : mixed
Parameters
$mailbox : mixed

The mailbox to create. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$opts : array<string|int, mixed> = array()

Additional options:

  • special_use: (array) An array of special-use flags to mark the mailbox with. The server MUST support RFC 6154.
Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

currentMailbox()

Return the currently opened mailbox and access mode.

public currentMailbox() : mixed
Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

Null if no mailbox selected, or an array with two elements:

  • mailbox: (Horde_Imap_Client_Mailbox) The mailbox object.
  • mode: (integer) Current mode.

deleteACL()

Deletes ACL rights for a given mailbox/identifier.

public deleteACL(mixed $mailbox, string $identifier) : mixed
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$identifier : string

The identifier to delete (UTF-8).

Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
mixed

deleteMailbox()

Delete a mailbox.

public deleteMailbox(mixed $mailbox) : mixed
Parameters
$mailbox : mixed

The mailbox to delete. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

expunge()

Expunge deleted messages from the given mailbox.

public expunge(mixed $mailbox[, array<string|int, mixed> $options = array() ]) : Horde_Imap_Client_Ids
Parameters
$mailbox : mixed

The mailbox to expunge. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$options : array<string|int, mixed> = array()

Additional 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
Tags
throws
Horde_Imap_Client_Exception
Return values
Horde_Imap_Client_Ids

If 'list' option is true, returns the UID list of expunged messages.

fetch()

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

public fetch(mixed $mailbox, Horde_Imap_Client_Fetch_Query $query[, array<string|int, mixed> $options = array() ]) : Horde_Imap_Client_Fetch_Results
Parameters
$mailbox : mixed

The mailbox to search. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$query : Horde_Imap_Client_Fetch_Query

Fetch query object.

$options : array<string|int, mixed> = array()

Additional 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
Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
Horde_Imap_Client_Fetch_Results

A results object.

getACL()

Get the ACL rights for a given mailbox. The server must support the IMAP ACL extension (RFC 2086/4314).

public getACL(mixed $mailbox) : array<string|int, mixed>
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

Tags
throws
Horde_Imap_Client_Exception
Return values
array<string|int, mixed>

An array with identifiers as the keys and Horde_Imap_Client_Data_Acl objects as the values.

getCache()

Returns the Horde_Imap_Client_Cache object used, if available.

public getCache() : mixed
Return values
mixed

Either the cache object or null.

getCacheId()

Returns a unique identifier for the current mailbox status.

public getCacheId(mixed $mailbox[, array<string|int, mixed> $addl = array() ]) : string
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$addl : array<string|int, mixed> = array()

Additional cache info to add to the cache ID string.

Tags
deprecated
throws
Horde_Imap_Client_Exception
Return values
string

The 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.

getComparator()

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

public getComparator() : mixed
Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

Null if the default comparator is being used, or an array of comparator information (see RFC 5255 [4.8]).

getIdsOb()

Returns the correct IDs object for use with this driver.

public getIdsOb([mixed $ids = null ][, bool $sequence = false ]) : Horde_Imap_Client_Ids
Parameters
$ids : mixed = null

Either self::ALL, self::SEARCH_RES, self::LARGEST, Horde_Imap_Client_Ids object, array, or sequence string.

$sequence : bool = false

Are $ids message sequence numbers?

Return values
Horde_Imap_Client_Ids

The IDs object.

getLanguage()

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

public getLanguage([array<string|int, mixed> $list = false ]) : mixed
Parameters
$list : array<string|int, mixed> = false

If true, return the list of available languages.

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

If $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.

getMetadata()

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/).

public getMetadata(mixed $mailbox, array<string|int, mixed> $entries[, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$entries : array<string|int, mixed>

The entries to fetch (UTF-8 strings).

$options : array<string|int, mixed> = array()

Additional 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.
Tags
throws
Horde_Imap_Client_Exception
Return values
array<string|int, mixed>

An 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'.

getNamespaces()

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

public getNamespaces([array<string|int, mixed> $additional = array() ][, array<string|int, mixed> $opts = array() ]) : mixed
Parameters
$additional : array<string|int, mixed> = array()

If 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.

$opts : array<string|int, mixed> = array()

Additional options:

  • ob_return: (boolean) If true, returns a Horde_Imap_Client_Namespace_List object instead of an array.
Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

A 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

getParam()

Returns a value from the internal params array.

public getParam(mixed $key) : mixed
Parameters
$key : mixed

The param key.

Return values
mixed

The param value, or null if not found.

getQuota()

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

public getQuota(mixed $root) : mixed
Parameters
$root : mixed

The quota root. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
mixed

An array with resource keys. Each key holds an array with 2 values: 'limit' and 'usage'.

getQuotaRoot()

Get quota limits for a mailbox. The server must support the IMAP QUOTA extension (RFC 2087).

public getQuotaRoot(mixed $mailbox) : mixed
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
mixed

An 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'.

getSyncToken()

Returns a unique token for the current mailbox synchronization status.

public getSyncToken(mixed $mailbox) : string
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

Tags
since
2.2.0
throws
Horde_Imap_Client_Exception
Return values
string

The sync token.

isSecureConnection()

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

public isSecureConnection() : bool
Return values
bool

True if the IMAP connection is secured.

listACLRights()

List the ACL rights for a given mailbox/identifier. The server must support the IMAP ACL extension (RFC 2086/4314).

public listACLRights(mixed $mailbox, string $identifier) : Horde_Imap_Client_Data_AclRights
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$identifier : string

The identifier to query (UTF-8).

Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
Horde_Imap_Client_Data_AclRights

An ACL data rights object.

listMailboxes()

Obtain a list of mailboxes matching a pattern.

public listMailboxes(mixed $pattern[, int $mode = Horde_Imap_Client::MBOX_ALL ][, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
$pattern : mixed

The 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).

$mode : int = Horde_Imap_Client::MBOX_ALL

Which 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).
$options : array<string|int, mixed> = array()

Additional 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: '.'
Tags
throws
Horde_Imap_Client_Exception
Return values
array<string|int, mixed>

If '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].

logout()

Logout from the IMAP server (see RFC 3501 [6.1.3]).

public logout() : mixed
Return values
mixed

openMailbox()

Open a mailbox.

public openMailbox(mixed $mailbox[, int $mode = Horde_Imap_Client::OPEN_AUTO ]) : mixed
Parameters
$mailbox : mixed

The mailbox to open. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$mode : int = Horde_Imap_Client::OPEN_AUTO

The access mode. Either

  • Horde_Imap_Client::OPEN_READONLY
  • Horde_Imap_Client::OPEN_READWRITE
  • Horde_Imap_Client::OPEN_AUTO
Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

parseCacheId()

Parses a cacheID created by getCacheId().

public parseCacheId(string $id) : array<string|int, mixed>
Parameters
$id : string

The cache ID.

Tags
deprecated
Return values
array<string|int, mixed>

An array with the following information:

  • highestmodseq: (integer)
  • messages: (integer)
  • uidnext: (integer)
  • uidvalidity: (integer) Always present

queryCapability()

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

public queryCapability(string $capability) : mixed
Parameters
$capability : string

The capability string to query.

Tags
deprecated

Use $capability property instead.

Return values
mixed

True if the server supports the queried capability, false if it doesn't, or an array if the capability can contain multiple values.

renameMailbox()

Rename a mailbox.

public renameMailbox(mixed $old, mixed $new) : mixed
Parameters
$old : mixed

The old mailbox name. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$new : mixed

The new mailbox name. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

Search a mailbox.

public search(mixed $mailbox[, Horde_Imap_Client_Search_Query $query = null ][, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
$mailbox : mixed

The mailbox to search. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$query : Horde_Imap_Client_Search_Query = null

The search query. Defaults to an ALL search.

$options : array<string|int, mixed> = array()

Additional 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
Tags
throws
Horde_Imap_Client_Exception
Return values
array<string|int, mixed>

An 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.

serialize()

public serialize() : mixed
Return values
mixed

setACL()

Set ACL rights for a given mailbox/identifier.

public setACL(mixed $mailbox, string $identifier, array<string|int, mixed> $options) : mixed
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$identifier : string

The identifier to alter (UTF-8).

$options : array<string|int, mixed>

Additional 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.
Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
mixed

setComparator()

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

public setComparator([string $comparator = null ]) : mixed
Parameters
$comparator : string = null

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

Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
mixed

setLanguage()

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

public setLanguage([array<string|int, mixed> $langs = null ]) : string
Parameters
$langs : array<string|int, mixed> = null

Overrides 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.

Tags
throws
Horde_Imap_Client_Exception
Return values
string

The language accepted by the server, or null if the default language is used.

setMetadata()

Set metadata for a given mailbox/identifier.

public setMetadata(mixed $mailbox, array<string|int, mixed> $data) : mixed
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8). If empty, sets a server annotation.

$data : array<string|int, mixed>

A set of data values. The metadata values corresponding to the keys of the array will be set to the values in the array.

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

setParam()

Sets a configuration parameter value.

public setParam(string $key, mixed $val) : mixed
Parameters
$key : string

The param key.

$val : mixed

The param value.

Return values
mixed

setQuota()

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

public setQuota(mixed $root[, array<string|int, mixed> $resources = array() ]) : mixed
Parameters
$root : mixed

The quota root. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$resources : array<string|int, mixed> = array()

The resource values to set. Keys are the resource atom name; value is the resource value.

Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
mixed

shutdown()

Shutdown actions.

public shutdown() : mixed
Return values
mixed

status()

Obtain status information for a mailbox.

public status(mixed $mailbox[, int $flags = Horde_Imap_Client::STATUS_ALL ][, array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$mailbox : mixed

The 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).

$flags : int = Horde_Imap_Client::STATUS_ALL

A 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.

$opts : array<string|int, mixed> = array()

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: '.'
Tags
throws
Horde_Imap_Client_Exception
Return values
array<string|int, mixed>

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.

statusMultiple()

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

public statusMultiple(array<string|int, mixed> $mailboxes[, int $flags = Horde_Imap_Client::STATUS_ALL ][, array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>

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

Parameters
$mailboxes : array<string|int, mixed>

The mailboxes to query. Either Horde_Imap_Client_Mailbox objects, strings (UTF-8), or a combination of the two.

$flags : int = Horde_Imap_Client::STATUS_ALL

See status().

$opts : array<string|int, mixed> = array()

Additional 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: '.'
Tags
deprecated

Use status() instead.

Return values
array<string|int, mixed>

An 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 message flag data (see RFC 3501 [6.4.6]).

public store(mixed $mailbox[, array<string|int, mixed> $options = array() ]) : Horde_Imap_Client_Ids
Parameters
$mailbox : mixed

The mailbox containing the messages to modify. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$options : array<string|int, mixed> = array()

Additional 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
Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupportExtension
Return values
Horde_Imap_Client_Ids

A Horde_Imap_Client_Ids object containing the list of IDs that failed the 'unchangedsince' test.

subscribeMailbox()

Manage subscription status for a mailbox.

public subscribeMailbox(mixed $mailbox[, bool $subscribe = true ]) : mixed
Parameters
$mailbox : mixed

The mailbox to [un]subscribe to. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$subscribe : bool = true

True to subscribe, false to unsubscribe.

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

sync()

Synchronize a mailbox from a sync token.

public sync(mixed $mailbox, string $token[, array<string|int, mixed> $opts = array() ]) : Horde_Imap_Client_Data_Sync
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$token : string

A sync token generated by getSyncToken().

$opts : array<string|int, mixed> = array()

Additional 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.
Tags
since
2.2.0
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_Sync
Return values
Horde_Imap_Client_Data_Sync

A sync object.

thread()

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

public thread(mixed $mailbox[, array<string|int, mixed> $options = array() ]) : Horde_Imap_Client_Data_Thread
Parameters
$mailbox : mixed

The mailbox to query. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$options : array<string|int, mixed> = array()

Additional 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.
Tags
throws
Horde_Imap_Client_Exception
Return values
Horde_Imap_Client_Data_Thread

A thread data object.

unserialize()

public unserialize(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

update()

public update(SplSubject $subject) : mixed
Parameters
$subject : SplSubject
Return values
mixed

validSearchCharset()

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

public validSearchCharset(string $charset) : bool

This check pertains just to the basic IMAP SEARCH command.

Parameters
$charset : string

The query charset.

Tags
deprecated

Use $search_charset property instead.

Return values
bool

True if server supports this charset.

vanished()

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

public vanished(mixed $mailbox, int $modseq[, array<string|int, mixed> $opts = array() ]) : Horde_Imap_Client_Ids
Parameters
$mailbox : mixed

The mailbox to query. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

$modseq : int

Search for expunged messages after this mod-sequence value.

$opts : array<string|int, mixed> = array()

Additional 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.
Tags
throws
Horde_Imap_Client_NoSupportExtension
Return values
Horde_Imap_Client_Ids

List of UIDs that have vanished.

_append()

Append message(s) to a mailbox.

protected _append(Horde_Imap_Client_Mailbox $mailbox, mixed $data, mixed $options) : mixed
Parameters
$mailbox : Horde_Imap_Client_Mailbox

The mailbox to append the message(s) to.

$data : mixed

The message data.

$options : mixed

Additional options.

Return values
mixed

A Horde_Imap_Client_Ids object containing the UIDs of the appended messages (if server supports UIDPLUS extension) or true.

_authInitialResponse()

Create the AUTHENTICATE command for the initial client response.

protected _authInitialResponse(string $method, string $ir[, string $username = null ]) : Horde_Imap_Client_Interaction_Command
Parameters
$method : string

AUTHENTICATE SASL method.

$ir : string

Initial client response.

$username : string = null

If set, log a username message in debug log instead of raw data.

Return values
Horde_Imap_Client_Interaction_Command

A command object.

_cacheFields()

Provide the list of available caching fields.

protected _cacheFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

The list of available caching fields (fields are in the key).

_capability()

Query server capability.

protected _capability() : mixed

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).

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

The capability object if no arguments provided. If arguments are provided, they are passed to the query() method and this value is returned.

_changeSelected()

Called when the selected mailbox is changed.

protected _changeSelected([mixed $mailbox = null ][, int $mode = null ]) : mixed
Parameters
$mailbox : mixed = null

The selected mailbox or null.

$mode : int = null

The access mode.

Return values
mixed

_check()

Request a checkpoint of the currently selected mailbox.

protected _check() : mixed
Return values
mixed

_close()

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

protected _close(mixed $options) : mixed
Parameters
$options : mixed

Additional options.

Return values
mixed

_condstoreSync()

Synchronizes the current mailbox cache with the server (using CONDSTORE or QRESYNC).

protected _condstoreSync() : mixed
Return values
mixed

_convertCatenateUrl()

Converts a CATENATE URL to stream data.

protected _convertCatenateUrl(string $url) : resource
Parameters
$url : string

The CATENATE URL.

Return values
resource

A stream containing the data.

_copy()

Copy messages to another mailbox.

protected _copy(Horde_Imap_Client_Mailbox $dest, mixed $options) : mixed
Parameters
$dest : Horde_Imap_Client_Mailbox

The destination mailbox.

$options : mixed

Additional options.

Return values
mixed

An array mapping old UIDs (keys) to new UIDs (values) on success (if the IMAP server and/or driver support the UIDPLUS extension) or true.

_deleteACL()

Deletes ACL rights for a given mailbox/identifier.

protected _deleteACL(Horde_Imap_Client_Mailbox $mailbox, mixed $identifier) : mixed
Parameters
$mailbox : Horde_Imap_Client_Mailbox

A mailbox.

$identifier : mixed

The identifier to delete (UTF7-IMAP).

Return values
mixed

_deleteMsgs()

Delete messages in the cache.

protected _deleteMsgs(Horde_Imap_Client_Mailbox $mailbox, Horde_Imap_Client_Ids $ids[, array<string|int, mixed> $opts = array() ]) : Horde_Imap_Client_Ids
Parameters
$mailbox : Horde_Imap_Client_Mailbox

The mailbox.

$ids : Horde_Imap_Client_Ids

The list of IDs to delete in $mailbox.

$opts : array<string|int, mixed> = array()

Options:

  • decrement: (boolean) If true, decrement the message count.
  • pipeline: (Horde_Imap_Client_Interaction_Pipeline) Pipeline object.
Return values
Horde_Imap_Client_Ids

UIDs that were deleted.

_enable()

Enable an IMAP extension (see RFC 5161).

protected _enable(array<string|int, mixed> $exts) : mixed
Parameters
$exts : array<string|int, mixed>

The extensions to enable.

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

_expunge()

Expunge all deleted messages from the given mailbox.

protected _expunge(mixed $options) : Horde_Imap_Client_Ids
Parameters
$options : mixed

Additional options.

Return values
Horde_Imap_Client_Ids

If 'list' option is true, returns the list of expunged messages.

_getACL()

Get ACL rights for a given mailbox.

protected _getACL(Horde_Imap_Client_Mailbox $mailbox) : array<string|int, mixed>
Parameters
$mailbox : Horde_Imap_Client_Mailbox

A mailbox.

Return values
array<string|int, mixed>

An array with identifiers as the keys and Horde_Imap_Client_Data_Acl objects as the values.

_getAnnotateMoreEntry()

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

protected _getAnnotateMoreEntry(string $name) : array<string|int, mixed>
Parameters
$name : string

A name for a metadata entry.

Tags
throws
Horde_Imap_Client_Exception
Return values
array<string|int, mixed>

A list of two elements: The entry name and the value type.

_getComparator()

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

protected _getComparator() : mixed
Return values
mixed

Null if the default comparator is being used, or an array of comparator information (see RFC 5255 [4.8]).

_getEncryptKey()

Get encryption key.

protected _getEncryptKey() : string
Tags
deprecated

Pass callable into 'password' parameter instead.

Return values
string

The encryption key.

_getID()

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

protected _getID() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of information returned, with the keys as the 'field' and the values as the 'value'.

_getLanguage()

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

protected _getLanguage(mixed $list) : mixed
Parameters
$list : mixed

If true, return the list of available languages.

Return values
mixed

If $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.

_getMailboxList()

Obtain a list of mailboxes.

protected _getMailboxList(array<string|int, mixed> $pattern, int $mode, array<string|int, mixed> $options[, array<string|int, mixed> $subscribed = null ]) : array<string|int, mixed>
Parameters
$pattern : array<string|int, mixed>

The mailbox search pattern(s).

$mode : int

Which mailboxes to return.

$options : array<string|int, mixed>

Additional options. 'no_listext' will skip using the LIST-EXTENDED capability.

$subscribed : array<string|int, mixed> = null

A list of subscribed mailboxes.

Tags
throws
Horde_Imap_Client_Exception
Return values
array<string|int, mixed>

See listMailboxes(().

_getMetadata()

Get metadata for a given mailbox.

protected _getMetadata(Horde_Imap_Client_Mailbox $mailbox, mixed $entries, mixed $options) : array<string|int, mixed>
Parameters
$mailbox : Horde_Imap_Client_Mailbox

A mailbox.

$entries : mixed

The entries to fetch (UTF7-IMAP strings).

$options : mixed

Additional options.

Return values
array<string|int, mixed>

An array with metadata names as the keys and metadata values as the values.

_getQuotaRoot()

Get quota limits for a mailbox.

protected _getQuotaRoot(Horde_Imap_Client_Mailbox $mailbox) : mixed
Parameters
$mailbox : Horde_Imap_Client_Mailbox

A mailbox.

Return values
mixed

An 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'.

_getSearchCache()

Retrieve data from the search cache.

protected _getSearchCache(string $type, array<string|int, mixed> $options) : mixed
Parameters
$type : string

The cache type ('search' or 'thread').

$options : array<string|int, mixed>

The options array of the calling function.

Return values
mixed

Returns search cache metadata. If search was retrieved, data is in key 'data'. Returns null if caching is not available.

_getUidByMessageId()

Get a message UID by the Message-ID. Returns the last message in a mailbox that matches.

protected _getUidByMessageId(Horde_Imap_Client_Mailbox $mailbox, string $msgid) : string
Parameters
$mailbox : Horde_Imap_Client_Mailbox

The mailbox to search

$msgid : string

Message-ID.

Return values
string

UID (null if not found).

_initCache()

Initialize the Horde_Imap_Client_Cache object, if necessary.

protected _initCache([bool $current = false ]) : bool
Parameters
$current : bool = false

If 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
bool

Returns true if caching is enabled.

_initCapability()

Retrieve capability information from the IMAP server.

protected _initCapability() : mixed
Return values
mixed

_initOb()

Do initialization tasks.

protected _initOb() : mixed
Return values
mixed

_listMailboxes()

Obtain a list of mailboxes matching a pattern.

protected _listMailboxes(mixed $pattern, mixed $mode, mixed $options) : array<string|int, mixed>
Parameters
$pattern : mixed

The mailbox search patterns (Horde_Imap_Client_Mailbox objects).

$mode : mixed

Which mailboxes to return.

$options : mixed

Additional options.

Return values
array<string|int, mixed>

See listMailboxes().

_login()

Login to the IMAP server.

protected _login() : bool
Return values
bool

Return true if global login tasks should be run.

_loginTasks()

Perform login tasks.

protected _loginTasks([bool $firstlogin = true ][, array<string|int, mixed> $resp = array() ]) : bool
Parameters
$firstlogin : bool = true

Is this the first login?

$resp : array<string|int, mixed> = 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 values
bool

True if global login tasks should be performed.

_logout()

Logout from the IMAP server (see RFC 3501 [6.1.3]).

protected _logout() : mixed
Return values
mixed

_mailboxOb()

Return the Horde_Imap_Client_Base_Mailbox object.

protected _mailboxOb([string $mailbox = null ]) : Horde_Imap_Client_Base_Mailbox
Parameters
$mailbox : string = null

The mailbox name. Defaults to currently selected mailbox.

Return values
Horde_Imap_Client_Base_Mailbox

Mailbox object.

_moveCache()

Moves cache entries from the current mailbox to another mailbox.

protected _moveCache(Horde_Imap_Client_Mailbox $to, array<string|int, mixed> $map, string $uidvalid) : mixed
Parameters
$to : Horde_Imap_Client_Mailbox

The destination mailbox.

$map : array<string|int, mixed>

Mapping of source UIDs (keys) to destination UIDs (values).

$uidvalid : string

UIDVALIDITY of destination mailbox.

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

_noop()

Send a NOOP command.

protected _noop() : mixed
Return values
mixed

_parseBodystructure()

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

protected _parseBodystructure(Horde_Imap_Client_Tokenize $data) : Horde_Mime_Part
Parameters
$data : Horde_Imap_Client_Tokenize

Data returned from the server.

Return values
Horde_Mime_Part

Mime part object.

_parseEnabled()

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

protected _parseEnabled(Horde_Imap_Client_Tokenize $data) : mixed
Parameters
$data : Horde_Imap_Client_Tokenize

The server response.

Return values
mixed

_parseFetch()

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.

protected _parseFetch(Horde_Imap_Client_Interaction_Pipeline $pipeline, int $id, Horde_Imap_Client_Tokenize $data) : mixed

the flags change).

Parameters
$pipeline : Horde_Imap_Client_Interaction_Pipeline

Pipeline object.

$id : int

The message sequence number.

$data : Horde_Imap_Client_Tokenize

The server response.

Return values
mixed

_parseLanguage()

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

protected _parseLanguage(Horde_Imap_Client_Tokenize $data) : mixed
Parameters
$data : Horde_Imap_Client_Tokenize

The server response.

Return values
mixed

_parseStatus()

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

protected _parseStatus(Horde_Imap_Client_Tokenize $data) : mixed
Parameters
$data : Horde_Imap_Client_Tokenize

Token data

Return values
mixed

_parseStructureParams()

Helper function to parse a parameters-like tokenized array.

protected _parseStructureParams(mixed $data) : array<string|int, mixed>
Parameters
$data : mixed

Message data. Either a Horde_Imap_Client_Tokenize object or null.

Return values
array<string|int, mixed>

The parameter array.

_parseThreadLevel()

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

protected _parseThreadLevel(array<string|int, mixed> &$thread, Horde_Imap_Client_Tokenize $data, int $level) : mixed
Parameters
$thread : array<string|int, mixed>

Results.

$data : Horde_Imap_Client_Tokenize

Thread data.

$level : int

The current tree level.

Return values
mixed

_partialAtom()

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

protected _partialAtom(array<string|int, mixed> $opts) : string
Parameters
$opts : array<string|int, mixed>

Criteria options.

Return values
string

The partial atom.

_prepareStatusResponse()

Prepares a status response for a mailbox.

protected _prepareStatusResponse(array<string|int, mixed> $request, string $mailbox) : mixed
Parameters
$request : array<string|int, mixed>

The status keys to return.

$mailbox : string

The mailbox to query.

Return values
mixed

_processCmd()

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) : bool
Parameters
$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.

Tags
throws
Horde_Imap_Client_Exception
throws
Horde_Imap_Client_Exception_NoSupport
Return values
bool

True if EOL needed to finish command.

_processCmdContinuation()

Process a command continuation response.

protected _processCmdContinuation(Horde_Imap_Client_Interaction_Pipeline $pipeline[, bool $noexception = false ]) : mixed
Parameters
$pipeline : Horde_Imap_Client_Interaction_Pipeline

The pipeline object.

$noexception : bool = false

Don't throw exception if continuation does not occur.

Tags
throws
Horde_Imap_Client_Exception
Return values
mixed

A Horde_Imap_Client_Interaction_Server_Continuation object or false.

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

protected _search(mixed $query, mixed $options) : Horde_Imap_Client_Ids
Parameters
$query : mixed

The search query.

$options : mixed

Additional options. The '_query' key contains the value of $query->build().

Return values
Horde_Imap_Client_Ids

An array of IDs.

_sendID()

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

protected _sendID(mixed $info) : mixed
Parameters
$info : mixed

The information to send to the server.

Return values
mixed

_setACL()

Set ACL rights for a given mailbox/identifier.

protected _setACL(Horde_Imap_Client_Mailbox $mailbox, mixed $identifier, mixed $options) : mixed
Parameters
$mailbox : Horde_Imap_Client_Mailbox

A mailbox.

$identifier : mixed

The identifier to alter (UTF7-IMAP).

$options : mixed

Additional options. 'rights' contains the string of rights to set on the server.

Return values
mixed

_setComparator()

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

protected _setComparator(mixed $comparator) : mixed
Parameters
$comparator : mixed

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

Return values
mixed

_setLanguage()

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

protected _setLanguage(mixed $langs) : string
Parameters
$langs : mixed

The preferred list of languages.

Return values
string

The language accepted by the server, or null if the default language is used.

_setMetadata()

Set metadata for a given mailbox/identifier.

protected _setMetadata(Horde_Imap_Client_Mailbox $mailbox, mixed $data) : mixed
Parameters
$mailbox : Horde_Imap_Client_Mailbox

A mailbox.

$data : mixed

A set of data values. See setMetadata() for format.

Return values
mixed

_setSearchCache()

Set data in the search cache.

protected _setSearchCache(mixed $data, string $sdata) : mixed
Parameters
$data : mixed

The cache data to store.

$sdata : string

The search data returned from _getSearchCache().

Return values
mixed

_status()

Obtain status information for mailboxes.

protected _status(mixed $mboxes, mixed $flags) : array<string|int, mixed>
Parameters
$mboxes : mixed

The list of mailbox objects to query.

$flags : mixed

A bitmask of information requested from the server.

Return values
array<string|int, mixed>

See array return for status().

_store()

Store message flag data.

protected _store(mixed $options) : Horde_Imap_Client_Ids
Parameters
$options : mixed

Additional options.

Return values
Horde_Imap_Client_Ids

A Horde_Imap_Client_Ids object containing the list of IDs that failed the 'unchangedsince' test.

_subscribeMailbox()

Manage subscription status for a mailbox.

protected _subscribeMailbox(Horde_Imap_Client_Mailbox $mailbox, mixed $subscribe) : mixed
Parameters
$mailbox : Horde_Imap_Client_Mailbox

The mailbox to [un]subscribe to.

$subscribe : mixed

True to subscribe, false to unsubscribe.

Return values
mixed

_syncStatus()

Return the current mailbox synchronization status.

protected _syncStatus(mixed $mailbox) : array<string|int, mixed>
Parameters
$mailbox : mixed

A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).

Return values
array<string|int, mixed>

An array with status data. (This data is not guaranteed to have any specific format).

_updateModSeq()

Updates the cached MODSEQ value.

protected _updateModSeq(int $modseq) : mixed
Parameters
$modseq : int

MODSEQ value to store.

Return values
mixed

The MODSEQ of the old value if it was replaced (or false if it didn't exist or is the same).

Search results