Properties

$envelope

$envelope : \Horde_Imap_Client_Data_Envelope

The message envelope.

Type

\Horde_Imap_Client_Data_Envelope

$flags

$flags : array

The message flags.

Type

array

$uid

$uid : integer

The message uid.

Type

integer

$basePart

$basePart : \Horde_ActiveSync_Mime

The base message part.

Type

\Horde_ActiveSync_Mime

$_data

$_data : \Horde_Imap_Client_Data_Fetch

Message data.

Type

\Horde_Imap_Client_Data_Fetch

$_imap

$_imap : \Horde_Imap_Client_Base

The imap client.

Type

\Horde_Imap_Client_Base

$_lastBodyPartDecode

$_lastBodyPartDecode : boolean

Cache if the last body part was encoded or not.

Type

boolean

$_hasAttachments

$_hasAttachments : boolean

Flag to indicate if this message contains attachments.

Type

boolean

Methods

__construct()

__construct(\Horde_Imap_Client_Base  $imap, \Horde_Imap_Client_Mailbox  $mbox, \Horde_Imap_Client_Data_Fetch  $data) 

Constructor

Parameters

\Horde_Imap_Client_Base $imap

The imap client object.

\Horde_Imap_Client_Mailbox $mbox

The mailbox object.

\Horde_Imap_Client_Data_Fetch $data

The data returned from a FETCH must contain at least uid, structure and flags.

__destruct()

__destruct() 

__get()

__get(string  $property) : mixed

Accessor

Parameters

string $property

The property.

Returns

mixed

getHeaders()

getHeaders() : \Horde_Mime_Headers

Return this message's base part headers.

Returns

\Horde_Mime_Headers —

The message headers.

getForwardHeaders()

getForwardHeaders() : string

Return nicely formatted text representing the headers to display with in-line forwarded messages.

Returns

string

getFullMsg()

getFullMsg(boolean  $stream = false) : mixed

Return the full message text.

Parameters

boolean $stream

Return data as a stream?

Throws

\Horde_ActiveSync_Exception

Returns

mixed —

A string or stream resource.

getStructure()

getStructure() : \Horde_Mime_Part

Return the message's base Mime part.

Returns

\Horde_Mime_Part

getMessageBodyData()

getMessageBodyData(array  $options = array()) : array

Returns the main text body of the message suitable for sending over EAS response.

Parameters

array $options

An options array containgin:

  • bodyprefs: (array) Bodypref settings DEFAULT: none (No bodyprefs used).
  • 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 we are supporting. DEFAULT 2.5

Throws

\Horde_ActiveSync_Exception,

Horde_Exception_NotFound

Returns

array —

An array of one or both of 'plain' and 'html' content.

getMessageBodyDataObject()

getMessageBodyDataObject(array  $options = array()) : \Horde_ActiveSync_Imap_MessageBodyData

Returns the main text body of the message suitable for sending over EAS response.

Parameters

array $options

An options array containgin:

  • bodyprefs: (array) Bodypref settings DEFAULT: none (No bodyprefs used).
  • 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 we are supporting. DEFAULT 2.5

Throws

\Horde_ActiveSync_Exception,

Horde_Exception_NotFound

Returns

\Horde_ActiveSync_Imap_MessageBodyData

The result.

getAttachments()

getAttachments(float  $version) : array

Return an array of Horde_ActiveSync_Message_Attachment objects for the current message.

Parameters

float $version

The EAS protocol version this is for.

Returns

array —

An array of Horde_ActiveSync_Message_Attachment objects.

getAttachmentsMimeParts()

getAttachmentsMimeParts() : array

Return an array of mime parts for each message attachment.

Returns

array —

An array of Horde_Mime_Part objects.

getMimePart()

getMimePart(integer  $id, array  $options = array()) : \Horde_Mime_Part

Fetch a part of a MIME message.

Parameters

integer $id

The MIME index of the part requested.

array $options

Additional options:

  • length: (integer) If set, only download this many bytes of the bodypart from the server. DEFAULT: All data is retrieved.
  • nocontents: (boolean) If true, don't add the contents to the part DEFAULT: Contents are added to the part

Returns

\Horde_Mime_Part —

The raw MIME part asked for.

getPartName()

getPartName(\Horde_Mime_Part  $part, boolean  $use_descrip = false) : string

Return the descriptive part label, making sure it is not empty.

Parameters

\Horde_Mime_Part $part

The MIME Part object.

boolean $use_descrip

Use description? If false, uses name.

Returns

string —

The part label (non-empty).

getBodyPart()

getBodyPart(integer  $id, array  $options) : mixed

Gets the raw text for one section of the message.

Parameters

integer $id

The ID of the MIME part.

array $options

Additional options:

  • decode: (boolean) Attempt to decode the bodypart on the remote server. If successful, sets self::$_lastBodyPartDecode to the content-type of the decoded data. DEFAULT: No
  • length: (integer) If set, only download this many bytes of the bodypart from the server. DEFAULT: All data is retrieved.
  • mimeheaders: (boolean) Include the MIME headers also? DEFAULT: No
  • stream: (boolean) If true, return a stream. DEFAULT: No

Returns

mixed —

The text of the part or a stream resource if 'stream' is true.

getToAddresses()

getToAddresses() : array

Return the To addresses from this message.

Returns

array —

An array containing arrays of 'to' and 'displayto' addresses. @since 2.37.1, ensures the text is UTF8.

getCc()

getCc() : string

Return the CC addresses for this message.

Throws

\Horde_ActiveSync_Exception

@since 2.27.0

Returns

string —

The Cc address string.

getReplyTo()

getReplyTo() : string

Return the ReplyTo Address

Throws

\Horde_ActiveSync_Exception

@since 2.27.0

Returns

string

getFromAddress()

getFromAddress() : string

Return the message's From: address.

Throws

\Horde_ActiveSync_Exception

@since 2.27.0

Returns

string —

The From address of this message.

getSubject()

getSubject() : string

Return the message subject.

Returns

string —

The subject.

getDate()

getDate() : \Horde_Date

Return the message date.

Returns

\Horde_Date —

The messages's envelope date.

getFlag()

getFlag(string  $flag) : boolean

Get a message flag

Parameters

string $flag

The flag to search for.

Returns

boolean

getFlags()

getFlags() : array

Return all message flags.

Returns

array —

An array of message flags.

contentTypeMap()

contentTypeMap() : array

Return this message's content map

Returns

array —

The content map, with mime ids as keys and content type as values.

isAttachment()

isAttachment(string  $id, string  $mime_type) : boolean

Determines if a MIME type is an attachment.

For our purposes, an attachment is any MIME part that can be downloaded by itself (i.e. all the data needed to view the part is contained within the download data).

Parameters

string $id

The MIME Id for the part we are checking.

string $mime_type

The MIME type.

Returns

boolean —

True if an attachment.

hasiCalendar()

hasiCalendar() : mixed

Return the MIME part of the iCalendar attachment, if available.

Returns

mixed —

The mime part, if present, false otherwise.

hasAttachments()

hasAttachments() : boolean

Return the hasAttachments flag

Returns

boolean

isSigned()

isSigned(\Horde_Mime_Part  $message = null) : boolean

Return the S/MIME signature status of this message (RFC2633)

Parameters

\Horde_Mime_Part $message

A mime part to check. If omitted, use self::$_message.

Returns

boolean —

True if message is S/MIME signed, false otherwise.

isEncrypted()

isEncrypted(\Horde_Mime_Part  $message = null) : boolean

Return the S/MIME encryption status of this message (RFC2633)

Parameters

\Horde_Mime_Part $message

A mime part to check. If omitted, use self::$_message.

Returns

boolean —

True if message is S/MIME signed or encrypted, false otherwise.

_buildEasAttachmentFromMime()

_buildEasAttachmentFromMime(integer  $id, \Horde_Mime_Part  $mime_part, float  $version) : \Horde_ActiveSync_Message_AirSyncBaseAttachment

Build an appropriate attachment object from the given mime part.

Parameters

integer $id

The mime id for the part

\Horde_Mime_Part $mime_part

The mime part.

float $version

The EAS version.

Returns

\Horde_ActiveSync_Message_AirSyncBaseAttachment

| Horde_ActiveSync_Message_Attachment

_decodeTnefData()

_decodeTnefData(integer|\Horde_Mime_part  $data) : \Horde_Mime_Part

Convert a TNEF attachment into a multipart/mixed part.

Parameters

integer|\Horde_Mime_part $data

Either a mime part id or a Horde_Mime_Part object containing the TNEF attachment.

Returns

\Horde_Mime_Part —

The multipart/mixed MIME part containing any attachment data we can decode.