Horde_Kolab_Storage_Driver_Imap
extends Horde_Kolab_Storage_Driver_Base
in package
The IMAP driver class for accessing Kolab storage.
Copyright 2009-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
- $_namespace : Horde_Kolab_Storage_Folder_Namespace
- Memory cache for the namespace of this driver.
- $charset : string
- Charset used by this driver.
- $_backend : mixed
- The backend to use.
- $_factory : Horde_Kolab_Storage_Factory
- Factory for generating helper objects.
- $_params : array<string|int, mixed>
- Additional connection parameters.
- __construct() : mixed
- Constructor.
- appendMessage() : mixed
- Appends a message to the given folder.
- create() : null
- Create the specified folder.
- createBackend() : mixed
- Create the backend driver.
- delete() : null
- Delete the specified folder.
- deleteAcl() : null
- Delete the access rights for user on a folder.
- deleteMessages() : null
- Deletes messages from the specified folder.
- expunge() : null
- Expunges messages in the current folder.
- fetchBodypart() : resource
- Retrieves a bodypart for the given message ID and mime part ID.
- fetchComplete() : array<string|int, mixed>
- Retrieves a complete message.
- fetchHeaders() : Horde_Mime_Headers
- Retrieves the message headers.
- fetchStructure() : array<string|int, mixed>
- Retrieves the messages for the given message ids.
- getAcl() : An
- Retrieve the access rights for a folder.
- getAnnotation() : string
- Fetches the annotation from a folder.
- getAuth() : string
- Return the id of the user currently authenticated.
- getBackend() : mixed
- Returns the actual backend driver.
- getId() : string
- Return the unique connection id.
- getModifiable() : Horde_Kolab_Storage_Driver_Modifiable
- Return a modifiable message object.
- getMyAcl() : string
- Retrieve the access rights the current user has on a folder.
- getNamespace() : Horde_Kolab_Storage_Driver_Namespace
- Retrieve the namespace information for this connection.
- getParam() : mixed
- Return a parameter setting for this connection.
- getParameters() : array<string|int, mixed>
- Return the connection parameters.
- getParams() : array<string|int, mixed>
- Return all parameter settings for this connection.
- getStamp() : Horde_Kolab_Storage_Folder_Stamp
- Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data.
- getStampFromToken() : Horde_Kolab_Storage_Folder_Stamp
- Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data. This method, as opposed to self::getStamp(), uses the IMAP client's token to calculate the changes.
- getUids() : array<string|int, mixed>
- Returns the message ids of the messages in this folder.
- hasAclSupport() : bool
- Does the backend support ACL?
- hasCatenateSupport() : bool
- Checks if the backend supports CATENATE.
- listAnnotation() : array<string|int, mixed>
- Retrieves the specified annotation for the complete list of folders.
- listFolders() : array<string|int, mixed>
- Retrieves a list of folders from the server.
- moveMessage() : null
- Moves a message to a new folder.
- rename() : null
- Rename the specified folder.
- select() : null
- Opens the given folder.
- setAcl() : null
- Set the access rights for a folder.
- setAnnotation() : null
- Sets the annotation on a folder.
- setBackend() : null
- Set the backend driver.
- setParam() : null
- Set a parameter setting for this connection.
- status() : array<string|int, mixed>
- Returns the status of the current folder.
- sync() : array<string|int, mixed>
- Synchrozine using a token provided by the IMAP client.
- _getAnnotateMoreEntry() : array<string|int, mixed>
- Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.
- decodeList() : array<string|int, mixed>
- Decode a list of IMAP path names from the driver charset to UTF-8.
- decodeListKeys() : array<string|int, mixed>
- Decode the keys of a list of IMAP path names from the driver charset to UTF-8.
- decodePath() : string
- Decode IMAP path names from the driver charset to UTF-8.
- encodePath() : string
- Encode IMAP path names from UTF-8 to the driver charset.
- getFactory() : Horde_Kolab_Storage_Factory
- Return the factory.
Properties
$_namespace
Memory cache for the namespace of this driver.
protected
Horde_Kolab_Storage_Folder_Namespace
$_namespace
$charset
Charset used by this driver.
protected
string
$charset
= 'UTF7-IMAP'
$_backend
The backend to use.
private
mixed
$_backend
$_factory
Factory for generating helper objects.
private
Horde_Kolab_Storage_Factory
$_factory
$_params
Additional connection parameters.
private
array<string|int, mixed>
$_params
Methods
__construct()
Constructor.
public
__construct(Horde_Kolab_Storage_Factory $factory[, array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $factory : Horde_Kolab_Storage_Factory
-
A factory for helper objects.
- $params : array<string|int, mixed> = array()
-
Connection parameters.
Return values
mixed —appendMessage()
Appends a message to the given folder.
public
appendMessage(string $folder, resource $msg) : mixed
Parameters
- $folder : string
-
The folder to append the message(s) to.
- $msg : resource
-
The message to append.
Return values
mixed —True or the UID of the new message in case the backend supports UIDPLUS.
create()
Create the specified folder.
public
create(string $folder) : null
Parameters
- $folder : string
-
The folder to create.
Return values
null —createBackend()
Create the backend driver.
public
createBackend() : mixed
Return values
mixed —The backend driver.
delete()
Delete the specified folder.
public
delete(string $folder) : null
Parameters
- $folder : string
-
The folder to delete.
Return values
null —deleteAcl()
Delete the access rights for user on a folder.
public
deleteAcl(string $folder, string $user) : null
Parameters
- $folder : string
-
The folder to act upon.
- $user : string
-
The user to delete the ACL for
Return values
null —deleteMessages()
Deletes messages from the specified folder.
public
deleteMessages(string $folder, int $uids) : null
Parameters
- $folder : string
-
The folder to delete messages from.
- $uids : int
-
IMAP message ids.
Return values
null —expunge()
Expunges messages in the current folder.
public
expunge(string $folder) : null
Parameters
- $folder : string
-
The folder to expunge.
Return values
null —fetchBodypart()
Retrieves a bodypart for the given message ID and mime part ID.
public
fetchBodypart(string $folder, array<string|int, mixed> $uid, array<string|int, mixed> $id) : resource
Parameters
- $folder : string
-
The folder to fetch the messages from.
- $uid : array<string|int, mixed>
-
The message UID.
- $id : array<string|int, mixed>
-
The mime part ID.
Return values
resource —The body part, as a stream resource. The contents are already transfer decoded and presented as 8bit data.
fetchComplete()
Retrieves a complete message.
public
fetchComplete(string $folder, array<string|int, mixed> $uid) : array<string|int, mixed>
Parameters
- $folder : string
-
The folder to fetch the messages from.
- $uid : array<string|int, mixed>
-
The message UID.
Return values
array<string|int, mixed> —The message encapsuled as an array that contains a Horde_Mime_Headers and a Horde_Mime_Part object.
fetchHeaders()
Retrieves the message headers.
public
fetchHeaders(string $folder, array<string|int, mixed> $uid) : Horde_Mime_Headers
Parameters
- $folder : string
-
The folder to fetch the message from.
- $uid : array<string|int, mixed>
-
The message UID.
Return values
Horde_Mime_Headers —The message headers.
fetchStructure()
Retrieves the messages for the given message ids.
public
fetchStructure(string $folder, array<string|int, mixed> $uids) : array<string|int, mixed>
Parameters
- $folder : string
-
The folder to fetch the messages from.
- $uids : array<string|int, mixed>
-
The message UIDs.
Return values
array<string|int, mixed> —An array of message structures parsed into Horde_Mime_Part instances.
getAcl()
Retrieve the access rights for a folder.
public
getAcl(Horde_Kolab_Storage_Folder $folder) : An
Parameters
- $folder : Horde_Kolab_Storage_Folder
-
The folder to retrieve the ACL for.
Return values
An —array of rights.
getAnnotation()
Fetches the annotation from a folder.
public
getAnnotation(string $folder, string $annotation) : string
Parameters
- $folder : string
-
The name of the folder.
- $annotation : string
-
The annotation to get.
Return values
string —The annotation value.
getAuth()
Return the id of the user currently authenticated.
public
getAuth() : string
Return values
string —The id of the user that opened the IMAP connection.
getBackend()
Returns the actual backend driver.
public
getBackend() : mixed
If there is no driver set the driver should be constructed within this method.
Return values
mixed —The backend driver.
getId()
Return the unique connection id.
public
getId() : string
Return values
string —The connection id.
getModifiable()
Return a modifiable message object.
public
getModifiable(string $folder, string $obid, array<string|int, mixed> $object) : Horde_Kolab_Storage_Driver_Modifiable
Parameters
- $folder : string
-
The folder to access.
- $obid : string
-
The backend ID of the object to retrieve from the folder.
- $object : array<string|int, mixed>
-
The object data.
Return values
Horde_Kolab_Storage_Driver_Modifiable —The modifiable message object.
getMyAcl()
Retrieve the access rights the current user has on a folder.
public
getMyAcl(string $folder) : string
Parameters
- $folder : string
-
The folder to retrieve the user ACL for.
Return values
string —The user rights.
getNamespace()
Retrieve the namespace information for this connection.
public
getNamespace() : Horde_Kolab_Storage_Driver_Namespace
Return values
Horde_Kolab_Storage_Driver_Namespace —The initialized namespace handler.
getParam()
Return a parameter setting for this connection.
public
getParam(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
-
The parameter key.
- $default : mixed = null
-
An optional default value.
Return values
mixed —The parameter value.
getParameters()
Return the connection parameters.
public
getParameters() : array<string|int, mixed>
Return values
array<string|int, mixed> —The connection parameters.
getParams()
Return all parameter settings for this connection.
public
getParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —The parameters.
getStamp()
Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data.
public
getStamp(string $folder) : Horde_Kolab_Storage_Folder_Stamp
Parameters
- $folder : string
-
Return the stamp for this folder.
Return values
Horde_Kolab_Storage_Folder_Stamp —A stamp indicating the current folder status.
getStampFromToken()
Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data. This method, as opposed to self::getStamp(), uses the IMAP client's token to calculate the changes.
public
getStampFromToken(string $folder, string $token, array<string|int, mixed> $ids) : Horde_Kolab_Storage_Folder_Stamp
Parameters
- $folder : string
-
Return the stamp for this folder.
- $token : string
-
A sync token provided by the IMAP server.
- $ids : array<string|int, mixed>
-
An array of UIDs that we know about.
Return values
Horde_Kolab_Storage_Folder_Stamp —A stamp indicating the current folder status.
getUids()
Returns the message ids of the messages in this folder.
public
getUids(string $folder) : array<string|int, mixed>
Parameters
- $folder : string
-
Check the status of this folder.
Return values
array<string|int, mixed> —The message ids.
hasAclSupport()
Does the backend support ACL?
public
hasAclSupport() : bool
Return values
bool —True if the backend supports ACLs.
hasCatenateSupport()
Checks if the backend supports CATENATE.
public
hasCatenateSupport() : bool
Return values
bool —True if the backend supports CATENATE.
listAnnotation()
Retrieves the specified annotation for the complete list of folders.
public
listAnnotation(string $annotation) : array<string|int, mixed>
Parameters
- $annotation : string
-
The name of the annotation to retrieve.
Return values
array<string|int, mixed> —An associative array combining the folder names as key with the corresponding annotation value.
listFolders()
Retrieves a list of folders from the server.
public
listFolders() : array<string|int, mixed>
Return values
array<string|int, mixed> —The list of folders.
moveMessage()
Moves a message to a new folder.
public
moveMessage(int $uid, string $old_folder, string $new_folder) : null
Parameters
- $uid : int
-
IMAP message id.
- $old_folder : string
-
Source folder.
- $new_folder : string
-
Target folder.
Return values
null —rename()
Rename the specified folder.
public
rename(string $old, string $new) : null
Parameters
- $old : string
-
The folder to rename.
- $new : string
-
The new name of the folder.
Return values
null —select()
Opens the given folder.
public
select(string $folder[, mixed $mode = Horde_Imap_Client::OPEN_AUTO ]) : null
Parameters
- $folder : string
-
The folder to open
- $mode : mixed = Horde_Imap_Client::OPEN_AUTO
Return values
null —setAcl()
Set the access rights for a folder.
public
setAcl(string $folder, string $user, string $acl) : null
Parameters
- $folder : string
-
The folder to act upon.
- $user : string
-
The user to set the ACL for.
- $acl : string
-
The ACL.
Return values
null —setAnnotation()
Sets the annotation on a folder.
public
setAnnotation(string $folder, string $annotation, array<string|int, mixed> $value) : null
Parameters
- $folder : string
-
The name of the folder.
- $annotation : string
-
The annotation to set.
- $value : array<string|int, mixed>
-
The values to set
Return values
null —setBackend()
Set the backend driver.
public
setBackend(mixed $backend) : null
Parameters
- $backend : mixed
-
The driver that should be used.
Return values
null —setParam()
Set a parameter setting for this connection.
public
setParam(string $key, mixed $value) : null
Parameters
- $key : string
-
The parameter key.
- $value : mixed
-
The parameter value.
Return values
null —status()
Returns the status of the current folder.
public
status(string $folder) : array<string|int, mixed>
Parameters
- $folder : string
-
Check the status of this folder.
Return values
array<string|int, mixed> —An array that contains 'uidvalidity', 'uidnext', and 'token'.
sync()
Synchrozine using a token provided by the IMAP client.
public
sync(string $folder, string $token[, array<string|int, mixed> $ids = array() ]) : array<string|int, mixed>
Parameters
- $folder : string
-
The folder to synchronize.
- $token : string
-
The sync token provided by the IMAP client.
- $ids : array<string|int, mixed> = array()
-
The list of IMAP message UIDs we currently know about. If omitted, the server will return VANISHED data only if it supports QRESYNC.
Return values
array<string|int, mixed> —An array containing the following keys and values: Horde_Kolab_Storage_Folder_Stamp_Uids::DELETED - Contains the UIDs that have VANISHED from the IMAP server. Horde_Kolab_Storage_Folder_Stamp_Uids::ADDED - Contains the UIDs that have been added to the IMAP server since the last sync.
_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
Return values
array<string|int, mixed> —A list of two elements: The entry name and the value type.
decodeList()
Decode a list of IMAP path names from the driver charset to UTF-8.
protected
decodeList(array<string|int, mixed> $list) : array<string|int, mixed>
Parameters
- $list : array<string|int, mixed>
-
The the driver charset encoded path names.
Return values
array<string|int, mixed> —The path names in UTF-8.
decodeListKeys()
Decode the keys of a list of IMAP path names from the driver charset to UTF-8.
protected
decodeListKeys(array<string|int, mixed> $list) : array<string|int, mixed>
Parameters
- $list : array<string|int, mixed>
-
The list with the driver charset encoded path names as keys.
Return values
array<string|int, mixed> —The list with path names in UTF-8 as keys.
decodePath()
Decode IMAP path names from the driver charset to UTF-8.
protected
decodePath(string $path) : string
Parameters
- $path : string
-
The the driver charset encoded path name.
Return values
string —The path name in UTF-8.
encodePath()
Encode IMAP path names from UTF-8 to the driver charset.
protected
encodePath(string $path) : string
Parameters
- $path : string
-
The UTF-8 encoded path name.
Return values
string —The path name in the driver charset.
getFactory()
Return the factory.
protected
getFactory() : Horde_Kolab_Storage_Factory
Return values
Horde_Kolab_Storage_Factory —The factory.