Mail::Box::Message - manage one message within a mail-folder Mail::Box::Message is a Mail::Message + ::Construct is a Mail::Reporter # Usually these message objects are created indirectly use Mail::Box::Manager; my $manager = Mail::Box::Manager->new; my $folder = $manager->open(folder => 'Mail/Drafts'); my $msg = $folder->message(1); $msg->delete; $msg->size; # and much more These pages do only describe methods which relate to folders. If you access the knowledge of a message, then read "Mail::Message". During its life, a message will pass through certain stages. These stages were introduced to reduce the access-time to the folder. Changing from stage, the message's body and head objects may change. The bottom of this page provides more details about the implementation, but first the use. Methods prefixed with an abbreviation are described in Mail::Message (MM), Mail::Reporter (MR), Mail::Message::Construct (MMC). The general methods for "Mail::Box::Message" objects: MM bcc MR log [LEVEL [,STRINGS]] MMC bounce OPTIONS MM messageId MMC build [MESSAGE|BODY], CONTENT MM modified [BOOL] MMC buildFromBody BODY, HEADERS new OPTIONS MM cc MM nrLines copyTo FOLDER MM parent MM date MM parts ['ALL'|'ACTIVE'|'DELE... MM decoded OPTIONS MM print [FILEHANDLE] delete MMC printStructure [INDENT] deleted [BOOL] MMC read FILEHANDLE|SCALAR|REF-... MM destinations MMC reply OPTIONS MM encode OPTIONS MMC replyPrelude [STRING|FIELD|... MR errors MMC replySubject STRING MMC file MR report [LEVEL] folder [FOLDER] MR reportAll [LEVEL] MMC forward OPTIONS MM send [MAILER], OPTIONS MMC forwardPostlude seqnr [INTEGER] MMC forwardPrelude shortString MMC forwardSubject STRING MM size MM from MMC string MM get FIELD MM subject MM guessTimestamp MM timestamp MM isDummy MM to MM isMultipart MM toplevel MM isPart MR trace [LEVEL] MM label LABEL [,VALUE [LABEL,... MR warnings MMC lines The extra methods for extension writers: MR AUTOLOAD MM labelsToStatus MM DESTROY MR logPriority LEVEL MM body [BODY] MR logSettings MM clone MR notImplemented coerce MESSAGE readBody PARSER, HEAD [, BO... diskDelete MM readFromParser PARSER, [BOD... MM head [HEAD] MM readHead PARSER [,CLASS] MR inGlobalDestruction MM statusToLabels MM isDelayed MM storeBody BODY MM labels MM takeMessageId [STRING] Initialize the runtime variables of a message. The following options are supported: OPTION DESCRIBED IN DEFAULT body Mail::Message undef deleted Mail::Box::Message 0 folder Mail::Box::Message <required> head Mail::Message undef head_wrap Mail::Message 72 log Mail::Reporter 'WARNINGS' messageId Mail::Message undef modified Mail::Message 0 size Mail::Box::Message undef trace Mail::Reporter 'WARNINGS' trusted Mail::Message 0 Only for extension writers: OPTION DESCRIBED IN DEFAULT body_type Mail::Box::Message <from folder> field_type Mail::Message undef head_type Mail::Message 'Mail::Message::Head::Complete' (obligatory) The folder where this message appeared in. The argument is an instance of (a sub-class of) a Mail::Box. If the body of a message is used delay-loaded, the message must what type of message to become when it finally gets parsed. The folder which is delaying the load must specify the algorithm to determine that type. See "Mail::Box::new(body_type)" for a detailed explanation. Is the file deleted from the start? The size of the message, which includes head and body, but without the message separators which may be used by the folder type. In with folder did we detect this message/dummy? This is a reference to the folder-object. Flag the message to be deleted. The real deletion only takes place on a synchronization of the folder. Examples: $message->delete; delete $message; Check or set the deleted flag for this message. This method returns undef (not deleted, false) or the time of deletion (true). With a BOOL argument, the status is changed first. Examples: if($message->deleted) {...} $message->deleted(0); # undelete Get (add set) the number of this message is the current folder. Convert the message header to a short string, representing the most important facts (for debugging purposes only). Copy the message to the indicated opened FOLDER, without deleting the original. The coerced message (the copy) is returned. Example: my $draft = $mgr->open(folder => 'Draft'); $message->copyTo($draft); Coerce a message to be included in a folder. The folder itself is not specified, but the type of the message is transformed correctly. The coerced version of the message is returned. When no changes had to be made, the original message is returned. Read the body of one message. The PARSER gives access to the folder file. The HEAD has been read with "readHead". The optional BODYTYPE supplies the class name of the body to be created, or a code reference to a routine which can produce a body type based on the head (passed as first argument). By default, the BODYTYPE will call "determineBodyType" method of the folder where the message will be added to. Remove a message from disk. This is not from the folder, but everything else, like parts of the message which are stored externally from the folder.

Class structure for messages
As example, the next scheme uses the fake folder-type "XYZ", which may be for instance "Mbox" or "MH". Mail::Box::XYZ::Message ^ | Mail::Box::Message ^ | Mail::Message ::Body ::Head Mail::Box-Overview For support and additional documentation, see http://perl.overmeer.net/mailbox/ Mark Overmeer (mailbox@overmeer.net). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This code is beta, version 2.018. Copyright (c) 2001-2002 Mark Overmeer. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.