Class IMP_Message
This class contains all functions related to handling messages within IMP.
Actions such as moving, copying, and deleting messages are handled in here
so that code need not be repeated between mailbox, message, and other
pages.
Methods summary
public
boolean
|
#
copy( string $targetMbox, string $action, IMP_Indices $indices, array $opts = array() )
Copies or moves a list of messages to a new mailbox.
Handles search and Trash mailboxes.
Also handles moves to the tasklist and/or notepad applications.
Copies or moves a list of messages to a new mailbox.
Handles search and Trash mailboxes.
Also handles moves to the tasklist and/or notepad applications.
Parameters
- $targetMbox
- <p>The mailbox to move/copy messages to
(UTF-8).</p>
- $action
- Either 'copy' or 'move'.
- $indices
- An indices object.
- $opts
- <p>Additional options:
- create: (boolean) Should the target mailbox be created?
DEFAULT: false
- mailboxob: (IMP_Mailbox_List) Update this mailbox object.
DEFAULT: No update.</p>
Returns
boolean True if successful, false if not.
|
public
integer|boolean
|
#
delete( IMP_Indices $indices, array $opts = array() )
Deletes a list of messages.
Handles search and Trash mailboxes.
Deletes a list of messages.
Handles search and Trash mailboxes.
Parameters
- $indices
- An indices object.
- $opts
- <p>Additional options:
- keeplog: (boolean) Should any history information of the message be
kept?
- mailboxob: (IMP_Mailbox_List) Update this mailbox object.
DEFAULT: No update.
- nuke: (boolean) Override user preferences and nuke (i.e.
permanently delete) the messages instead?</p>
Returns
integer|boolean The number of messages deleted if successful,
false if not.
|
public
boolean
|
#
undelete( IMP_Indices $indices )
Undeletes a list of messages.
Handles search mailboxes.
This function works with IMAP only, not POP3.
Undeletes a list of messages.
Handles search mailboxes.
This function works with IMAP only, not POP3.
Parameters
- $indices
- An indices object.
Returns
boolean True if successful, false if not.
|
public
IMP_Indices
|
#
stripPart( IMP_Indices $indices, string $partid = null, array $opts = array() )
Strips one or all MIME parts out of a message.
Handles search mailboxes.
Strips one or all MIME parts out of a message.
Handles search mailboxes.
Parameters
- $indices
- An indices object.
- $partid
- <p>The MIME ID of the part to strip. All
parts are stripped if null.</p>
- $opts
- <p>Additional options:
- mailboxob: (IMP_Mailbox_List) Update this mailbox object.
DEFAULT: No update.</p>
Returns
Throws
|
public
boolean
|
#
flag( array $action, IMP_Indices $indices, array $opts = array() )
Sets or clears a given flag for a list of messages.
Handles search mailboxes.
This function works with IMAP only, not POP3.
Sets or clears a given flag for a list of messages.
Handles search mailboxes.
This function works with IMAP only, not POP3.
Parameters
- $action
- <p>A list of IMAP flag(s). Keys are 'add'
and/or 'remove'.</p>
- $indices
- An indices object.
- $opts
- <p>Additional options:
- silent: (boolean) Don't output notification messages.
- unchangedsince: (array) The unchangedsince value to pass to the
IMAP store command. Keys are mailbox names, values
are the unchangedsince values to use for that
mailbox.</p>
Returns
boolean True if successful, false if not.
|
public
boolean
|
#
flagAllInMailbox( array $flags, array $mboxes, boolean $action = true )
Adds or removes flag(s) for all messages in a list of mailboxes.
This function works with IMAP only, not POP3.
Adds or removes flag(s) for all messages in a list of mailboxes.
This function works with IMAP only, not POP3.
Parameters
- $flags
- The IMAP flag(s) to add or remove.
- $mboxes
- The list of mailboxes to flag.
- $action
- <p>If true, add the flag(s), otherwise, remove the
flag(s).</p>
Returns
boolean True if successful, false if not.
|
public
IMP_Indices
|
#
expungeMailbox( array $mbox_list, array $opts = array() )
Expunges all deleted messages from the list of mailboxes.
Expunges all deleted messages from the list of mailboxes.
Parameters
- $mbox_list
- <p>The list of mailboxes to empty as keys; an
optional array of indices to delete as values.
If the value is not an array, all messages
flagged as deleted in the mailbox will be
deleted.</p>
- $opts
- <p>Additional options:
- list: (boolean) Return a list of messages expunged.
DEFAULT: false
- mailboxob: (IMP_Mailbox_List) Update this mailbox object.
DEFAULT: No update.</p>
Returns
IMP_Indices
If 'list' option is true, an indices object
containing the messages that have been expunged.
|
public
|
#
emptyMailbox( array $mbox_list )
Empties an entire mailbox.
Empties an entire mailbox.
Parameters
- $mbox_list
- The list of mailboxes to empty.
|