NAME
Mail::Dir::Message - A message in a Maildir queue
SYNOPSIS
#
# Mark message as Draft
#
$message->mark('D');
#
# Verify that message was marked as Draft
#
print "Message is a draft\n" if $message->draft;
DESCRIPTION
Mail::Dir::Message objects represent messages delivered to a Maildir mailbox, and are created queries to the mailbox as issued by the method Mail::Dir->messages(). Mail::Dir::Message objects are not presently meant to be instantiated directly.
READING MESSAGES
$message->open()-
Open the current message, returning a file handle. Will die() if any errors are encountered. It is the caller's responsibility to subsequently close the file handle when it is no longer required.
MOVING MESSAGES
$message->move($mailbox)-
Move the current message to a different Maildir++ mailbox. This operation is only supported when the originating mailbox is created with Maildir++ extensions.
REMOVING MESSAGES
$message->remove()-
Unlink the current message. This method has the same return value as "unlink" in perlfunc. Note: if removal succeeds, the object is no longer valid and should be disposed of.
Do not use this to soft-delete messages. For that, set the
Tflag instead.
SETTING MESSAGE FLAGS
$message->mark($flags, $queue)-
Set any of the following message status flags on the current message. More than one flag may be specified in a single call, in any order.
PMark the message as "Passed".
RMark the message as "Replied".
SMark the message as "Seen".
TMark the message as "Trashed".
DMark the message as a "Draft".
FMark the message as "Flagged".
You can also specify the queue to which the message will be moved:
Missing or undefined
Move the message to
cur.tmpMove the message to
tmp.newMove the message to
new.curMove the message to
cur.keepqKeep the message in the same queue, do not move it.
CHECKING MESSAGE STATE
The following methods can be used to quickly check for specific message state flags.
$message->flags()-
Returns a string containing all the flags set for the current message.
$message->passed()-
Returns 1 if the message currently has the "Passed" flag set.
$message->replied()-
Returns 1 if the message has been replied to.
$message->seen()-
Returns 1 if a client has read the current message.
$message->trashed()-
Returns 1 if the message is currently trashed after one helluva wild night with its best buds.
$message->draft()-
Returns 1 if the message is a draft.
$message->flagged()-
Returns 1 if the message is flagged as important.
AUTHOR
Alexandra Hrefna Hilmisdóttir <xan@cpan.org>
COPYRIGHT
Copyright (c) 2016, cPanel, Inc. Distributed under the terms of the MIT license. See the LICENSE file for further details.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 257:
You forgot a '=back' before '=head1'
- Around line 345:
Non-ASCII character seen before =encoding in 'Hilmisdóttir'. Assuming UTF-8