Property | Type | Description | |
---|---|---|---|
$atcId | integer | Attachment ID counter. | |
$changed | string | Either empty, 'changed', or 'deleted'. | |
$charset | string | The charset to use for sending. |
Property | Type | Description | |
---|---|---|---|
$_atc | array | Attachment data. | |
$_cacheid | string | The cache ID used to store object in session. | |
$_metadata | array | Various metadata for this message. | |
$_replytype | integer | The reply type. |
Method | Description | |
---|---|---|
__construct ( string $cacheid ) | Constructor. | |
__toString ( ) | String representation: the cache ID. | |
__wakeup ( ) | Tasks to do upon unserialize(). | |
_getMessageTextCallback ( $id, $attribute, $node ) : string | Callback used in _getMessageText(). | |
_saveRecipients ( Horde_Mail_Rfc822_List $recipients ) | Save the recipients done in a sendMessage(). | |
addAttachmentFromPart ( Horde_Mime_Part $part ) : IMP_Compose_Attachment | Adds an attachment from Horde_Mime_Part data. | |
addAttachmentFromUpload ( string $field ) : array | Add attachment from uploaded (form) data. | |
addRelatedAttachment ( IMP_Compose_Attachment $atc_ob, DOMElement $node, string $attribute ) | Add an attachment referred to in a related part. | |
additionalAttachmentsAllowed ( ) : mixed | How many more attachments are allowed? | |
attachImapMessage ( IMP_Indices $indices ) : string | Add mail message(s) from the mail server as a message/rfc822 attachment. | |
buildAndSendMessage ( string $body, array $header, IMP_Prefs_Identity $identity, array $opts = [] ) | Builds and sends a MIME message. | |
canCompose ( ) : boolean | Is composing messages allowed? | |
canHtmlCompose ( ) : boolean | Is the HTML editor available for compostion? | |
canUploadAttachment ( ) : boolean | Can attachments be uploaded? | |
count ( ) : integer | Returns the number of attachments currently in this message. | |
deleteAllAttachments ( ) | Deletes all attachments. | |
destroy ( string $action ) | Destroys an IMP_Compose instance. | |
editAsNew ( IMP_Indices $indices, array $opts = [] ) : mixed | Edits a message as new. | |
editTemplate ( IMP_Indices $indices ) : mixed | Edit an existing template message. Saving this template later (using saveTemplate()) will cause the original message to be deleted. | |
forwardMessage ( integer $type, IMP_Contents $contents, boolean $attach = true, array $opts = [] ) : array | Determine the text and headers for a forwarded message. | |
forwardMessageText ( IMP_Contents $contents, array $opts = [] ) : array | Returns the forward text for a message. | |
forwardMultipleMessages ( IMP_Indices $indices ) : array | Prepares a forwarded message using multiple messages. | |
getCacheId ( ) : string | Obtains the cache ID for the session object. | |
getContentsOb ( ) : mixed | If this object contains sufficient metadata, return an IMP_Contents object reflecting that metadata. | |
getHmac ( string $cacheid = null, string $user = null ) : string | Generate HMAC hash used to validate data on a session expiration. Uses the unique compose cache ID of the expired message, the username, and the secret key of the server to generate a reproducible value that can be validated if session data doesn't exist. | |
getIterator ( ) | ||
getMetadata ( string $name ) : mixed | Gets metadata about the current object. | |
hasDrafts ( ) : boolean | Does this message have any drafts associated with it? | |
maxAttachmentSize ( ) : integer | What is the maximum attachment size? | |
offsetExists ( $offset ) | * ArrayAccess methods. | |
offsetGet ( $offset ) | ||
offsetSet ( $offset, $value ) | ||
offsetUnset ( $offset ) | ||
recipientList ( array $hdr ) : array | Cleans up and returns the recipient list. Method designed to parse user entered data; does not encode/validate addresses. | |
recoverSessionExpireDraft ( ) | Restore session expiration draft compose data. | |
redirectMessage ( IMP_Indices $indices ) | Prepare a redirect message. | |
replyMessage ( integer $type, IMP_Contents $contents, array $opts = [] ) : array | Determines the reply text and headers for a message. | |
replyMessageText ( IMP_Contents $contents, array $opts = [] ) : array | Returns the reply text for a message. | |
replyType ( boolean $base = false ) : string | Return the reply type. | |
resumeDraft ( IMP_Indices $indices, array $opts = [] ) : mixed | Resumes a previously saved draft message. | |
saveDraft ( array $headers, mixed $message, array $opts = [] ) : string | Saves a draft message. | |
saveTemplate ( array $headers, mixed $message, array $opts = [] ) : string | Save a template message on the IMAP server. | |
sendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Headers $headers, Horde_Mime_Part $message ) | Sends a message. | |
sendRedirectMessage ( mixed $to, boolean $log = true ) : array | Send a redirect (a/k/a resent) message. See RFC 5322 [3.6.6]. | |
sessionExpireDraft ( Horde_Variables $vars ) | Store draft compose data if session expires. | |
text2html ( string $msg ) : string | Shortcut function to convert text -> HTML for purposes of composition. | |
useTemplate ( IMP_Indices $indices, array $opts = [] ) : mixed | Uses a template to create a message. |
Method | Description | |
---|---|---|
_addAttachment ( string $atc_file, integer $bytes, string $filename, string $type ) : IMP_Compose_Attachment | Adds an attachment to the outgoing compose message. | |
_cleanHtmlOutput ( Horde_Domhtml $html ) | Clean outgoing HTML (remove unexpected data URLs). | |
_convertToRelated ( Horde_Domhtml $html, Horde_Mime_Part $part ) : Horde_Mime_Part | Converts an HTML part to a multipart/related part, if necessary. | |
_createMimeMessage ( string $body, array $options = [] ) : Horde_Mime_Part | Create the base Horde_Mime_Part for sending. | |
_encryptMessage ( Horde_Mime_Part $msg, integer $encrypt, Horde_Mail_Rfc822_List $recip, Horde_Mail_Rfc822_Address $from ) : Horde_Mime_Part | Encrypt an outgoing message. | |
_getMatchingIdentity ( Horde_Mime_Headers $h, array $only = [] ) : integer | Get "tieto" identity information. | |
_getMessageText ( IMP_Contents $contents, array $options = [] ) : mixed | Regenerates body text for use in the compose screen from IMAP data. | |
_getMsgHeaders ( Horde_Mime_Headers $h ) : string | Determine the header information to display in the forward/reply. | |
_linkAttachments ( &$body, mixed $html ) | Adds linked attachments to message. | |
_logSentmail ( Horde_Mime_Headers $headers, Horde_Mail_Rfc822_List $recip, boolean $success ) : string | Log a sent action to the sentmail backend. | |
_msgTextFormat ( array $opts, string $pref_name ) : array | Determine text editor format. | |
_prepSendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Part $message = null ) : string | Sanity checking/MIME formatting before sending a message. | |
_prepSendMessageAssert ( Horde_Mail_Rfc822_List $email ) | Recipiet checks to do if this is a user-generated compose message. | |
_prepSendMessageEncode ( Horde_Mail_Rfc822_List $email, string $charset ) : string | Encode address and do sanity checking on encoded address. | |
_prepareHeaders ( array $headers, array $opts = [] ) : Horde_Mime_Headers | Prepare header object with basic header fields and converts headers to the current compose charset. | |
_resumeDraft ( IMP_Indices $indices, integer $type, array $opts ) : mixed | Resumes a previously saved draft message. | |
_saveDraftMsg ( array $headers, mixed $message, array $opts ) : string | Prepare the draft message. | |
_saveDraftServer ( string $data ) : string | Save a draft message on the IMAP server. | |
_saveToSentMail ( Horde_Mime_Headers $headers, Horde_Mime_Part $save_msg, Horde_Mail_Rfc822_List $recips, array $opts ) | Save message to sent-mail mailbox, if configured to do so. | |
_setMetadata ( string $name, mixed $value ) | Sets metadata for the current object. |
public __construct ( string $cacheid ) | ||
$cacheid | string | The cache ID string. |
protected _addAttachment ( string $atc_file, integer $bytes, string $filename, string $type ) : IMP_Compose_Attachment | ||
$atc_file | string | Temporary file containing attachment contents. |
$bytes | integer | Size of data, in bytes. |
$filename | string | Filename of data. |
$type | string | MIME type of data. |
return | IMP_Compose_Attachment | Attachment object. |
protected _cleanHtmlOutput ( Horde_Domhtml $html ) | ||
$html | Horde_Domhtml | The HTML data. |
protected _convertToRelated ( Horde_Domhtml $html, Horde_Mime_Part $part ) : Horde_Mime_Part | ||
$html | Horde_Domhtml | HTML data. |
$part | Horde_Mime_Part | The HTML part. |
return | Horde_Mime_Part | The part to add to the compose output. |
protected _createMimeMessage ( string $body, array $options = [] ) : Horde_Mime_Part | ||
$body | string | Message body. |
$options | array | Additional options: - html: (boolean) Is this a HTML message? - identity: (IMP_Prefs_Identity) Identity of the sender. - nofinal: (boolean) This is not a message which will be sent out. - noattach: (boolean) Don't add attachment information. - pgp_attach_pubkey: (boolean) Attach the user's PGP public key? - recip: (Horde_Mail_Rfc822_List) The recipient list. - signature: (IMP_Prefs_Identity|string) If set, add the signature to the message. - vcard_attach: (string) If set, attach user's vcard to message. |
return | Horde_Mime_Part | The base MIME part. |
protected _encryptMessage ( Horde_Mime_Part $msg, integer $encrypt, Horde_Mail_Rfc822_List $recip, Horde_Mail_Rfc822_Address $from ) : Horde_Mime_Part | ||
$msg | Horde_Mime_Part | Outgoing message. |
$encrypt | integer | Encryption type. |
$recip | Horde_Mail_Rfc822_List | Recipient list. |
$from | Horde_Mail_Rfc822_Address | Sending address. |
return | Horde_Mime_Part | $msg Processed outgoing message. |
protected _getMatchingIdentity ( Horde_Mime_Headers $h, array $only = [] ) : integer | ||
$h | Horde_Mime_Headers | The headers object for the message. |
$only | array | Only use these headers. |
return | integer | The matching identity. If no exact match, returns the default identity. |
protected _getMessageText ( IMP_Contents $contents, array $options = [] ) : mixed | ||
$contents | IMP_Contents | An IMP_Contents object. |
$options | array | Additional options:
|
return | mixed | Null if bodypart not found, or array with the following keys: - charset: (string) The guessed charset to use. - flowed: (Horde_Text_Flowed) A flowed object, if the text is flowed. Otherwise, null. - id: (string) The MIME ID of the bodypart. - mode: (string) Either 'text' or 'html'. - text: (string) The body text. |
public _getMessageTextCallback ( $id, $attribute, $node ) : string | ||
return | string | Replacement text. |
protected _getMsgHeaders ( Horde_Mime_Headers $h ) : string | ||
$h | Horde_Mime_Headers | The headers object for the message. |
return | string | The header information for the original message. |
protected _linkAttachments ( &$body, mixed $html ) | ||
$html | mixed | HTML data (Horde_Domhtml) or null. |
protected _logSentmail ( Horde_Mime_Headers $headers, Horde_Mail_Rfc822_List $recip, boolean $success ) : string | ||
$headers | Horde_Mime_Headers | Message headers. |
$recip | Horde_Mail_Rfc822_List | Message recipients. |
$success | boolean | Send success. |
return | string | Message-ID value. |
protected _prepSendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Part $message = null ) : string | ||
Horde_Mail_Rfc822_List | The e-mail list to send to. | |
$message | Horde_Mime_Part | The object that contains the text to send. |
return | string | The encoded $email list. |
protected _prepSendMessageAssert ( Horde_Mail_Rfc822_List $email ) | ||
Horde_Mail_Rfc822_List | The e-mail list to send to. |
protected _prepSendMessageEncode ( Horde_Mail_Rfc822_List $email, string $charset ) : string | ||
Horde_Mail_Rfc822_List | The e-mail list to send to. | |
$charset | string | The charset to encode to. |
return | string | The encoded $email list. |
protected _prepareHeaders ( array $headers, array $opts = [] ) : Horde_Mime_Headers | ||
$headers | array | Array with 'from', 'to', 'cc', 'bcc', and 'subject' values. |
$opts | array | An array of options w/the following keys: - priority: (string) The message priority ('high', 'normal', 'low'). |
return | Horde_Mime_Headers | Headers object with the appropriate headers set. |
protected _saveDraftMsg ( array $headers, mixed $message, array $opts ) : string | ||
$headers | array | List of message headers. |
$message | mixed | Either the message text (string) or a Horde_Mime_Part object that contains the text to send. |
$opts | array | An array of options w/the following keys: - html: (boolean) Is this an HTML message? - priority: (string) The message priority ('high', 'normal', 'low'). - readreceipt: (boolean) Add return receipt headers? - verify_email: (boolean) Verify e-mail messages? Default: no. |
return | string | The body text. |
protected _saveDraftServer ( string $data ) : string | ||
$data | string | The text of the draft message. |
return | string | Status string (not HTML escaped). |
public _saveRecipients ( Horde_Mail_Rfc822_List $recipients ) | ||
$recipients | Horde_Mail_Rfc822_List | The list of recipients. |
protected _saveToSentMail ( Horde_Mime_Headers $headers, Horde_Mime_Part $save_msg, Horde_Mail_Rfc822_List $recips, array $opts ) | ||
$headers | Horde_Mime_Headers | Headers object. |
$save_msg | Horde_Mime_Part | Message data to save. |
$recips | Horde_Mail_Rfc822_List | Recipient list. |
$opts | array | See buildAndSendMessage() |
protected _setMetadata ( string $name, mixed $value ) | ||
$name | string | The metadata name. |
$value | mixed | The metadata value. |
public addAttachmentFromPart ( Horde_Mime_Part $part ) : IMP_Compose_Attachment | ||
$part | Horde_Mime_Part | The object that contains the attachment data. |
return | IMP_Compose_Attachment | Attachment object. |
public addAttachmentFromUpload ( string $field ) : array | ||
$field | string | The form field name. |
return | array | A list of IMP_Compose_Attachment objects (if successfully attached) or IMP_Compose_Exception objects (if error when attaching). |
public addRelatedAttachment ( IMP_Compose_Attachment $atc_ob, DOMElement $node, string $attribute ) | ||
$atc_ob | IMP_Compose_Attachment | |
$node | DOMElement | Node element containg the related reference. |
$attribute | string | Element attribute containing the related reference. |
public additionalAttachmentsAllowed ( ) : mixed | ||
return | mixed | Returns true if no attachment limit. Else returns the number of additional attachments allowed. |
public attachImapMessage ( IMP_Indices $indices ) : string | ||
$indices | IMP_Indices | An indices object. |
return | string | Subject string. |
public buildAndSendMessage ( string $body, array $header, IMP_Prefs_Identity $identity, array $opts = [] ) | ||
$body | string | The message body. |
$header | array | List of message headers. |
$identity | IMP_Prefs_Identity | The Identity object for the sender of this message. |
$opts | array | An array of options w/the following keys: - encrypt: (integer) A flag whether to encrypt or sign the message. One of: - IMP_Pgp::ENCRYPT - IMP_Pgp::SIGNENC - IMP_Smime::ENCRYPT - IMP_Smime::SIGNENC - html: (boolean) Whether this is an HTML message. DEFAULT: false - pgp_attach_pubkey: (boolean) Attach the user's PGP public key to the message? - priority: (string) The message priority ('high', 'normal', 'low'). - save_sent: (boolean) Save sent mail? - sent_mail: (IMP_Mailbox) The sent-mail mailbox (UTF-8). - strip_attachments: (bool) Strip attachments from the message? - signature: (string) The message signature. - readreceipt: (boolean) Add return receipt headers? - useragent: (string) The User-Agent string to use. - vcard_attach: (string) Attach the user's vCard (value is name to display as vcard filename). |
public static canCompose ( ) : boolean | ||
return | boolean | True if compose allowed. |
public static canHtmlCompose ( ) : boolean | ||
return | boolean | True if HTML editor is available. |
public static canUploadAttachment ( ) : boolean | ||
return | boolean | True if attachments can be uploaded. |
public editTemplate ( IMP_Indices $indices ) : mixed | ||
$indices | IMP_Indices | An indices object. |
return | mixed | See resumeDraft(). |
public forwardMessage ( integer $type, IMP_Contents $contents, boolean $attach = true, array $opts = [] ) : array | ||
$type | integer | The forward type (self::FORWARD* constant). |
$contents | IMP_Contents | An IMP_Contents object. |
$attach | boolean | Attach the forwarded message? |
$opts | array | Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine. |
return | array | An array with the following keys: - attach: (boolean) True if original message was attached. - body: (string) The text of the body part. - format: (string) The format of the body message ('html', 'text'). - identity: (mixed) See IMP_Prefs_Identity#getMatchingIdentity(). - subject: (string) Formatted subject. - title: (string) Title to use on page. - type: (integer) - The compose type. |
public forwardMessageText ( IMP_Contents $contents, array $opts = [] ) : array | ||
$contents | IMP_Contents | An IMP_Contents object. |
$opts | array | Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine. |
return | array | An array with the following keys: - body: (string) The text of the body part. - charset: (string) The guessed charset to use for the forward. - format: (string) The format of the body message ('html', 'text'). |
public forwardMultipleMessages ( IMP_Indices $indices ) : array | ||
$indices | IMP_Indices | An indices object containing the indices of the forwarded messages. |
return | array | An array with the following keys: - body: (string) The text of the body part. - format: (string) The format of the body message ('html', 'text'). - identity: (mixed) See IMP_Prefs_Identity#getMatchingIdentity(). - subject: (string) Formatted subject. - title: (string) Title to use on page. - type: (integer) The compose type. |
public getCacheId ( ) : string | ||
return | string | The message cache ID. |
public getContentsOb ( ) : mixed | ||
return | mixed | Either an IMP_Contents object or null. |
public getMetadata ( string $name ) : mixed | ||
$name | string | The metadata name. |
return | mixed | The metadata value or null if it doesn't exist. |
public static maxAttachmentSize ( ) : integer | ||
return | integer | The maximum attachment size (in bytes). |
public recipientList ( array $hdr ) : array | ||
$hdr | array | An array of MIME headers and/or address list objects. Recipients will be extracted from the 'to', 'cc', and 'bcc' entries. |
return | array | An array with the following entries: - has_input: (boolean) True if at least one of the headers contains user input. - header: (array) Contains the cleaned up 'to', 'cc', and 'bcc' address list (Horde_Mail_Rfc822_List objects). - list: (Horde_Mail_Rfc822_List) Recipient addresses. |
public recoverSessionExpireDraft ( ) |
public redirectMessage ( IMP_Indices $indices ) | ||
$indices | IMP_Indices | An indices object. |
public replyMessage ( integer $type, IMP_Contents $contents, array $opts = [] ) : array | ||
$type | integer | The reply type (self::REPLY* constant). |
$contents | IMP_Contents | An IMP_Contents object. |
$opts | array | Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine. - to: (string) The recipient of the reply. Overrides the automatically determined value. |
return | array | An array with the following keys: - addr: (array) Address lists (to, cc, bcc; Horde_Mail_Rfc822_List objects). - body: (string) The text of the body part. - format: (string) The format of the body message (html, text). - identity: (integer) The identity to use for the reply based on the original message's addresses. - lang: (array) Language code (keys)/language name (values) of the original sender's preferred language(s). - reply_list_id: (string) List ID label. - reply_recip: (integer) Number of recipients in reply list. - subject: (string) Formatted subject. - type: (integer) The reply type used (either self::REPLY_ALL, self::REPLY_LIST, or self::REPLY_SENDER). |
public replyMessageText ( IMP_Contents $contents, array $opts = [] ) : array | ||
$contents | IMP_Contents | An IMP_Contents object. |
$opts | array | Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine. |
return | array | An array with the following keys: - body: (string) The text of the body part. - charset: (string) The guessed charset to use for the reply. - format: (string) The format of the body message ('html', 'text'). |
public resumeDraft ( IMP_Indices $indices, array $opts = [] ) : mixed | ||
$indices | IMP_Indices | An indices object. |
$opts | array | Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine. |
return | mixed | An array with the following keys: - addr: (array) Address lists (to, cc, bcc; Horde_Mail_Rfc822_List objects). - body: (string) The text of the body part. - format: (string) The format of the body message ('html', 'text'). - identity: (mixed) See IMP_Prefs_Identity#getMatchingIdentity(). - priority: (string) The message priority. - readreceipt: (boolean) Add return receipt headers? - subject: (string) Formatted subject. - type: (integer) - The compose type. |
public saveDraft ( array $headers, mixed $message, array $opts = [] ) : string | ||
$headers | array | List of message headers (UTF-8). |
$message | mixed | Either the message text (string) or a Horde_Mime_Part object that contains the text to send. |
$opts | array | An array of options w/the following keys: - autosave: (boolean) Is this an auto-saved draft? - html: (boolean) Is this an HTML message? - priority: (string) The message priority ('high', 'normal', 'low'). - readreceipt: (boolean) Add return receipt headers? |
return | string | Notification text on success (not HTML encoded). |
public saveTemplate ( array $headers, mixed $message, array $opts = [] ) : string | ||
$headers | array | List of message headers (UTF-8). |
$message | mixed | Either the message text (string) or a Horde_Mime_Part object that contains the text to save. |
$opts | array | An array of options w/the following keys: - html: (boolean) Is this an HTML message? - priority: (string) The message priority ('high', 'normal', 'low'). - readreceipt: (boolean) Add return receipt headers? |
return | string | Notification text on success. |
public sendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Headers $headers, Horde_Mime_Part $message ) | ||
Horde_Mail_Rfc822_List | The e-mail list to send to. | |
$headers | Horde_Mime_Headers | The object holding this message's headers. |
$message | Horde_Mime_Part | The object that contains the text to send. |
public sendRedirectMessage ( mixed $to, boolean $log = true ) : array | ||
$to | mixed | The addresses to redirect to. |
$log | boolean | Whether to log the resending in the history and sentmail log. |
return | array | An object with the following properties for each redirected message: - contents: (IMP_Contents) The contents object. - headers: (Horde_Mime_Headers) The header object. - mbox: (IMP_Mailbox) Mailbox of the message. - uid: (string) UID of the message. |
public sessionExpireDraft ( Horde_Variables $vars ) | ||
$vars | Horde_Variables | Object with the form data. |
public useTemplate ( IMP_Indices $indices, array $opts = [] ) : mixed | ||
$indices | IMP_Indices | An indices object. |
$opts | array | Additional options: - format: (string) Force to this format. DEFAULT: Auto-determine. |
return | mixed | See resumeDraft(). |
protected string $_cacheid | ||
return | string |
protected array $_metadata | ||
return | array |
public string $changed | ||
return | string |