Horde_Core_ActiveSync_Mail
in package
Horde_Core_ActiveSync_Mail::
Wraps functionality related to sending/replying/forwarding email from EAS clients.
Tags
Table of Contents
Constants
- HTML_BLOCKQUOTE = '<blockquote type="cite" style="border-left:2px solid blue;margin-left:2px;padding-left:12px;">'
Properties
- $forward : bool
- $header : Horde_Mime_Header
- $id : int
- $imapAdapter : Horde_ActiveSync_Imap_Adapter
- $parentFolder : string
- $replacemime : bool
- $reply : bool
- $_forward : bool
- Flag indicating a SMARTFORWARD request.
- $_forwardees : array<string|int, mixed>
- Array of email addresses to forward message to, if using SMART_FORWARD.
- $_headers : Horde_Mime_Header
- The headers used when sending the email.
- $_id : int
- 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
- Internal cache of the mailer used when sending SMART[REPLY|FORWARD].
- $_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 : bool
- Flag indicating the client requested to replace the MIME part a SMARTREPLY or SMARTFORWARD request.
- $_reply : bool
- Flag indicating a SMARTREPLY request.
- $_replyTop : bool
- Flag to indicate reply position for SMARTREPLY requests.
- $_user : string
- The current EAS user.
- $_version : string
- EAS version in use.
Methods
- __construct() : mixed
- Const'r
- __get() : mixed
- __set() : mixed
- getSentMail() : stream
- Get the raw message suitable for saving to the sent email folder.
- html2text() : mixed
- send() : mixed
- Send the email.
- setForward() : mixed
- Set this as a SMARTFORWARD requests.
- setRawMessage() : mixed
- Set the raw message content received from the EAS client to send.
- setReply() : mixed
- Set this as a SMARTREPLY requests.
- text2html() : string
- Shortcut function to convert text -> HTML.
- _buildSmartForward() : Horde_Mime_Mail
- Build Horde_Mime_Mail object to send email from SmartForward request.
- _buildSmartReply() : Horde_Mime_Mail
- Build Horde_Mime_Mail object to send email from SmartReply request.
- _callPreSendHook() : mixed
- _forwardText() : string
- Return the body of the forwarded message in the appropriate type.
- _getHtmlPart() : string
- Build the HTML part of a SMARTREPLY or SMARTFORWARD
- _getIdentityFromAddress() : string
- Return the current user's From address.
- _getImapMessage() : mixed
- Fetch the source message for a SMART request from the IMAP server.
- _getPlainPart() : string
- Build the text part of a SMARTREPLY or SMARTFORWARD
- _getReplyToAddress() : string
- Return the current user's ReplyTo address, if available.
- _getSmartHtmlText() : string
- Return HTML text part from incoming smart request.
- _getSmartPlainText() : string
- Return plain text part from incoming smart request.
- _msgBody() : string
- Return the body text of the original email from a smart request.
- _replyText() : string
- Return the body of the replied message in the appropriate type.
- _sendRaw() : mixed
- Send the raw message received from the client. E.g., NOT a SMART request.
- _sendSmart() : mixed
- Sends a SMART response.
- _tidyHtml() : string
- Attempt to sanitize the provided $html string.
- _tryWithoutBinary() : bool
- 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.
Constants
HTML_BLOCKQUOTE
public
mixed
HTML_BLOCKQUOTE
= '<blockquote type="cite" style="border-left:2px solid blue;margin-left:2px;padding-left:12px;">'
Properties
$forward read-only
public
bool
$forward
Flag indicating a SMARTFORWARD request.
$header read-only
public
Horde_Mime_Header
$header
The headers used when sending the email.
$id read-only
public
int
$id
The UID of the source email for any SMARTREPLY or SMARTFORWARD requests.
$imapAdapter read-only
public
Horde_ActiveSync_Imap_Adapter
$imapAdapter
The imap adapter.
$parentFolder read-only
public
string
$parentFolder
he email folder that contains the source email for any SMARTREPLY or SMARTFORWARD requests.
$replacemime
public
bool
$replacemime
Flag to indicate we are to replace the MIME contents of a SMART request.
$reply read-only
public
bool
$reply
Flag indicating a SMARTREPLY request.
$_forward
Flag indicating a SMARTFORWARD request.
protected
bool
$_forward
= \false
$_forwardees
Array of email addresses to forward message to, if using SMART_FORWARD.
protected
array<string|int, mixed>
$_forwardees
= array()
Tags
$_headers
The headers used when sending the email.
protected
Horde_Mime_Header
$_headers
$_id
The UID of the source email for any SMARTREPLY or SMARTFORWARD requests.
protected
int
$_id
$_imap
The imap adapter needed to fetch the source IMAP message if needed.
protected
Horde_ActiveSync_Imap_Adapter
$_imap
$_imapMessage
The message object representing the source email for a SMART[REPLY|FORWARD] request.
protected
Horde_ActiveSync_Imap_Message
$_imapMessage
$_mailer
Internal cache of the mailer used when sending SMART[REPLY|FORWARD].
protected
Horde_Mime_Mail
$_mailer
Used to fetch the raw message used to save to sent mail folder.
$_parentFolder
The email folder that contains the source email for any SMARTREPLY or SMARTFORWARD requests.
protected
string
$_parentFolder
= \false
$_raw
The raw message body sent from the EAS client.
protected
Horde_ActiveSync_Rfc822
$_raw
$_replacemime
Flag indicating the client requested to replace the MIME part a SMARTREPLY or SMARTFORWARD request.
protected
bool
$_replacemime
= \false
$_reply
Flag indicating a SMARTREPLY request.
protected
bool
$_reply
= \false
$_replyTop
Flag to indicate reply position for SMARTREPLY requests.
protected
bool
$_replyTop
= \false
$_user
The current EAS user.
protected
string
$_user
$_version
EAS version in use.
protected
string
$_version
Methods
__construct()
Const'r
public
__construct(Horde_ActiveSync_Imap_Adapter $imap, string $user, int $eas_version) : mixed
Parameters
- $imap : Horde_ActiveSync_Imap_Adapter
-
The IMAP adapter.
- $user : string
-
EAS user.
- $eas_version : int
-
EAS version in use.
__get()
public
& __get(mixed $property) : mixed
Parameters
- $property : mixed
__set()
public
__set(mixed $property, mixed $value) : mixed
Parameters
- $property : mixed
- $value : mixed
getSentMail()
Get the raw message suitable for saving to the sent email folder.
public
getSentMail() : stream
Return values
stream —A stream contianing the raw message.
html2text()
public
static html2text(mixed $msg) : mixed
Parameters
- $msg : mixed
send()
Send the email.
public
send() : mixed
Tags
setForward()
Set this as a SMARTFORWARD requests.
public
setForward(string $parent, int $id[, array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $parent : string
-
The folder containing the source message.
- $id : int
-
The source message UID.
- $params : array<string|int, mixed> = 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.
Tags
setRawMessage()
Set the raw message content received from the EAS client to send.
public
setRawMessage(Horde_ActiveSync_Rfc822 $raw) : mixed
Parameters
- $raw : Horde_ActiveSync_Rfc822
-
The data from the EAS client.
setReply()
Set this as a SMARTREPLY requests.
public
setReply(string $parent, int $id) : mixed
Parameters
- $parent : string
-
The folder containing the source message.
- $id : int
-
The source message UID.
Tags
text2html()
Shortcut function to convert text -> HTML.
public
static text2html(string $msg) : string
Parameters
- $msg : string
-
The message text.
Return values
string —HTML text.
_buildSmartForward()
Build Horde_Mime_Mail object to send email from SmartForward request.
protected
_buildSmartForward() : Horde_Mime_Mail
Return values
Horde_Mime_Mail_buildSmartReply()
Build Horde_Mime_Mail object to send email from SmartReply request.
protected
_buildSmartReply() : Horde_Mime_Mail
Return values
Horde_Mime_Mail_callPreSendHook()
protected
_callPreSendHook() : mixed
_forwardText()
Return the body of the forwarded message in the appropriate type.
protected
_forwardText(array<string|int, mixed> $body_data, Horde_Mime_Part $part[, bool $html = false ]) : string
Parameters
- $body_data : array<string|int, mixed>
-
The body data array of the source msg.
- $part : Horde_Mime_Part
-
The body part of the email to send.
- $html : bool = false
-
Is this an html part?
Return values
string —The propertly formatted forwarded body text.
_getHtmlPart()
Build the HTML part of a SMARTREPLY or SMARTFORWARD
protected
_getHtmlPart(string $html_id, Horde_Mime_Part $mime_message, array<string|int, mixed> $body_data, Horde_Mime_Part $base_part) : string
Parameters
- $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<string|int, mixed>
-
@see Horde_ActiveSync_Imap_Message::getMessageBodyData()
- $base_part : Horde_Mime_Part
-
The base MIME part of the source message for a SMART request.
Return values
string —The plaintext part of the email message that is being sent.
_getIdentityFromAddress()
Return the current user's From address.
protected
_getIdentityFromAddress() : string
Return values
string —A RFC822 valid email string.
_getImapMessage()
Fetch the source message for a SMART request from the IMAP server.
protected
_getImapMessage() : mixed
Tags
_getPlainPart()
Build the text part of a SMARTREPLY or SMARTFORWARD
protected
_getPlainPart(string $plain_id, Horde_Mime_Part $mime_message, array<string|int, mixed> $body_data, Horde_Mime_Part $base_part) : string
Parameters
- $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<string|int, mixed>
-
@see Horde_ActiveSync_Imap_Message::getMessageBodyData()
- $base_part : Horde_Mime_Part
-
The base MIME part of the source message for a SMART request.
Return values
string —The plaintext part of the email message that is being sent.
_getReplyToAddress()
Return the current user's ReplyTo address, if available.
protected
_getReplyToAddress() : string
Return values
string —A RFC822 valid email string.
_getSmartHtmlText()
Return HTML text part from incoming smart request.
protected
_getSmartHtmlText(Horde_Mime_Part $mime_message) : string
Parameters
- $mime_message : Horde_Mime_Part
-
Mime_Part representing the incoming msg
Return values
string —Plain text suitable for setting as the body of mime msg.
_getSmartPlainText()
Return plain text part from incoming smart request.
protected
_getSmartPlainText(Horde_Mime_Part $mime_message) : string
Parameters
- $mime_message : Horde_Mime_Part
-
Mime_Part representing the incoming msg
Return values
string —Plain text suitable for setting as the body of mime msg.
_msgBody()
Return the body text of the original email from a smart request.
protected
_msgBody(array<string|int, mixed> $body_data, Horde_Mime_Part $part, bool $html[, bool $flow = false ]) : string
Parameters
- $body_data : array<string|int, mixed>
-
The body data array of the source msg.
- $part : Horde_Mime_Part
-
The body mime part of the email to send.
- $html : bool
-
Do we want an html body?
- $flow : bool = false
-
Should the body be flowed?
Return values
string —The properly formatted/flowed message body.
_replyText()
Return the body of the replied message in the appropriate type.
protected
_replyText(array<string|int, mixed> $body_data, Horde_Mime_Part $part[, bool $html = false ]) : string
Parameters
- $body_data : array<string|int, mixed>
-
The body data array of the source msg.
- $part : Horde_Mime_Part
- $html : bool = false
-
Is this an html part?
Return values
string —The propertly formatted replied body text.
_sendRaw()
Send the raw message received from the client. E.g., NOT a SMART request.
protected
_sendRaw() : mixed
Tags
_sendSmart()
Sends a SMART response.
protected
_sendSmart() : mixed
Tags
_tidyHtml()
Attempt to sanitize the provided $html string.
protected
_tidyHtml(string $html) : string
Uitilizes the Cleanhtml filter if able, otherwise uses Horde_Dom
Parameters
- $html : string
-
An HTML string to sanitize.
Return values
string —The sanitized HTML.
_tryWithoutBinary()
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(mixed $recipients, array<string|int, mixed> $headers) : bool
Parameters
- $recipients : mixed
- $headers : array<string|int, mixed>