PHP Class Horde_Core_ActiveSync_Mail, horde

Wraps functionality related to sending/replying/forwarding email from EAS clients.
Author: Michael J Rubinsky ([email protected])
Mostra file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_forward boolean Flag indicating a SMARTFORWARD request.
$_forwardees array Array of email addresses to forward message to, if using SMART_FORWARD.
$_headers Horde_Mime_Header The headers used when sending the email.
$_id integer The UID of the source email for any SMARTREPLY or SMARTFORWARD requests.
$_imap Horde_ActiveSync_Imap_Adapter The imap adapter needed to fetch the source IMAP message if needed.
$_imapMessage Horde_ActiveSync_Imap_Message The message object representing the source email for a SMART[REPLY|FORWARD] request.
$_mailer Horde_Mime_Mail Used to fetch the raw message used to save to sent mail folder.
$_parentFolder string The email folder that contains the source email for any SMARTREPLY or SMARTFORWARD requests.
$_raw Horde_ActiveSync_Rfc822 The raw message body sent from the EAS client.
$_replacemime boolean Flag indicating the client requested to replace the MIME part a SMARTREPLY or SMARTFORWARD request.
$_reply boolean Flag indicating a SMARTREPLY request.
$_replyTop boolean Flag to indicate reply position for SMARTREPLY requests.
$_user string The current EAS user.
$_version string EAS version in use.

Public Methods

Method Description
__construct ( Horde_ActiveSync_Imap_Adapter $imap, string $user, integer $eas_version ) Const'r
__get ( $property )
__set ( $property, $value )
getSentMail ( ) : stream Get the raw message suitable for saving to the sent email folder.
html2text ( $msg )
send ( ) Send the email.
setForward ( string $parent, integer $id, array $params = [] ) Set this as a SMARTFORWARD requests.
setRawMessage ( Horde_ActiveSync_Rfc822 $raw ) Set the raw message content received from the EAS client to send.
setReply ( string $parent, integer $id ) Set this as a SMARTREPLY requests.
text2html ( string $msg ) : string Shortcut function to convert text -> HTML.

Protected Methods

Method Description
_callPreSendHook ( )
_forwardText ( array $body_data, Horde_Mime_Part $part, boolean $html = false ) : string Return the body of the forwarded message in the appropriate type.
_getHtmlPart ( string $html_id, Horde_Mime_Part $mime_message, array $body_data, Horde_Mime_Part $base_part ) : string Build the HTML part of a SMARTREPLY or SMARTFORWARD
_getIdentityFromAddress ( ) : string Return the current user's From address.
_getImapMessage ( ) Fetch the source message for a SMART request from the IMAP server.
_getPlainPart ( string $plain_id, Horde_Mime_Part $mime_message, array $body_data, Horde_Mime_Part $base_part ) : string Build the text part of a SMARTREPLY or SMARTFORWARD
_getReplyToAddress ( ) : string Return the current user's ReplyTo address, if available.
_msgBody ( array $body_data, Horde_Mime_Part $part, boolean $html, boolean $flow = false ) : string Return the body text of the original email from a smart request.
_replyText ( array $body_data, Horde_Mime_Part $part, boolean $html = false ) : string Return the body of the replied message in the appropriate type.
_sendRaw ( ) Send the raw message received from the client. E.g., NOT a SMART request.
_sendSmart ( ) Sends a SMART response.
_tryWithoutBinary ( $recipients, array $headers ) : boolean Some clients (HTC One devices, for one) generate HTML signatures that contain line lengths too long for servers without BINARYMIME to send. If we are here, see if that's the reason by checking content encoding and trying again.

Method Details

__construct() public method

Const'r
public __construct ( Horde_ActiveSync_Imap_Adapter $imap, string $user, integer $eas_version )
$imap Horde_ActiveSync_Imap_Adapter The IMAP adapter.
$user string EAS user.
$eas_version integer EAS version in use.

__get() public method

public __get ( $property )

__set() public method

public __set ( $property, $value )

_callPreSendHook() protected method

protected _callPreSendHook ( )

_forwardText() protected method

Return the body of the forwarded message in the appropriate type.
protected _forwardText ( array $body_data, Horde_Mime_Part $part, boolean $html = false ) : string
$body_data array The body data array of the source msg.
$part Horde_Mime_Part The body part of the email to send.
$html boolean Is this an html part?
return string The propertly formatted forwarded body text.

_getHtmlPart() protected method

Build the HTML part of a SMARTREPLY or SMARTFORWARD
protected _getHtmlPart ( string $html_id, Horde_Mime_Part $mime_message, array $body_data, Horde_Mime_Part $base_part ) : string
$html_id string The MIME part id of the html part of $base_part.
$mime_message Horde_Mime_Part The MIME part of the email to be sent.
$body_data array @see Horde_ActiveSync_Imap_Message::getMessageBodyData()
$base_part Horde_Mime_Part The base MIME part of the source message for a SMART request.
return string The plaintext part of the email message that is being sent.

_getIdentityFromAddress() protected method

Return the current user's From address.
protected _getIdentityFromAddress ( ) : string
return string A RFC822 valid email string.

_getImapMessage() protected method

Fetch the source message for a SMART request from the IMAP server.
protected _getImapMessage ( )

_getPlainPart() protected method

Build the text part of a SMARTREPLY or SMARTFORWARD
protected _getPlainPart ( string $plain_id, Horde_Mime_Part $mime_message, array $body_data, Horde_Mime_Part $base_part ) : string
$plain_id string The MIME part id of the plaintext part of $base_part.
$mime_message Horde_Mime_Part The MIME part of the email to be sent.
$body_data array @see Horde_ActiveSync_Imap_Message::getMessageBodyData()
$base_part Horde_Mime_Part The base MIME part of the source message for a SMART request.
return string The plaintext part of the email message that is being sent.

_getReplyToAddress() protected method

Return the current user's ReplyTo address, if available.
protected _getReplyToAddress ( ) : string
return string A RFC822 valid email string.

_msgBody() protected method

Return the body text of the original email from a smart request.
protected _msgBody ( array $body_data, Horde_Mime_Part $part, boolean $html, boolean $flow = false ) : string
$body_data array The body data array of the source msg.
$part Horde_Mime_Part The body mime part of the email to send.
$html boolean Do we want an html body?
$flow boolean Should the body be flowed?
return string The properly formatted/flowed message body.

_replyText() protected method

Return the body of the replied message in the appropriate type.
protected _replyText ( array $body_data, Horde_Mime_Part $part, boolean $html = false ) : string
$body_data array The body data array of the source msg.
$part Horde_Mime_Part
$html boolean Is this an html part?
return string The propertly formatted replied body text.

_sendRaw() protected method

Send the raw message received from the client. E.g., NOT a SMART request.
protected _sendRaw ( )

_sendSmart() protected method

Sends a SMART response.
protected _sendSmart ( )

_tryWithoutBinary() protected method

Some clients (HTC One devices, for one) generate HTML signatures that contain line lengths too long for servers without BINARYMIME to send. If we are here, see if that's the reason by checking content encoding and trying again.
protected _tryWithoutBinary ( $recipients, array $headers ) : boolean
$headers array
return boolean

getSentMail() public method

Get the raw message suitable for saving to the sent email folder.
public getSentMail ( ) : stream
return stream A stream contianing the raw message.

html2text() public static method

public static html2text ( $msg )

send() public method

Send the email.
public send ( )

setForward() public method

Set this as a SMARTFORWARD requests.
public setForward ( string $parent, integer $id, array $params = [] )
$parent string The folder containing the source message.
$id integer The source message UID.
$params array Additional parameters: @since 2.31.0 - forwardees: An array of email addresses that this message will be forwarded to. DEFAULT: Recipients are taken from raw message.

setRawMessage() public method

Set the raw message content received from the EAS client to send.
public setRawMessage ( Horde_ActiveSync_Rfc822 $raw )
$raw Horde_ActiveSync_Rfc822 The data from the EAS client.

setReply() public method

Set this as a SMARTREPLY requests.
public setReply ( string $parent, integer $id )
$parent string The folder containing the source message.
$id integer The source message UID.

text2html() public static method

Shortcut function to convert text -> HTML.
public static text2html ( string $msg ) : string
$msg string The message text.
return string HTML text.

Property Details

$_forward protected_oe property

Flag indicating a SMARTFORWARD request.
protected bool $_forward
return boolean

$_forwardees protected_oe property

Array of email addresses to forward message to, if using SMART_FORWARD.
Since: 2.31.0
protected array $_forwardees
return array

$_headers protected_oe property

The headers used when sending the email.
protected Horde_Mime_Header $_headers
return Horde_Mime_Header

$_id protected_oe property

The UID of the source email for any SMARTREPLY or SMARTFORWARD requests.
protected int $_id
return integer

$_imap protected_oe property

The imap adapter needed to fetch the source IMAP message if needed.
protected Horde_ActiveSync_Imap_Adapter $_imap
return Horde_ActiveSync_Imap_Adapter

$_imapMessage protected_oe property

The message object representing the source email for a SMART[REPLY|FORWARD] request.
protected Horde_ActiveSync_Imap_Message $_imapMessage
return Horde_ActiveSync_Imap_Message

$_mailer protected_oe property

Used to fetch the raw message used to save to sent mail folder.
protected Horde_Mime_Mail $_mailer
return Horde_Mime_Mail

$_parentFolder protected_oe property

The email folder that contains the source email for any SMARTREPLY or SMARTFORWARD requests.
protected string $_parentFolder
return string

$_raw protected_oe property

The raw message body sent from the EAS client.
protected Horde_ActiveSync_Rfc822 $_raw
return Horde_ActiveSync_Rfc822

$_replacemime protected_oe property

Flag indicating the client requested to replace the MIME part a SMARTREPLY or SMARTFORWARD request.
protected bool $_replacemime
return boolean

$_reply protected_oe property

Flag indicating a SMARTREPLY request.
protected bool $_reply
return boolean

$_replyTop protected_oe property

Flag to indicate reply position for SMARTREPLY requests.
protected bool $_replyTop
return boolean

$_user protected_oe property

The current EAS user.
protected string $_user
return string

$_version protected_oe property

EAS version in use.
protected string $_version
return string