Documentation

Horde_Core_ActiveSync_Driver extends Horde_ActiveSync_Driver_Base
in package

Horde backend.

Provides the communication between horde data and ActiveSync server.

Tags
author

Michael J. Rubinsky mrubinsk@horde.org

Table of Contents

Constants

APPOINTMENTS_FOLDER_UID  = '@Calendar@'
Server folder ids for non-email folders.
CONTACTS_FOLDER_UID  = '@Contacts@'
FOLDER_PART_CLASS  = 0
FOLDER_PART_ID  = 1
NOTES_FOLDER_UID  = '@Notes@'
SPECIAL_DRAFTS  = 'drafts'
SPECIAL_INBOX  = 'inbox'
SPECIAL_OUTBOX  = 'outbox'
SPECIAL_SENT  = 'sent'
SPECIAL_SPAM  = 'spam'
SPECIAL_TRASH  = 'trash'
TASKS_FOLDER_UID  = '@Tasks@'

Properties

$_auth  : Horde_Core_ActiveSync_Auth
Authentication object
$_classMap  : array<string|int, mixed>
Class => Id map
$_connector  : Horde_Core_ActiveSync_Connector
Horde connector instance
$_displayMap  : array<string|int, mixed>
Mappings for server uids -> display names. Populated in the const'r so we can use localized text.
$_folders  : array<string|int, mixed>
Local cache of folders polled from the various backends.
$_imap  : Horde_ActiveSync_Imap_Adapter
Imap client adapter
$_modCache  : array<string|int, mixed>
Cache message stats
$_pid  : int
Current process id
$_verbs  : array<string|int, mixed>
Local cache of last verb searches.

Methods

__construct()  : mixed
Const'r
authenticate()  : mixed
Authenticate to Horde
autoDiscover()  : array<string|int, mixed>
Attempt to autodiscover. Autodiscovery happens before the user is authenticated, and ALWAYS uses the user's email address. We have to do our best to translate email address to username. If this fails, the device simply falls back to requiring full user configuration.
buildFbString()  : string
Build a EAS style FB string. Essentially, each digit represents 1/2 hour.
changeFolder()  : Horde_ActiveSync_Message_Folder
Change a folder on the server.
changeMessage()  : array<string|int, mixed>|bool
Add/Edit a message
clearAuthentication()  : mixed
Clean up
createDeviceCallback()  : bool|int
Callback method called before new device is created for a user. Allows final check of permissions.
deleteFolder()  : mixed
Delete a folder on the server.
deleteMessage()  : array<string|int, mixed>
Delete a message
deviceCallback()  : bool|int
Callback that allows custom policy checking on the device before allowing it to connect. Useful for things like limiting the types of devices that can connect e.g., not allowing iOS devices etc.
getAttachment()  : array<string|int, mixed>
Return the specified attachment.
getCurrentPolicy()  : array<string|int, mixed>
Return the security policies.
getFolder()  : Horde_ActiveSync_Message_Folder
Return a Horde_ActiveSync_Message_Folder object.
getFolderList()  : array<string|int, mixed>
Return an array of stats for the server's folder list.
getFolders()  : array<string|int, mixed>
Return an array of the server's folder objects.
getFreebusy()  : mixed
Request freebusy information from the server
getMessage()  : Horde_ActiveSync_Message_Base
Obtain an ActiveSync message from the backend.
getProvisioning()  : mixed
Returns the provisioning support for the current request.
getSearchResults()  : array<string|int, mixed>
Returns array of items which contain contact information
getServerChanges()  : array<string|int, mixed>
Get a list of server changes that occured during the specified time period.
getSettings()  : array<string|int, mixed>
Return settings from the backend for a SETTINGS request.
getSpecialFolderNameByType()  : string|bool
Return the server id of the specified special folder type.
getSyncStamp()  : int|bool
Return the SyncStamp - the value used to determine the end of the current sync range. If the collection backend supports modification sequences, we will use that, otherwise return the current timestamp.
getUsernameFromEmail()  : string
Attempt to guess a username based on the email address passed from EAS Autodiscover requests.
getWasteBasket()  : string|bool
Get the wastebasket folder. If this returns false, imap deletions are permanent. If it returns a valid mailbox, deletions are treated as moves to this mailbox. Note that any collection class other than Horde_ActiveSync::CLASS_EMAIL will return false.
itemOperationsEmptyFolder()  : mixed
Empty specified mailbox.
itemOperationsFetchMailbox()  : Horde_ActiveSync_Message_Base
Return Horde_Imap_Message_Mail object represented by the specified longid. Used to fetch email objects from a search result, which only returns a 'longid'.
itemOperationsGetAttachmentData()  : Horde_ActiveSync_Message_AirSyncBaseFileAttachment
Return the specified attachement data for an ITEMOPERATIONS request.
itemOperationsGetDocumentLibraryLink()  : array<string|int, mixed>
Return a documentlibrary item.
meetingResponse()  : string
Handle meeting responses.
modifyDeviceCallback()  : Horde_ActiveSync_Device
Allow modification of device properties before request processing continues.
moveMessage()  : array<string|int, mixed>
Move message
resolveRecipient()  : array<string|int, mixed>
Handle ResolveRecipient requests
sendMail()  : bool
Sends the email represented by the rfc822 string received by the PIM.
setDevice()  : mixed
Set the currently connected device
setLogger()  : mixed
Set the logger.
setReadFlag()  : mixed
Set the read (\seen) flag on the specified message.
setSettings()  : array<string|int, mixed>
Set backend settings from a SETTINGS request.
setup()  : bool
Setup sync parameters. The user provided here is the user the backend will sync with. This allows you to authenticate as one user, and sync as another, if the backend supports this (Horde does not).
statFolder()  : a
Stat folder. Note that since the only thing that can ever change for a folder is the name, we use that as the 'mod' value.
statMailMessage()  : array<string|int, mixed>
Build a stat structure for an email message.
statMessage()  : mixed
Get message stat data
_buildDummyFolder()  : mixed
_buildNonMailFolder()  : Horde_ActiveSync_Message_Folder
Helper to build a folder object for non-email folders.
_endBuffer()  : mixed
End output buffering, log any unexpected output.
_getFolder()  : Horde_ActiveSync_Message_Folder
Factory for creating new Horde_ActiveSync_Message_Folder objects from within this class.
_getIdentityFromAddress()  : string
Return the current user's From/Reply_To address.
_getLastVerb()  : array<string|int, mixed>
Return the last verb executed for the specified Message-ID.
_getMailFolder()  : Horde_ActiveSync_Message_Folder
Return a folder object representing an email folder. Attempt to detect special folders appropriately.
_getMailFolders()  : array<string|int, mixed>
Return the list of mail server folders.
_getMaillogChanges()  : Horde_ActiveSync_Folder_Imap
Get verb changes from the maillog.
_getPolicyFromPerms()  : array<string|int, mixed>
Return a policy array suitable for transforming into either wbxml or xml to send to the device in the provision response.
_getPolicyValue()  : mixed
_mungeCert()  : string
Removes the beginning/ending delimiters from the certificate.
_parseFolderId()  : string|array<string|int, mixed>
Parse a folderid.
_searchGal()  : array<string|int, mixed>
Perform a search of the Global Address Book.
_searchMailbox()  : array<string|int, mixed>
Perform a search of the email store.
_smartStatMessage()  : message
Stat a backend item, optionally using the cached value if available.

Constants

APPOINTMENTS_FOLDER_UID

Server folder ids for non-email folders.

public mixed APPOINTMENTS_FOLDER_UID = '@Calendar@'

We use the @ modifiers to avoid issues in the (fringe) case of having email folders named like contacts etc...

CONTACTS_FOLDER_UID

public mixed CONTACTS_FOLDER_UID = '@Contacts@'

FOLDER_PART_CLASS

public mixed FOLDER_PART_CLASS = 0

FOLDER_PART_ID

public mixed FOLDER_PART_ID = 1

NOTES_FOLDER_UID

public mixed NOTES_FOLDER_UID = '@Notes@'

SPECIAL_DRAFTS

public mixed SPECIAL_DRAFTS = 'drafts'

SPECIAL_INBOX

public mixed SPECIAL_INBOX = 'inbox'

SPECIAL_OUTBOX

public mixed SPECIAL_OUTBOX = 'outbox'

SPECIAL_SENT

public mixed SPECIAL_SENT = 'sent'

SPECIAL_SPAM

public mixed SPECIAL_SPAM = 'spam'

SPECIAL_TRASH

public mixed SPECIAL_TRASH = 'trash'

TASKS_FOLDER_UID

public mixed TASKS_FOLDER_UID = '@Tasks@'

Properties

$_classMap

Class => Id map

protected array<string|int, mixed> $_classMap = array(\Horde_ActiveSync::CLASS_TASKS => self::TASKS_FOLDER_UID, \Horde_ActiveSync::CLASS_CALENDAR => self::APPOINTMENTS_FOLDER_UID, \Horde_ActiveSync::CLASS_CONTACTS => self::CONTACTS_FOLDER_UID, \Horde_ActiveSync::CLASS_NOTES => self::NOTES_FOLDER_UID)

$_displayMap

Mappings for server uids -> display names. Populated in the const'r so we can use localized text.

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

$_folders

Local cache of folders polled from the various backends.

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

$_imap

Imap client adapter

protected Horde_ActiveSync_Imap_Adapter $_imap

$_modCache

Cache message stats

protected array<string|int, mixed> $_modCache

An array of stat hashes

$_pid

Current process id

protected int $_pid

$_verbs

Local cache of last verb searches.

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

Methods

__construct()

Const'r

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

Configuration parameters:

  • logger: (Horde_Log_Logger) The logger. DEFAULT: none (No logging).

  • state: (Horde_ActiveSync_State_Base) The state driver. DEFAULT: none (REQUIRED).

  • connector: (Horde_Core_ActiveSync_Connector) The connector object for communicating with the registry. DEFAULT: none (REQUIRED)

  • auth: (Horde_Core_ActiveSync_Auth) The auth object. DEFAULT: none (REQUIRED).

  • imap: (Horde_ActiveSync_Imap_Adapter) The IMAP adapter if email support is desired. DEFAULT: none (No email support will be provided).

  • cache: (Horde_Cache) A cache object to store certain types of data, such as mailbox search results. @since 2.12.0

authenticate()

Authenticate to Horde

public authenticate(string $username, string $password[, string $domain = null ]) : mixed
Parameters
$username : string

The username to authenticate as (as passed by the device).

$password : string

The password

$domain : string = null

The user domain (unused in this driver).

Return values
mixed

Boolean true on success, boolean false on credential failure or Horde_ActiveSync::AUTH_REASON_* constant on policy failure.

autoDiscover()

Attempt to autodiscover. Autodiscovery happens before the user is authenticated, and ALWAYS uses the user's email address. We have to do our best to translate email address to username. If this fails, the device simply falls back to requiring full user configuration.

public autoDiscover([array<string|int, mixed> $params = array() ][, int $version = 1 ]) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed> = array()

Optional array of parameters.

$version : int = 1

The Autodisover protocol version. Defaults to 1. @since 2.32.0

Return values
array<string|int, mixed>

Either an array of autodiscover parameters that the ActiveSync server will use to build the response, or the raw XML response contained in the raw_xml key.

buildFbString()

Build a EAS style FB string. Essentially, each digit represents 1/2 hour.

public static buildFbString(stdClass $fb, Horde_Date $start, Horde_Date $end) : string

The values are as follows: 0 - Free 1 - Tentative 2 - Busy 3 - OOF 4 - No data available.

Though currently we only provide a Free/Busy/Unknown differentiation.

Parameters
$fb : stdClass

The fb information. An object containing:

  • s: The start of the period covered.
  • e: The end of the period covered.
  • b: An array of busy periods.
$start : Horde_Date

The start of the period requested by the client.

$end : Horde_Date

The end of the period requested by the client.

Tags
since
2.4.0
Return values
string

The EAS freebusy string.

changeFolder()

Change a folder on the server.

public changeFolder(string $old_name, string $new_name, string $parent[, string $uid = null ][, int $type = null ]) : Horde_ActiveSync_Message_Folder
Parameters
$old_name : string

The server's existing folder id.

$new_name : string

The new display name.

$parent : string

The folder's parent server id, if needed.

$uid : string = null

The existing folder uid, if this is an edit. @since 2.5.0 (@todo Look at this for H6. It's here now to save an extra DB lookup for data we already have.)

$type : int = null

The EAS Folder type. @since 2.12.0

Tags
throws
Horde_ActiveSync_Exception
Return values
Horde_ActiveSync_Message_Folder

changeMessage()

Add/Edit a message

public changeMessage(string $folderid, string $id, Horde_ActiveSync_Message_Base $message, Horde_ActiveSync_Device $device) : array<string|int, mixed>|bool
Parameters
$folderid : string

The server id of the message's folder.

$id : string

The server's uid for the message if this is a change to an existing message, false if new.

$message : Horde_ActiveSync_Message_Base

The activesync message.

$device : Horde_ActiveSync_Device

The device information @since 2.5.0

Return values
array<string|int, mixed>|bool

A stat array if successful, otherwise false. Contains the following keys:

  • id: (mixed) The UID of the message/item.
  • mod: (mixed) A value to indicate the last modification.
  • flags: (array) An array of flag chagnes, empty array if no changes.
  • categories: (array|boolean) An array of EAS categories for email messages that exist as IMAP flags, false if no changes.
  • atchash: (array|boolean) An array of clientid->filereference mappings for file attachment changes made to appointment or draft email folders. @since 2.27.0
  • conversationid: (hex encoded opaque value) The conversationid value if adding Draft email message. @since 2.28.0
  • conversationindex: (integer) The conversation index value if adding Draft email message @since 2.28.0

clearAuthentication()

Clean up

public clearAuthentication() : mixed
Tags
see

Horde_ActiveSync_Driver_Base#clearAuthentication()

createDeviceCallback()

Callback method called before new device is created for a user. Allows final check of permissions.

public createDeviceCallback(Horde_ActiveSync_Device $device) : bool|int
Parameters
$device : Horde_ActiveSync_Device
Return values
bool|int

True on success (device allowed to be created) or error code on failure.

deleteFolder()

Delete a folder on the server.

public deleteFolder(string $id[, string $parent = Horde_ActiveSync::FOLDER_ROOT ]) : mixed
Parameters
$id : string

The server's folder id.

$parent : string = Horde_ActiveSync::FOLDER_ROOT

The folder's parent, if needed. @deprecated

Tags
throws
Horde_ActiveSync_Exception_DeletionNotSupported

Horde_ActiveSync_Exception

deleteMessage()

Delete a message

public deleteMessage(string $folderid, array<string|int, mixed> $ids[, bool $instanceids = false ]) : array<string|int, mixed>
Parameters
$folderid : string

The folder id

$ids : array<string|int, mixed>

The message ids to delete

$instanceids : bool = false

If true, $ids is a hash of instanceids => uids. @since 2.23.0

Return values
array<string|int, mixed>

An array of succesfully deleted messages (currently only guarenteed for email messages).

deviceCallback()

Callback that allows custom policy checking on the device before allowing it to connect. Useful for things like limiting the types of devices that can connect e.g., not allowing iOS devices etc.

public deviceCallback(Horde_ActiveSync_Device $device) : bool|int

.

Parameters
$device : Horde_ActiveSync_Device

The device object.

Return values
bool|int

True on success (device allowed to be created) or error code on failure.

getAttachment()

Return the specified attachment.

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

The attachment identifier. For this driver, this consists of 'mailbox:uid:mimepart'

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

Any options requested. Currently supported:

  • stream: (boolean) Return a stream resource for the mime contents. DEFAULT: true (Return a stream resource for the 'data' value).
Return values
array<string|int, mixed>

The attachment in the form of an array with the following structure: array('content-type' => {the content-type of the attachement}, 'data' => {the raw attachment data})

getCurrentPolicy()

Return the security policies.

public getCurrentPolicy([bool|array<string|int, mixed> $device = false ]) : array<string|int, mixed>
Parameters
$device : bool|array<string|int, mixed> = false

The device information sent by EAS 14.1 set to false otherwise.

Return values
array<string|int, mixed>

An array of provisionable properties and values.

getFolder()

Return a Horde_ActiveSync_Message_Folder object.

public getFolder(string $id) : Horde_ActiveSync_Message_Folder
Parameters
$id : string

The folder's server id.

Tags
throws
Horde_ActiveSync_Exception
Return values
Horde_ActiveSync_Message_Folder

getFolderList()

Return an array of stats for the server's folder list.

public getFolderList() : array<string|int, mixed>
Tags
todo

Horde 6 move to base class

Return values
array<string|int, mixed>

An array of folder stats @see self::statFolder()

getFolders()

Return an array of the server's folder objects.

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

An array of Horde_ActiveSync_Message_Folder objects.

getFreebusy()

Request freebusy information from the server

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

Will be removed in H6 - this is provided via self::resolveRecipients().

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

getMessage()

Obtain an ActiveSync message from the backend.

public getMessage(string $folderid, string $id, array<string|int, mixed> $collection) : Horde_ActiveSync_Message_Base
Parameters
$folderid : string

The server's folder id this message is from

$id : string

The server's message id

$collection : array<string|int, mixed>

The colletion data. May contain things like:

  • mimesupport: (integer) Indicates if the device has MIME support. DEFAULT: 0 (No MIME support)
  • truncation: (integer) Non-MIME truncation limit. Anything larger than this amount of bytes will be truncated. DEFAULT: 0 (No truncation)
  • mimetruncation: (integer) MIME truncation limit. Anything larger than this amount of bytes will be truncated. DEFAULT: 0 (No truncation)
  • bodyprefs: (array) The bodypref array from the device.
  • type: (integer) The Horde_ActiveSync::FOLDER_TYPE_* for this collection.
Tags
throws
Horde_ActiveSync_Exception

Horde_Exception_NotFound

Return values
Horde_ActiveSync_Message_Base

The message data

getProvisioning()

Returns the provisioning support for the current request.

public getProvisioning([Horde_ActiveSync_Device $device = null ]) : mixed
Parameters
$device : Horde_ActiveSync_Device = null

The device object. @since 2.16.0

Return values
mixed

The value of the provisiong support flag.

getSearchResults()

Returns array of items which contain contact information

public getSearchResults(string $type, array<string|int, mixed> $query) : array<string|int, mixed>
Parameters
$type : string

The search type; ['gal'|'mailbox']

$query : array<string|int, mixed>

The search query. An array containing:

  • query: (array) The search query. Contains at least: 'query' and 'range'. The rest depends on the type of search being performed. DEFAULT: none, REQUIRED
  • range: (string) A range limiter. DEFAULT: none (No range used).
  • rebuildresults: (boolean) If true, invalidate any cached search. DEFAULT: Use cached search results if available.
  • deeptraversal: (boolean) If true, traverse sub folders. @todo NOT IMPLEMENTED YET.
Return values
array<string|int, mixed>

An array containing:

  • rows: An array of search results, limited by $query['range'].
  • status: The search store status code.
  • total: The total number of matches (not limited by $query['range']

getServerChanges()

Get a list of server changes that occured during the specified time period.

public getServerChanges(Horde_ActiveSync_Folder_Base $folder, int $from_ts, int $to_ts, int $cutoffdate, bool $ping[, bool $ignoreFirstSync = false ][, int $maxitems = 100 ][, bool $refreshFilter = false ]) : array<string|int, mixed>
Parameters
$folder : Horde_ActiveSync_Folder_Base

The ActiveSync folder object to request changes for.

$from_ts : int

The starting timestamp

$to_ts : int

The ending timestamp

$cutoffdate : int

The earliest date to retrieve back to.

$ping : bool

If true, returned changeset may not contain the full changeset, but rather only a single change, designed only to indicate some change has taken place. The value should not be used to determine what change has taken place.

$ignoreFirstSync : bool = false

If true, will not trigger an initial sync if $from_ts is 0. Needed to avoid race conditions when we don't have any history data. @since 2.6.0 @todo If we can pass the synckey ( perhaps as part of $folder), we can just look for synckey 0 to know when we CAN trigger an initial sync without this flag.

$maxitems : int = 100

Maximum number of recipients for a RI collection. @since 2.12.0

$refreshFilter : bool = false

Force a SOFTDELETE operation and check for new items within the (newly changed) current FilterType interval. @since 2.19.0

Tags
throws
Horde_Exception_AuthenticationFailure

Thrown when the requested collection appears to be no longer available. For H6, we should have the application APIs be responsible for differentiating between deleted/not-visible.

todo

H6 - Clean up method parameters, update parent class etc...

  • Return a new ids object.
  • Refactor to use a Repository pattern for each supported collection and move the bulk of the logic in the switch structure below to the various classes - and refactor out most of the stuff in the registry connector since the Repositories will handle the basic CRUD operations and change detection on each collection.
  • Use an object instead of hashes to return in the changes array to better define the available properties.
Return values
array<string|int, mixed>

An array of hashes that contain the ids of items that have changed in the specified collection along with a 'type' flag that indicates the type of change.

getSettings()

Return settings from the backend for a SETTINGS request.

public getSettings(array<string|int, mixed> $settings, stdClass $device) : array<string|int, mixed>
Parameters
$settings : array<string|int, mixed>

An array of settings to return. Currently supported:

  • oof: The out of office message information. @todo
  • userinformation: UserInformation requests.
    • emailaddresses: User's From email addresses.
    • primarysmtpaddress: (@deprecated) The SMTP address used for the default account. Only supported in EAS >= 14.1 using accounts.
    • status: EAS status code.
    • accounts: Array with each entry containing emailaddresses, fullname for additional identities. The primary address should be the first in the emailaddresses array.
$device : stdClass

The device to obtain settings for.

Tags
todo

H6: return information keyed by the common names given in wbxml schema for the settings command (use constants) and return as a Horde_ActiveSync_Message_Oof object.

Return values
array<string|int, mixed>

The requested settings.

getSpecialFolderNameByType()

Return the server id of the specified special folder type.

public getSpecialFolderNameByType(string $type) : string|bool
Parameters
$type : string

The self::SPECIAL_* constant.

Return values
string|bool

The folder's server id or false on failure.

getSyncStamp()

Return the SyncStamp - the value used to determine the end of the current sync range. If the collection backend supports modification sequences, we will use that, otherwise return the current timestamp.

public getSyncStamp(string $collection[, int $last = null ]) : int|bool
Parameters
$collection : string

The collection id we are currently requesting.

$last : int = null

The last syncstamp, if known. Used to help sanity check the state.

Tags
since
2.6.0
Return values
int|bool

The SyncStamp or false if an error is encountered.

getUsernameFromEmail()

Attempt to guess a username based on the email address passed from EAS Autodiscover requests.

public getUsernameFromEmail(string $email) : string
Parameters
$email : string

The email address

Return values
string

The username to use to authenticate to Horde with.

getWasteBasket()

Get the wastebasket folder. If this returns false, imap deletions are permanent. If it returns a valid mailbox, deletions are treated as moves to this mailbox. Note that any collection class other than Horde_ActiveSync::CLASS_EMAIL will return false.

public getWasteBasket(mixed $class) : string|bool
Parameters
$class : mixed
Return values
string|bool

Returns name of the trash folder, or false if not using a trash folder.

itemOperationsEmptyFolder()

Empty specified mailbox.

public itemOperationsEmptyFolder(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

An array of parameters:

  • folderid: The backend folderid of the mailbox to empty.
  • subfolders: IGNORED for now.
Tags
throws
Horde_ActiveSync_Exception
since
2.14.0

itemOperationsFetchMailbox()

Return Horde_Imap_Message_Mail object represented by the specified longid. Used to fetch email objects from a search result, which only returns a 'longid'.

public itemOperationsFetchMailbox(string $longid, array<string|int, mixed> $bodyprefs[, int $mimesupport = 0 ]) : Horde_ActiveSync_Message_Base
Parameters
$longid : string

The unique search result identifier. Consists of mailbox:uid E.g, INBOX:110

$bodyprefs : array<string|int, mixed>

The bodypreference array.

$mimesupport : int = 0

Mimesupport flag. A Horde_ActiveSync::MIME_SUPPORT_* constant.

Return values
Horde_ActiveSync_Message_Base

The message requested.

itemOperationsGetAttachmentData()

Return the specified attachement data for an ITEMOPERATIONS request.

public itemOperationsGetAttachmentData(string $filereference) : Horde_ActiveSync_Message_AirSyncBaseFileAttachment
Parameters
$filereference : string

The attachment identifier.

Return values
Horde_ActiveSync_Message_AirSyncBaseFileAttachment

Return a documentlibrary item.

public itemOperationsGetDocumentLibraryLink(string $linkid, array<string|int, mixed> $cred) : array<string|int, mixed>
Parameters
$linkid : string

The linkid

$cred : array<string|int, mixed>

A credential array:

  • username: A hash with 'username' and 'domain' key/values.
  • password: User password
Return values
array<string|int, mixed>

An array containing the data and metadata:

meetingResponse()

Handle meeting responses.

public meetingResponse(array<string|int, mixed> $response) : string
Parameters
$response : array<string|int, mixed>

The response data. Contains:

  • requestid: The identifier of the meeting request. Used by the server to fetch the original meeting request details.
  • response: The user's response to the request. One of the response code constants.
  • folderid: The collection id that contains the meeting request.
Tags
throws
Horde_ActiveSync_Exception

Horde_Exception_NotFound

Return values
string

The UID of any created calendar entries, otherwise false.

modifyDeviceCallback()

Allow modification of device properties before request processing continues.

public modifyDeviceCallback(Horde_ActiveSync_Device $device) : Horde_ActiveSync_Device
Parameters
$device : Horde_ActiveSync_Device

The device object.

Return values
Horde_ActiveSync_Device

The possibly modified device object.

moveMessage()

Move message

public moveMessage(string $folderid, array<string|int, mixed> $ids, string $newfolderid) : array<string|int, mixed>
Parameters
$folderid : string

Existing folder id.

$ids : array<string|int, mixed>

Message UIDs to move. @todo For H6 this should take a single id. We can't bulk move them for other reasons.

$newfolderid : string

The new folder id to move to.

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

An array of successfully moved messages with the old UIDs as keys and new UIDs as values.

resolveRecipient()

Handle ResolveRecipient requests

public resolveRecipient(string $type, string $search[, array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$type : string

The type of recipient request. e.g., 'certificate'

$search : string

The email to resolve.

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

Any options required to perform the resolution.

  • maxcerts: (integer) The maximum number of certificates to return as provided by the client.
  • maxambiguous: (integer) The maximum number of ambiguous results. If set to zero, we MUST have an exact match.
  • starttime: (Horde_Date) The start time for the availability window if requesting AVAILABILITY.
  • endtime: (Horde_Date) The end of the availability window if requesting AVAILABILITY.
  • maxsize: (integer) The maximum size of any pictures. DEFAULT: 0 (No limit).
  • maxpictures: (integer) The maximum count of images to return. DEFAULT: - (No limit).
  • pictures: (boolean) Return pictures.
Return values
array<string|int, mixed>

An array of results containing any of the following:

  • type: (string) The type of result a GAL entry or personal address book entry. A Horde_ActiveSync::RESOLVE_RESULT constant.
  • displayname: (string) The display name of the contact.
  • emailaddress: (string) The emailaddress.
  • entries: (array) An array of certificates.
  • availability: (string) A EAS style FB string.
  • picture: (Horde_ActiveSync_Message_ResolveRecipientsPicture)

sendMail()

Sends the email represented by the rfc822 string received by the PIM.

public sendMail(mixed $rfc822[, int|bool $forward = false ][, int|bool $reply = false ][, string $parent = false ][, bool $save = true ][, Horde_ActiveSync_Message_SendMail $message = null ]) : bool
Parameters
$rfc822 : mixed

The rfc822 mime message, a string or stream resource.

$forward : int|bool = false

The UID of the message, if forwarding or true if forwarding and EAS >= 14.0

$reply : int|bool = false

The UID of the message if replying or true if replying and EAS >= 14.0

$parent : string = false

The collection id of parent message if forwarding/replying.

$save : bool = true

Save in sent messages.

$message : Horde_ActiveSync_Message_SendMail = null

The entire message object for EAS 14+ requests. @since 2.5.0

Tags
todo

H6 - Either make this take an options array or break it into two separate methods - one for EAS < 14 and one for EAS > 14.

throws
Horde_ActiveSync_Exception
Return values
bool

setDevice()

Set the currently connected device

public setDevice(Horde_ActiveSync_Device $device) : mixed
Parameters
$device : Horde_ActiveSync_Device

The device object.

setLogger()

Set the logger.

public setLogger(Horde_Log_Logger $logger) : mixed
Parameters
$logger : Horde_Log_Logger

The logger.

setReadFlag()

Set the read (\seen) flag on the specified message.

public setReadFlag(string $folderId, string $id, int $flags) : mixed

Will be removed in Horde 6. Here for BC with Horde_ActiveSync 2.4

Parameters
$folderId : string

The folder id containing the message.

$id : string

The message uid.

$flags : int

The value to set the flag to.

setSettings()

Set backend settings from a SETTINGS request.

public setSettings(array<string|int, mixed> $settings, stdClass $device) : array<string|int, mixed>
Parameters
$settings : array<string|int, mixed>

The settings to store. Currently supported:

  • oof: (array) The Out of Office message.
$device : stdClass

The device to store settings for.

Return values
array<string|int, mixed>

An array of status responses for each set request. e.g.,: array('oof' => Horde_ActiveSync_Request_Settings::STATUS_SUCCESS);

setup()

Setup sync parameters. The user provided here is the user the backend will sync with. This allows you to authenticate as one user, and sync as another, if the backend supports this (Horde does not).

public setup(string $user) : bool
Parameters
$user : string

The username to sync as on the backend.

Return values
bool

statFolder()

Stat folder. Note that since the only thing that can ever change for a folder is the name, we use that as the 'mod' value.

public statFolder(string $id[, mixed $parent = '0' ][, mixed $mod = null ][, string $serverid = null ][, int $type = null ]) : a
Parameters
$id : string

The folder's EAS uid

$parent : mixed = '0'

The parent folder (or 0 if none).

$mod : mixed = null

Modification indicator. For folders, this is the display name of the folder, since that's the only thing that can change.

$serverid : string = null

The backend serverid for this folder.

$type : int = null

The EAS folder type, a Horde_ActiveSync::FOLDER_TYPE_* contant. @since 2.12.0

Tags
todo

Horde 6, move to the base class.

Return values
a

stat hash:

  • id: The activesync folder identifier.
  • mod: The modification value.
  • parent: The folder's parent id.
  • serverid: The backend server's folder name for this folder.
  • type: The EAS folder type. @since 2.12.0

statMailMessage()

Build a stat structure for an email message.

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

The mailbox name.

$id : int|array<string|int, mixed>

The message(s) to stat (IMAP UIDs).

Return values
array<string|int, mixed>

statMessage()

Get message stat data

public statMessage(mixed $folderid, mixed $id) : mixed
Parameters
$folderid : mixed
$id : mixed
Tags
see

Horde_ActiveSync_Driver_Base#statMessage($folderId, $id)

_buildDummyFolder()

protected _buildDummyFolder(mixed $id) : mixed
Parameters
$id : mixed

_buildNonMailFolder()

Helper to build a folder object for non-email folders.

protected _buildNonMailFolder(string $id, stirng $parent, int $type, string $name) : Horde_ActiveSync_Message_Folder
Parameters
$id : string

The folder's server id.

$parent : stirng

The folder's parent id.

$type : int

The folder type.

$name : string

The folder description.

Return values
Horde_ActiveSync_Message_Folder

The folder object.

_endBuffer()

End output buffering, log any unexpected output.

protected _endBuffer() : mixed

_getFolder()

Factory for creating new Horde_ActiveSync_Message_Folder objects from within this class.

protected _getFolder(string $id[, array<string|int, mixed> $params = array() ]) : Horde_ActiveSync_Message_Folder

For BC reasons, we need to still accept the *_FOLDER_UID constants and they should represent folders that are multiplexed.

Parameters
$id : string

The folder's server id.

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

Additional folder parameters:

  • class: The collection class, a Horde_ActiveSync::CLASS_* constant
  • primary: This folder is the 'default' collection for this class.
  • display: The display name for FOLDER_TYPE_USER folders.
Tags
throws
Horde_ActiveSync_Exception
Return values
Horde_ActiveSync_Message_Folder

The folder object.

_getIdentityFromAddress()

Return the current user's From/Reply_To address.

protected _getIdentityFromAddress() : string
Return values
string

A RFC822 valid email string.

_getLastVerb()

Return the last verb executed for the specified Message-ID.

protected _getLastVerb(string $mid) : array<string|int, mixed>
Parameters
$mid : string

The Message-ID.

Return values
array<string|int, mixed>

The most recent history log entry array for $mid.

_getMailFolder()

Return a folder object representing an email folder. Attempt to detect special folders appropriately.

protected _getMailFolder(string $sid, array<string|int, mixed> $fl, array<string|int, mixed> $f) : Horde_ActiveSync_Message_Folder
Parameters
$sid : string

The server name.

$fl : array<string|int, mixed>

The complete folder list.

$f : array<string|int, mixed>

An array describing the folder.

Return values
Horde_ActiveSync_Message_Folder

_getMailFolders()

Return the list of mail server folders.

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

An array of Horde_ActiveSync_Message_Folder objects.

_getMaillogChanges()

Get verb changes from the maillog.

protected _getMaillogChanges(Horde_ActiveSync_Folder_Imap $folder, int $ts) : Horde_ActiveSync_Folder_Imap
Parameters
$folder : Horde_ActiveSync_Folder_Imap

The folder to search.

$ts : int

The timestamp to start from.

Return values
Horde_ActiveSync_Folder_Imap

The folder object, with any changes added accordingly.

_getPolicyFromPerms()

Return a policy array suitable for transforming into either wbxml or xml to send to the device in the provision response.

protected _getPolicyFromPerms([bool $deviceinfo = false ]) : array<string|int, mixed>
Parameters
$deviceinfo : bool = false

EAS 14.1 DEVICESETTINGS sent with PROVISION.

Return values
array<string|int, mixed>

_getPolicyValue()

protected _getPolicyValue(mixed $policy, mixed $allowed) : mixed
Parameters
$policy : mixed
$allowed : mixed

_mungeCert()

Removes the beginning/ending delimiters from the certificate.

protected _mungeCert(string $cert) : string
Parameters
$cert : string

The certificate text.

Return values
string

The certificate text, with delimiters removed.

_parseFolderId()

Parse a folderid.

protected _parseFolderId(string $id[, bool $checkEmail = false ]) : string|array<string|int, mixed>
Parameters
$id : string

The folder id.

$checkEmail : bool = false

Verify $id is not an Email collection.

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

A parsed folder array or Horde_ActiveSync::CLASS_* constant.

_searchGal()

Perform a search of the Global Address Book.

protected _searchGal(array<string|int, mixed> $query) : array<string|int, mixed>
Parameters
$query : array<string|int, mixed>

A query array. @see self::getSearchResults()

Return values
array<string|int, mixed>

The results array. @see self::getSearchResults()

_searchMailbox()

Perform a search of the email store.

protected _searchMailbox(array<string|int, mixed> $query) : array<string|int, mixed>
Parameters
$query : array<string|int, mixed>

A query array. @see self::getSearchResults()

Return values
array<string|int, mixed>

The results array. @see self::getSearchResults()

_smartStatMessage()

Stat a backend item, optionally using the cached value if available.

protected _smartStatMessage(string $folderid, string $id, bool $hint) : message
Parameters
$folderid : string

The folder id

$id : string

The message id

$hint : bool

Use the cached data, if available?

Return values
message

stat hash


        
On this page

Search results