The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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.

SETTING MESSAGE FLAGS

$message->mark($flags)

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.

  • P

    Mark the message as "Passed".

  • R

    Mark the message as "Replied".

  • S

    Mark the message as "Seen".

  • T

    Mark the message as "Trashed".

  • D

    Mark the message as a "Draft".

  • F

    Mark the message as "Flagged".

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

Xan Tronix <xan@cpan.org>

COPYRIGHT

Copyright (c) 2014, cPanel, Inc. Distributed under the terms of the MIT license. See the LICENSE file for further details.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 98:

You forgot a '=back' before '=head1'