The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::IMAP::Server::Message - Represents a message stored in a user's mailbox

METHODS

new STR

Creates a new message, from an RFC2822 string.

mailbox [MAILBOX]

Gets or sets the Net::IMAP::Server::Mailbox that this message is in.

sequence [INTEGER]

Gets or sets the sequence number of this message in its mailbox. Note, however, that due to the semi-transactional nature of IMAP, different connections may see a message as having different sequence numbers! The sequence number stored on the message is the sequence number that a new connection would see; to find out what a connection believes the sequence number of a message to be, use "sequence" in Net::IMAP::Server::Connection.

uid [INTEGER]

Gets or sets the UID of the message. This, paired with the name and UIDVALIDITY of its mailbox, is a unique designator of the message.

internaldate [STRING or DATETIME]

Gets or sets the string representing when the message was received by the server. According to RFC specification, this must be formatted as 01-Jan-2008 15:42:00 -0500 if it is a STRING.

epoch_day_utc

Returns the epoch time of the "internaldate", ignoring times and time zones. This is almost certainly only useful for SEARCH BEFORE and friends.

date

Returns the Date header of the message, as a DateTime object. Returns undef if the date cannot be parsed.

date_day_utc

Similar to "epoch_day_utc", but for the "date" header. That is, it returns the Date header, having stripped off the timezone and time. Returns undef if the Date header cannot be parsed.

expunge

Marks the message as expunged -- this is called by "expunge" in Net::IMAP::Server::Mailbox, which deals with actually removing the message from the appropriate places..

expunged

Returns true if the message has been marked as "to be expunged" by "expunge".

copy_allowed MAILBOX

Returns true if copying this message to the given Net::IMAP::Server::Mailbox MAILBOX is allowed. By default, always returns true;

copy MAILBOX

Copies the message into the given Net::IMAP::Server::Mailbox MAILBOX, and returns the new message.

session_flags

Returns the names of flags that are stored per-session. Defaults to only the \Recent flag.

set_flag FLAG [, SILENT]

Sets the given flag on the message; if a true value is passed for SILENT, mailboxes will not send notification of the change to the client. Returns the old value.

clear_flag FLAG [, SILENT]

Clears the given flag on the message; if a true value is passed for SILENT, mailboxes will not send notification of the change to the client. Returns the old value.

has_flag FLAG

Returns true if the message has the given flag set.

flags

Returns the list of flags which are set on the message.

store STRING FLAGS

Sets the given FLAGS, which should be an array reference, on the message. STRING should be +FLAGS, -FLAGS, or FLAGS; the first sets the set of flags, the second unsets the set of flags, and the third changes the message's flags to exactly match the given set.

mime_header

Returns the Email::Simple::Header of the message.

mime [OBJ]

Gets or sets the Email::MIME object for this message.

fetch SPEC

Takes SPEC, which is either a string or an array reference of strings, and returns a list of strings or data structures which match the specification. The specification is defined by section 7.4.2 of RFC 3501.

mime_select SECTIONS [, START [, END [, EXTRA]]]

This method is generally only used internally by "fetch".

SECTIONS should be an array reference of indexes into MIME parts, or pulled from the set of strings: HEADER, MIME, FIELDS, TEXT. START and END determine which bytes of the resulting content to send. EXTRA is used only for FIELDS, and supplies the names of headers to fetch.

mime_bodystructure [LONG [, MIME]]

Returns a string describing the MIME body structure of the message.

address_envelope HEADER

Returns a data structure defining the email addresses listed in the given HEADER. This is used internally by "mime_envelope".

mime_envelope

Returns a data structure defining properties of significant header fields. This is used internally by "fetch".

prep_for_destroy

Called by the mailbox before the message is torn down; breaks down any circular references.