PHP Class Horde_ActiveSync_Imap_Adapter, horde

Author: Michael J Rubinsky ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_defaultNamespace string
$_imap Horde_ActiveSync_Interface_ImapFactory
$_logger Horde_Log_Logger
$_procid integer Process id used for logging.

Méthodes publiques

Méthode Description
__construct ( array $params = [] ) Cont'r
appendMessage ( string $folderid, string | stream $msg, array $flags = [] ) : integer | boolean Append a message to the specified mailbox. Used for saving sent email.
categoriesToFlags ( $mailbox, $categories, $uid )
createMailbox ( string $name, string $parent = null ) : string Create a new mailbox on the server, and subscribe to it.
deleteMailbox ( string $name ) Delete a mailbox
deleteMessages ( array $uids, string $folderid ) : array Permanently delete a mail message.
emptyMailbox ( string $mbox ) Completely empty specified mailbox.
getAttachment ( string $mailbox, string $uid, string $part ) : Horde_Mime_Part Return the content of a specific MIME part of the specified message.
getImapMessage ( string $mailbox, array | integer $uid, array $options = [] ) : array Return a complete Horde_ActiveSync_Imap_Message object for the requested uid.
getMailboxes ( ) : array Return an array of available mailboxes. Uses's the mail/mailboxList API method for obtaining the list.
getMessageChanges ( Horde_ActiveSync_Folder_Imap $folder, array $options = [] ) : Horde_ActiveSync_Folder_Imap Return message changes from the specified mailbox.
getMessages ( string $folderid, array $messages, array $options = [] ) : array Return AS mail messages, from the given IMAP UIDs.
getSpecialMailboxes ( ) : array Return the list of special mailboxes.
getUidFromMid ( string $mid, Horde_ActiveSync_Folder_Imap $folder ) : integer Return an array of message UIDs from a list of Message-IDs.
getUidFromMidInFolders ( $id, array $folders ) : array Attempt to find a Message-ID in a list of mail folders.
moveMessage ( string $folderid, array $ids, string $newfolderid ) : array Move a mail message
ping ( Horde_ActiveSync_Folder_Imap $folder ) : boolean Ping a mailbox. This detects only if any new messages have arrived in the specified mailbox.
queryMailbox ( array $query ) : array Perform a search from a search mailbox request.
renameMailbox ( string $old, string $new, string $parent = null ) : string Rename a mailbox
setImapFlag ( string $mailbox, integer $uid, string $flag ) Set a IMAP message flag.
setLogger ( Horde_Log_Logger $logger ) Set this instance's logger.
setMessageFlag ( string $mailbox, integer $uid, Horde_ActiveSync_Message_Flag $flag ) Set a POOMMAIL_FLAG on a mail message. This method differs from setReadFlag() in that it is passed a Flag object, which contains other data beside the seen status. Used for setting flagged for followup and potentially creating tasks based on the email.
setReadFlag ( string $mailbox, string $uid, integer $flag ) Set the message's read status.

Méthodes protégées

Méthode Description
_buildBodyPart ( Horde_ActiveSync_Imap_MessageBodyData $mbd, array $options, Horde_ActiveSync_Message_AirSyncBaseBodypart $message )
_buildHtmlPart ( Horde_ActiveSync_Imap_MessageBodyData $mbd, Horde_ActiveSync_Message_AirSyncBaseBody $message ) Build the HTML body and populate the appropriate message object.
_buildMailMessage ( Horde_Imap_Client_Mailbox $mbox, Horde_Imap_Client_Data_Fetch $data, array $options = [] ) : Horde_ActiveSync_Message_Mail Builds a proper AS mail message object.
_buildSubQuery ( array $query ) : Horde_Imap_Client_Search_Query Helper to build a subquery
_defaultNamespace ( ) : array Return the default namespace.
_doQuery ( array $query ) : array Perform an IMAP search based on a SEARCH request.
_getEASImportance ( string $importance ) : integer Map Importance header values to EAS importance values.
_getImapOb ( ) : Horde_Imap_Client_Base Helper to obtain a valid IMAP client. Can't inject it since the user is not yet authenticated at the time of object creation.
_getMailMessages ( Horde_Imap_Client_Mailbox $mbox, array $uids, array $options = [] ) : Horde_Imap_Fetch_Results
_getMsgFlags ( )
_getNamespace ( $path )
_getNamespacelist ( ) : array Return the list of configured namespaces on the IMAP server.
_getiTipStatus ( Horde_Icalendar $vCal ) Return the attendee participation status.
_mailboxExists ( string $mbox ) : boolean Check existence of a mailbox.
_prependNamespace ( string $name ) : string Prefix the default namespace to mailbox name if needed.

Method Details

__construct() public méthode

Cont'r
public __construct ( array $params = [] )
$params array Parameters: - factory: (Horde_ActiveSync_Interface_ImapFactory) Factory object DEFAULT: none - REQUIRED

_buildBodyPart() protected méthode

protected _buildBodyPart ( Horde_ActiveSync_Imap_MessageBodyData $mbd, array $options, Horde_ActiveSync_Message_AirSyncBaseBodypart $message )
$mbd Horde_ActiveSync_Imap_MessageBodyData
$options array
$message Horde_ActiveSync_Message_AirSyncBaseBodypart

_buildHtmlPart() protected méthode

Build the HTML body and populate the appropriate message object.
protected _buildHtmlPart ( Horde_ActiveSync_Imap_MessageBodyData $mbd, Horde_ActiveSync_Message_AirSyncBaseBody $message )
$mbd Horde_ActiveSync_Imap_MessageBodyData The body data array.
$message Horde_ActiveSync_Message_AirSyncBaseBody The body or bodypart object.

_buildMailMessage() protected méthode

Builds a proper AS mail message object.
protected _buildMailMessage ( Horde_Imap_Client_Mailbox $mbox, Horde_Imap_Client_Data_Fetch $data, array $options = [] ) : Horde_ActiveSync_Message_Mail
$mbox Horde_Imap_Client_Mailbox The IMAP mailbox.
$data Horde_Imap_Client_Data_Fetch The fetch results.
$options array Additional Options: - truncation: (integer) Truncate the message body to this length. DEFAULT: No truncation. - bodyprefs: (array) Bodyprefs, if sent from device. DEFAULT: none (No body prefs sent or enforced). - bodypartprefs: (array) Bodypartprefs, if sent from device. DEFAULT: none (No body part prefs sent or enforced). - mimesupport: (integer) Indicates if MIME is supported or not. Possible values: 0 - Not supported 1 - Only S/MIME or 2 - All MIME. DEFAULT: 0 (No MIME support) - protocolversion: (float) The EAS protocol version to support. DEFAULT: 2.5
Résultat Horde_ActiveSync_Message_Mail The message object suitable for streaming to the device.

_buildSubQuery() protected méthode

Helper to build a subquery
protected _buildSubQuery ( array $query ) : Horde_Imap_Client_Search_Query
$query array A subquery array.
Résultat Horde_Imap_Client_Search_Query The query object.

_defaultNamespace() protected méthode

Return the default namespace.
protected _defaultNamespace ( ) : array
Résultat array The namespace data.

_doQuery() protected méthode

Perform an IMAP search based on a SEARCH request.
protected _doQuery ( array $query ) : array
$query array The search query.
Résultat array The results array containing an array of hashes: 'uniqueid' => [The unique identifier of the result] 'searchfolderid' => [The mailbox name that this result comes from]

_getEASImportance() protected méthode

Map Importance header values to EAS importance values.
protected _getEASImportance ( string $importance ) : integer
$importance string The importance [high|normal|low].
Résultat integer The EAS importance value [0|1|2].

_getImapOb() protected méthode

Helper to obtain a valid IMAP client. Can't inject it since the user is not yet authenticated at the time of object creation.
protected _getImapOb ( ) : Horde_Imap_Client_Base
Résultat Horde_Imap_Client_Base

_getMailMessages() protected méthode

protected _getMailMessages ( Horde_Imap_Client_Mailbox $mbox, array $uids, array $options = [] ) : Horde_Imap_Fetch_Results
$mbox Horde_Imap_Client_Mailbox The mailbox
$uids array An array of message uids
$options array An options array - headers: (boolean) Fetch header text if true. DEFAULT: false (Do not fetch header text). - structure: (boolean) Fetch message structure. DEFAULT: true (Fetch message structure). - flags: (boolean) Fetch messagge flags. DEFAULT: true (Fetch message flags). - envelope: (boolen) Fetch the envelope data. DEFAULT: false (Do not fetch envelope). @since 2.4.0
Résultat Horde_Imap_Fetch_Results The results.

_getMsgFlags() protected méthode

protected _getMsgFlags ( )

_getNamespace() protected méthode

protected _getNamespace ( $path )

_getNamespacelist() protected méthode

Return the list of configured namespaces on the IMAP server.
protected _getNamespacelist ( ) : array
Résultat array

_getiTipStatus() protected méthode

Return the attendee participation status.
protected _getiTipStatus ( Horde_Icalendar $vCal )
$vCal Horde_Icalendar The vCalendar component.

_mailboxExists() protected méthode

Check existence of a mailbox.
protected _mailboxExists ( string $mbox ) : boolean
$mbox string The mailbox name.
Résultat boolean

_prependNamespace() protected méthode

Prefix the default namespace to mailbox name if needed.
protected _prependNamespace ( string $name ) : string
$name string The mailbox name.
Résultat string The mailbox name with the default namespace added, if needed.

appendMessage() public méthode

Append a message to the specified mailbox. Used for saving sent email.
public appendMessage ( string $folderid, string | stream $msg, array $flags = [] ) : integer | boolean
$folderid string The mailbox
$msg string | stream The message
$flags array Any flags to set on the newly appended message.
Résultat integer | boolean The imap uid of the appended message or false on failure. @since 2.37.0

categoriesToFlags() public méthode

public categoriesToFlags ( $mailbox, $categories, $uid )

createMailbox() public méthode

Create a new mailbox on the server, and subscribe to it.
public createMailbox ( string $name, string $parent = null ) : string
$name string The new mailbox name.
$parent string The parent mailbox, if any. @return string The new serverid for the mailbox. This is the UTF-8 name of the mailbox. @since 2.9.0 @throws Horde_ActiveSync_Exception, Horde_ActiveSync_Exception_FolderExists
Résultat string

deleteMailbox() public méthode

Delete a mailbox
public deleteMailbox ( string $name )
$name string The mailbox name to delete.

deleteMessages() public méthode

Permanently delete a mail message.
public deleteMessages ( array $uids, string $folderid ) : array
$uids array The message UIDs
$folderid string The folder id.
Résultat array An array of uids that were successfully deleted.

emptyMailbox() public méthode

Completely empty specified mailbox.
Since: 2.18.0
public emptyMailbox ( string $mbox )
$mbox string The mailbox to empty.

getAttachment() public méthode

Return the content of a specific MIME part of the specified message.
public getAttachment ( string $mailbox, string $uid, string $part ) : Horde_Mime_Part
$mailbox string The mailbox name.
$uid string The message UID.
$part string The MIME part identifier.
Résultat Horde_Mime_Part The attachment data

getImapMessage() public méthode

Return a complete Horde_ActiveSync_Imap_Message object for the requested uid.
public getImapMessage ( string $mailbox, array | integer $uid, array $options = [] ) : array
$mailbox string The mailbox name.
$uid array | integer The message uid.
$options array Additional options: - headers: (boolean) Also fetch the message headers if this is true. DEFAULT: false (Do not fetch headers).
Résultat array An array of Horde_ActiveSync_Imap_Message objects.

getMailboxes() public méthode

Return an array of available mailboxes. Uses's the mail/mailboxList API method for obtaining the list.
public getMailboxes ( ) : array
Résultat array

getMessageChanges() public méthode

Return message changes from the specified mailbox.
public getMessageChanges ( Horde_ActiveSync_Folder_Imap $folder, array $options = [] ) : Horde_ActiveSync_Folder_Imap
$folder Horde_ActiveSync_Folder_Imap The folder object.
$options array Additional options: - sincedate: (integer) Timestamp of earliest message to retrieve. DEFAULT: 0 (Don't filter). - protocolversion: (float) EAS protocol version to support. DEFAULT: none REQUIRED - softdelete: (boolean) If true, calculate SOFTDELETE data. @since 2.8.0 - refreshfilter: (boolean) If true, force refresh the query to reflect changes in FILTERTYPE (using the sincedate) @since 2.28.0
Résultat Horde_ActiveSync_Folder_Imap The folder object, containing any change instructions for the device.

getMessages() public méthode

Return AS mail messages, from the given IMAP UIDs.
public getMessages ( string $folderid, array $messages, array $options = [] ) : array
$folderid string The mailbox folder.
$messages array List of IMAP message UIDs
$options array Additional Options: - truncation: (integer) The truncation constant, if sent from device. DEFAULT: false (No truncation). - bodyprefs: (array) The bodypref settings, if sent from device. DEFAULT: none (No body prefs sent, or enforced). - bodypartprefs: (array) The bodypartprefs settings, if present. - mimesupport: (integer) Indicates if MIME is supported or not. Possible values: 0 - Not supported 1 - Only S/MIME or 2 - All MIME. DEFAULT: 0 (No MIME support) - protocolversion: (float) The EAS protocol version to support. DEFAULT: 2.5
Résultat array An array of Horde_ActiveSync_Message_Mail objects.

getSpecialMailboxes() public méthode

Return the list of special mailboxes.
public getSpecialMailboxes ( ) : array
Résultat array

getUidFromMid() public méthode

Return an array of message UIDs from a list of Message-IDs.
public getUidFromMid ( string $mid, Horde_ActiveSync_Folder_Imap $folder ) : integer
$mid string The Message-ID
$folder Horde_ActiveSync_Folder_Imap The folder object to search.
Résultat integer The UID

getUidFromMidInFolders() public méthode

Attempt to find a Message-ID in a list of mail folders.
Deprecation: This is unused and should be removed.
public getUidFromMidInFolders ( $id, array $folders ) : array
$folders array
Résultat array An array with the 0 element being the mbox

moveMessage() public méthode

Move a mail message
public moveMessage ( string $folderid, array $ids, string $newfolderid ) : array
$folderid string The existing folderid.
$ids array The message UIDs of the messages to move.
$newfolderid string The folder id to move $id to.
Résultat array An hash of oldUID => newUID.

ping() public méthode

Ping a mailbox. This detects only if any new messages have arrived in the specified mailbox.
public ping ( Horde_ActiveSync_Folder_Imap $folder ) : boolean
$folder Horde_ActiveSync_Folder_Imap The folder object.
Résultat boolean True if changes were detected, otherwise false.

queryMailbox() public méthode

Perform a search from a search mailbox request.
public queryMailbox ( array $query ) : array
$query array The query array.
Résultat array An array of 'uniqueid', 'searchfolderid' hashes.

renameMailbox() public méthode

Rename a mailbox
public renameMailbox ( string $old, string $new, string $parent = null ) : string
$old string The old mailbox name.
$new string The new mailbox name.
$parent string The parent mailbox, if any.
Résultat string The new serverid for the mailbox. @since 2.9.0

setImapFlag() public méthode

Set a IMAP message flag.
public setImapFlag ( string $mailbox, integer $uid, string $flag )
$mailbox string The mailbox name.
$uid integer The message UID.
$flag string The flag to set. A Horde_ActiveSync:: constant.

setLogger() public méthode

Set this instance's logger.
public setLogger ( Horde_Log_Logger $logger )
$logger Horde_Log_Logger The logger.

setMessageFlag() public méthode

Set a POOMMAIL_FLAG on a mail message. This method differs from setReadFlag() in that it is passed a Flag object, which contains other data beside the seen status. Used for setting flagged for followup and potentially creating tasks based on the email.
public setMessageFlag ( string $mailbox, integer $uid, Horde_ActiveSync_Message_Flag $flag )
$mailbox string The mailbox name.
$uid integer The message uid.
$flag Horde_ActiveSync_Message_Flag The flag

setReadFlag() public méthode

Set the message's read status.
public setReadFlag ( string $mailbox, string $uid, integer $flag )
$mailbox string The mailbox name.
$uid string The message uid.
$flag integer Horde_ActiveSync_Message_Mail::FLAG_* constant

Property Details

$_defaultNamespace protected_oe property

protected string $_defaultNamespace
Résultat string

$_imap protected_oe property

protected Horde_ActiveSync_Interface_ImapFactory $_imap
Résultat Horde_ActiveSync_Interface_ImapFactory

$_logger protected_oe property

protected Horde_Log_Logger $_logger
Résultat Horde_Log_Logger

$_procid protected_oe property

Process id used for logging.
protected int $_procid
Résultat integer