Mail::Box::Maildir::Message(3pm) | User Contributed Perl Documentation | Mail::Box::Maildir::Message(3pm) |
Mail::Box::Maildir::Message - one message in a Maildir folder
Mail::Box::Maildir::Message is a Mail::Box::Dir::Message is a Mail::Box::Message is a Mail::Message is a Mail::Reporter
my $folder = new Mail::Box::Maildir ... my $message = $folder->message(10);
A "Mail::Box::Maildir::Message" represents one message in an Mail::Box::Maildir folder. Each message is stored in a separate file.
Extends "DESCRIPTION" in Mail::Box::Dir::Message.
Extends "METHODS" in Mail::Box::Dir::Message.
Extends "Constructors" in Mail::Box::Dir::Message.
Extends "Constructing a message" in Mail::Box::Dir::Message.
Extends "The message" in Mail::Box::Dir::Message.
Extends "The header" in Mail::Box::Dir::Message.
Extends "The body" in Mail::Box::Dir::Message.
Extends "Flags" in Mail::Box::Dir::Message.
Extends "The whole message as text" in Mail::Box::Dir::Message.
Extends "Internals" in Mail::Box::Dir::Message.
Extends "Error handling" in Mail::Box::Dir::Message.
Extends "Cleanup" in Mail::Box::Dir::Message.
Extends "DETAILS" in Mail::Box::Dir::Message.
Extends "Structure of a Message" in Mail::Box::Dir::Message.
Extends "Message object implementation" in Mail::Box::Dir::Message.
Extends "Message class implementation" in Mail::Box::Dir::Message.
Extends "Labels" in Mail::Box::Dir::Message.
Predefined labels
Extends "Predefined labels" in Mail::Box::Dir::Message.
Status and X-Status fields
Extends "Status and X-Status fields" in Mail::Box::Dir::Message.
Flags in filename
When new messages arrive on system and have to be stored in a maildir folder, they are put in the "new" sub-directory of the folder (first created in the "tmp" sub-directory and then immediately moved to "new"). The following information was found at <http://cr.yp.to/proto/maildir.html>.
Each message is written in a separate file. The filename is constructed from the time-of-arrival, a hostname, an unique component, a syntax marker, and flags. For example "1014220791.meteor.42:2,DF". The filename must match:
my ($time, $unique, $hostname, $info) = $filename =~ m!^(\d+)\.(.*)\.(\w+)(\:.*)?$!; my ($semantics, $flags) = $info =~ m!([12])\,([DFPRST]*)$!; my @flags = split //, $flags;
When an application opens the folder, there may be messages in "new" which are new arival, and messages in "cur". The latter are labeled "accepted". To move a message from "new" to "cur", you have two options with the same effect:
$msg->accept; $msg->label(accept => 1);
See accept(), label(), Mail::Box::Maildir::new(accept_new), and Mail::Box::Maildir::acceptMessages()
The messages are moved, and their name is immediately extended with flags. An example:
new/897979431.meteor.42 may become cur/897979431.meteor.42:2,FS
The added characters ':2,' refer to the "second state of processing", where the message has been inspected. And the characters (which should be in alphabetic order) mean
D => draft F => flagged R => replied (answered) S => seen T => deleted (tagged for deletion)
Some maildir clients support
P => passed (resent/forwarded/bounced to someone else)
The flags will immediately change when label() or delete() is used, which differs from other message implementations: maildir is stateless, and should not break when applications crash.
This module is part of Mail-Box distribution version 3.009, built on August 18, 2020. Website: http://perl.overmeer.net/CPAN/
Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
2020-08-20 | perl v5.30.3 |