PHP Class Horde_ActiveSync_Imap_Message, horde

Some Mime parsing code taken from Imp_Contents.
Author: Michael J Rubinsky ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_basePart Horde_ActiveSync_Mime Message structure.
$_data Horde_Imap_Client_Data_Fetch Message data.
$_hasAttachments boolean Flag to indicate if this message contains attachments.
$_imap Horde_Imap_Client_Base The imap client.
$_lastBodyPartDecode boolean Cache if the last body part was encoded or not.

Méthodes publiques

Méthode Description
__construct ( Horde_Imap_Client_Base $imap, Horde_Imap_Client_Mailbox $mbox, Horde_Imap_Client_Data_Fetch $data ) Constructor
__destruct ( )
__get ( string $property ) : mixed Accessor
contentTypeMap ( ) : array Return this message's content map
getAttachments ( float $version ) : array Return an array of Horde_ActiveSync_Message_Attachment objects for the current message.
getAttachmentsMimeParts ( ) : array Return an array of mime parts for each message attachment.
getBodyPart ( integer $id, array $options ) : mixed Gets the raw text for one section of the message.
getCc ( ) : string Return the CC addresses for this message.
getDate ( ) : Horde_Date Return the message date.
getFlag ( string $flag ) : boolean Get a message flag
getFlags ( ) : array Return all message flags.
getForwardHeaders ( ) : string Return nicely formatted text representing the headers to display with in-line forwarded messages.
getFromAddress ( ) : string Return the message's From: address.
getFullMsg ( boolean $stream = false ) : mixed Return the full message text.
getHeaders ( ) : Horde_Mime_Headers Return this message's base part headers.
getMessageBodyData ( array $options = [] ) : array Returns the main text body of the message suitable for sending over EAS response.
getMessageBodyDataObject ( array $options = [] ) : Horde_ActiveSync_Imap_MessageBodyData Returns the main text body of the message suitable for sending over EAS response.
getMimePart ( integer $id, array $options = [] ) : Horde_Mime_Part Fetch a part of a MIME message.
getPartName ( Horde_Mime_Part $part, boolean $use_descrip = false ) : string Return the descriptive part label, making sure it is not empty.
getReplyTo ( ) : string Return the ReplyTo Address
getStructure ( ) : Horde_Mime_Part Return the message's base Mime part.
getSubject ( ) : string Return the message subject.
getToAddresses ( ) : array Return the To addresses from this message.
hasAttachments ( ) : boolean Return the hasAttachments flag
hasiCalendar ( ) : mixed Return the MIME part of the iCalendar attachment, if available.
isAttachment ( string $id, string $mime_type ) : boolean Determines if a MIME type is an attachment.
isEncrypted ( Horde_Mime_Part $message = null ) : boolean Return the S/MIME encryption status of this message (RFC2633)
isSigned ( Horde_Mime_Part $message = null ) : boolean Return the S/MIME signature status of this message (RFC2633)

Méthodes protégées

Méthode Description
_buildEasAttachmentFromMime ( integer $id, Horde_Mime_Part $mime_part, float $version ) : Horde_ActiveSync_Message_AirSyncBaseAttachment Build an appropriate attachment object from the given mime part.
_decodeTnefData ( integer | Horde_Mime_part $data ) : Horde_Mime_Part Convert a TNEF attachment into a multipart/mixed part.

Method Details

__construct() public méthode

Constructor
public __construct ( Horde_Imap_Client_Base $imap, Horde_Imap_Client_Mailbox $mbox, Horde_Imap_Client_Data_Fetch $data )
$imap Horde_Imap_Client_Base The imap client object.
$mbox Horde_Imap_Client_Mailbox The mailbox object.
$data Horde_Imap_Client_Data_Fetch The data returned from a FETCH must contain at least uid, structure and flags.

__destruct() public méthode

public __destruct ( )

__get() public méthode

Accessor
public __get ( string $property ) : mixed
$property string The property.
Résultat mixed

_buildEasAttachmentFromMime() protected méthode

Build an appropriate attachment object from the given mime part.
protected _buildEasAttachmentFromMime ( integer $id, Horde_Mime_Part $mime_part, float $version ) : Horde_ActiveSync_Message_AirSyncBaseAttachment
$id integer The mime id for the part
$mime_part Horde_Mime_Part The mime part.
$version float The EAS version.
Résultat Horde_ActiveSync_Message_AirSyncBaseAttachment | Horde_ActiveSync_Message_Attachment

_decodeTnefData() protected méthode

Convert a TNEF attachment into a multipart/mixed part.
protected _decodeTnefData ( integer | Horde_Mime_part $data ) : Horde_Mime_Part
$data integer | Horde_Mime_part Either a mime part id or a Horde_Mime_Part object containing the TNEF attachment.
Résultat Horde_Mime_Part The multipart/mixed MIME part containing any attachment data we can decode.

contentTypeMap() public méthode

Return this message's content map
public contentTypeMap ( ) : array
Résultat array The content map, with mime ids as keys and content type as values.

getAttachments() public méthode

Return an array of Horde_ActiveSync_Message_Attachment objects for the current message.
public getAttachments ( float $version ) : array
$version float The EAS protocol version this is for.
Résultat array An array of Horde_ActiveSync_Message_Attachment objects.

getAttachmentsMimeParts() public méthode

Return an array of mime parts for each message attachment.
public getAttachmentsMimeParts ( ) : array
Résultat array An array of Horde_Mime_Part objects.

getBodyPart() public méthode

Gets the raw text for one section of the message.
public getBodyPart ( integer $id, array $options ) : mixed
$id integer The ID of the MIME part.
$options array 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
Résultat mixed The text of the part or a stream resource if 'stream' is true.

getCc() public méthode

Return the CC addresses for this message.
public getCc ( ) : string
Résultat string The Cc address string.

getDate() public méthode

Return the message date.
public getDate ( ) : Horde_Date
Résultat Horde_Date The messages's envelope date.

getFlag() public méthode

Get a message flag
public getFlag ( string $flag ) : boolean
$flag string The flag to search for.
Résultat boolean

getFlags() public méthode

Return all message flags.
Since: 2.17.0
public getFlags ( ) : array
Résultat array An array of message flags.

getForwardHeaders() public méthode

Return nicely formatted text representing the headers to display with in-line forwarded messages.
public getForwardHeaders ( ) : string
Résultat string

getFromAddress() public méthode

Return the message's From: address.
public getFromAddress ( ) : string
Résultat string The From address of this message.

getFullMsg() public méthode

Return the full message text.
public getFullMsg ( boolean $stream = false ) : mixed
$stream boolean Return data as a stream?
Résultat mixed A string or stream resource.

getHeaders() public méthode

Return this message's base part headers.
public getHeaders ( ) : Horde_Mime_Headers
Résultat Horde_Mime_Headers The message headers.

getMessageBodyData() public méthode

Returns the main text body of the message suitable for sending over EAS response.
public getMessageBodyData ( array $options = [] ) : array
$options array 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
Résultat array An array of one or both of 'plain' and 'html' content.

getMessageBodyDataObject() public méthode

Returns the main text body of the message suitable for sending over EAS response.
public getMessageBodyDataObject ( array $options = [] ) : Horde_ActiveSync_Imap_MessageBodyData
$options array 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
Résultat Horde_ActiveSync_Imap_MessageBodyData The result.

getMimePart() public méthode

Fetch a part of a MIME message.
public getMimePart ( integer $id, array $options = [] ) : Horde_Mime_Part
$id integer The MIME index of the part requested.
$options array 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
Résultat Horde_Mime_Part The raw MIME part asked for.

getPartName() public méthode

Return the descriptive part label, making sure it is not empty.
public getPartName ( Horde_Mime_Part $part, boolean $use_descrip = false ) : string
$part Horde_Mime_Part The MIME Part object.
$use_descrip boolean Use description? If false, uses name.
Résultat string The part label (non-empty).

getReplyTo() public méthode

Return the ReplyTo Address
public getReplyTo ( ) : string
Résultat string

getStructure() public méthode

Return the message's base Mime part.
public getStructure ( ) : Horde_Mime_Part
Résultat Horde_Mime_Part

getSubject() public méthode

Return the message subject.
public getSubject ( ) : string
Résultat string The subject.

getToAddresses() public méthode

Return the To addresses from this message.
public getToAddresses ( ) : array
Résultat array An array containing arrays of 'to' and 'displayto' addresses. @since 2.37.1, ensures the text is UTF8.

hasAttachments() public méthode

Return the hasAttachments flag
public hasAttachments ( ) : boolean
Résultat boolean

hasiCalendar() public méthode

Return the MIME part of the iCalendar attachment, if available.
public hasiCalendar ( ) : mixed
Résultat mixed The mime part, if present, false otherwise.

isAttachment() public méthode

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).
Deprecation: Will be removed in 3.0 (Only used in self::hasAttachments call).
public isAttachment ( string $id, string $mime_type ) : boolean
$id string The MIME Id for the part we are checking.
$mime_type string The MIME type.
Résultat boolean True if an attachment.

isEncrypted() public méthode

Return the S/MIME encryption status of this message (RFC2633)
public isEncrypted ( Horde_Mime_Part $message = null ) : boolean
$message Horde_Mime_Part A mime part to check. If omitted, use self::$_message.
Résultat boolean True if message is S/MIME signed or encrypted, false otherwise.

isSigned() public méthode

Return the S/MIME signature status of this message (RFC2633)
public isSigned ( Horde_Mime_Part $message = null ) : boolean
$message Horde_Mime_Part A mime part to check. If omitted, use self::$_message.
Résultat boolean True if message is S/MIME signed, false otherwise.

Property Details

$_basePart protected_oe property

Message structure.
protected Horde_ActiveSync_Mime $_basePart
Résultat Horde_ActiveSync_Mime

$_data protected_oe property

Message data.
protected Horde_Imap_Client_Data_Fetch $_data
Résultat Horde_Imap_Client_Data_Fetch

$_hasAttachments protected_oe property

Flag to indicate if this message contains attachments.
protected bool $_hasAttachments
Résultat boolean

$_imap protected_oe property

The imap client.
protected Horde_Imap_Client_Base $_imap
Résultat Horde_Imap_Client_Base

$_lastBodyPartDecode protected_oe property

Cache if the last body part was encoded or not.
protected bool $_lastBodyPartDecode
Résultat boolean