View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Alex Vandiver > Net-IMAP-Server-1.39 > Net::IMAP::Server::Message



Annotate this POD


New  2
Open  1
View/Report Bugs


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


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.


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.


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


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


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.


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..


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;


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


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.


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


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.


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".


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


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

syntax highlighting: