.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Mail::Box::MH 3" .TH Mail::Box::MH 3 2026-04-11 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Mail::Box::MH \- handle MH folders .SH INHERITANCE .IX Header "INHERITANCE" .Vb 4 \& Mail::Box::MH \& is a Mail::Box::Dir \& is a Mail::Box \& is a Mail::Reporter .Ve .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use Mail::Box::MH; \& my $folder = Mail::Box::MH\->new(folder => $ENV{MAIL}, ...); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This documentation describes how MH mailboxes work, and what you can do with the MH folder object \f(CW\*(C`Mail::Box::MH\*(C'\fR. .PP Extends "DESCRIPTION" in Mail::Box::Dir. .SH OVERLOADED .IX Header "OVERLOADED" Extends "OVERLOADED" in Mail::Box::Dir. .IP "overload: \fB\*(Aq""""\*(Aq\fR stringification" 4 .IX Item "overload: '""""' stringification" Inherited, see "OVERLOADED" in Mail::Box .IP "overload: \fB\*(Aq@{}\*(Aq\fR use as ARRAY" 4 .IX Item "overload: '@{}' use as ARRAY" Inherited, see "OVERLOADED" in Mail::Box .IP "overload: \fBcmp\fR string comparison" 4 .IX Item "overload: cmp string comparison" Inherited, see "OVERLOADED" in Mail::Box .SH METHODS .IX Header "METHODS" Extends "METHODS" in Mail::Box::Dir. .SS Constructors .IX Subsection "Constructors" Extends "Constructors" in Mail::Box::Dir. .ie n .IP $class\->\fBnew\fR(%options) 4 .el .IP \f(CW$class\fR\->\fBnew\fR(%options) 4 .IX Item "$class->new(%options)" Inherited, see "Constructors" in Mail::Box .Sp .Vb 10 \& \-Option \-\-Defined in \-\-Default \& access Mail::Box \*(Aqr\*(Aq \& body_delayed_type Mail::Box Mail::Message::Body::Delayed \& body_type Mail::Box Mail::Message::Body::Lines \& coerce_options Mail::Box +[] \& create Mail::Box false \& directory Mail::Box::Dir \& extract Mail::Box 10240 \& field_type Mail::Box undef \& fix_headers Mail::Box false \& folder Mail::Box $ENV{MAIL} \& folderdir Mail::Box $ENV{HOME}/.mh \& head_delayed_type Mail::Box Mail::Message::Head::Delayed \& head_type Mail::Box Mail::Message::Head::Complete \& index undef \& index_filename /.index \& index_type Mail::Box::MH::Index \& keep_dups Mail::Box false \& keep_index false \& labels undef \& labels_filename /.mh_sequence \& labels_type Mail::Box::MH::Labels \& lock_file Mail::Box \& lock_timeout Mail::Box 1 hour \& lock_type Mail::Box Mail::Box::Locker::DotLock \& lock_wait Mail::Box 10 seconds \& locker Mail::Box undef \& manager Mail::Box undef \& message_type Mail::Box ::Message \& multipart_type Mail::Box Mail::Message::Body::Multipart \& remove_when_empty Mail::Box true \& save_on_exit Mail::Box true \& trusted Mail::Box .Ve .RS 4 .ie n .IP "access => $mode" 2 .el .IP "access => \f(CW$mode\fR" 2 .IX Item "access => $mode" .PD 0 .IP "body_delayed_type => CLASS" 2 .IX Item "body_delayed_type => CLASS" .IP "body_type => CLASS|CODE" 2 .IX Item "body_type => CLASS|CODE" .IP "coerce_options => ARRAY" 2 .IX Item "coerce_options => ARRAY" .IP "create => BOOLEAN" 2 .IX Item "create => BOOLEAN" .ie n .IP "directory => $directory" 2 .el .IP "directory => \f(CW$directory\fR" 2 .IX Item "directory => $directory" .IP "extract => INTEGER|CODE|METHOD|\*(AqLAZY\*(Aq|\*(AqALWAYS\*(Aq" 2 .IX Item "extract => INTEGER|CODE|METHOD|'LAZY'|'ALWAYS'" .ie n .IP "field_type => $class" 2 .el .IP "field_type => \f(CW$class\fR" 2 .IX Item "field_type => $class" .IP "fix_headers => BOOLEAN" 2 .IX Item "fix_headers => BOOLEAN" .ie n .IP "folder => $name" 2 .el .IP "folder => \f(CW$name\fR" 2 .IX Item "folder => $name" .ie n .IP "folderdir => $directory" 2 .el .IP "folderdir => \f(CW$directory\fR" 2 .IX Item "folderdir => $directory" .ie n .IP "head_delayed_type => $class" 2 .el .IP "head_delayed_type => \f(CW$class\fR" 2 .IX Item "head_delayed_type => $class" .ie n .IP "head_type => $class" 2 .el .IP "head_type => \f(CW$class\fR" 2 .IX Item "head_type => $class" .ie n .IP "index => $object" 2 .el .IP "index => \f(CW$object\fR" 2 .IX Item "index => $object" .PD You may specify an \f(CW$object\fR of a type which extends Mail::Box::MH::Index (at least implements a \f(CWget()\fR method), as alternative for an index file reader as created by \f(CW\*(C`Mail::Box::MH\*(C'\fR. .ie n .IP "index_filename => $file" 2 .el .IP "index_filename => \f(CW$file\fR" 2 .IX Item "index_filename => $file" The \f(CW$file\fR which is used in each directory to store the headers of all mails. The filename shall not contain a directory path. (e.g. Do not use \&\f(CW\*(C`/usr/people/jan/.index\*(C'\fR, nor \f(CW\*(C`subdir/.index\*(C'\fR, but say \f(CW\*(C`.index\*(C'\fR.) .ie n .IP "index_type => $class" 2 .el .IP "index_type => \f(CW$class\fR" 2 .IX Item "index_type => $class" .PD 0 .IP "keep_dups => BOOLEAN" 2 .IX Item "keep_dups => BOOLEAN" .IP "keep_index => BOOLEAN" 2 .IX Item "keep_index => BOOLEAN" .PD Keep an index file of the specified mailbox, one file per directory. Using an index file will speed up things considerably, because it avoids reading all the message files the moment that you open the folder. When you open a folder, you can use the index file to retrieve information such as the subject of each message, instead of having to read possibly thousands of messages. .ie n .IP "labels => $object" 2 .el .IP "labels => \f(CW$object\fR" 2 .IX Item "labels => $object" You may specify an \f(CW$object\fR of a type which extends Mail::Box::MH::Labels (at least implements the \f(CWget()\fR method), as alternative for labels file reader as created by \f(CW\*(C`Mail::Box::MH\*(C'\fR. .ie n .IP "labels_filename => $file" 2 .el .IP "labels_filename => \f(CW$file\fR" 2 .IX Item "labels_filename => $file" In MH\-folders, messages can be labeled, for instance based on the sender or whether it is read or not. This status is kept in a \&\f(CW$file\fR which is usually called \f(CW\*(C`.mh_sequences\*(C'\fR, but that name can be overruled with this flag. .ie n .IP "labels_type => $class" 2 .el .IP "labels_type => \f(CW$class\fR" 2 .IX Item "labels_type => $class" .PD 0 .ie n .IP "lock_file => $file" 2 .el .IP "lock_file => \f(CW$file\fR" 2 .IX Item "lock_file => $file" .ie n .IP "lock_timeout => $seconds" 2 .el .IP "lock_timeout => \f(CW$seconds\fR" 2 .IX Item "lock_timeout => $seconds" .ie n .IP "lock_type => $class|$name|\e@names" 2 .el .IP "lock_type => \f(CW$class\fR|$name|\e@names" 2 .IX Item "lock_type => $class|$name|@names" .ie n .IP "lock_wait => $seconds" 2 .el .IP "lock_wait => \f(CW$seconds\fR" 2 .IX Item "lock_wait => $seconds" .ie n .IP "locker => $locker" 2 .el .IP "locker => \f(CW$locker\fR" 2 .IX Item "locker => $locker" .ie n .IP "manager => $manager" 2 .el .IP "manager => \f(CW$manager\fR" 2 .IX Item "manager => $manager" .ie n .IP "message_type => $class" 2 .el .IP "message_type => \f(CW$class\fR" 2 .IX Item "message_type => $class" .IP "multipart_type => CLASS" 2 .IX Item "multipart_type => CLASS" .IP "remove_when_empty => BOOLEAN" 2 .IX Item "remove_when_empty => BOOLEAN" .IP "save_on_exit => BOOLEAN" 2 .IX Item "save_on_exit => BOOLEAN" .IP "trusted => BOOLEAN" 2 .IX Item "trusted => BOOLEAN" .PD .RE .RS 4 .RE .SS Attributes .IX Subsection "Attributes" Extends "Attributes" in Mail::Box::Dir. .ie n .IP $obj\->\fBfixHeaders\fR() 4 .el .IP \f(CW$obj\fR\->\fBfixHeaders\fR() 4 .IX Item "$obj->fixHeaders()" Inherited, see "Attributes" in Mail::Box .ie n .IP "$obj\->\fBfolderdir\fR( [$directory] )" 4 .el .IP "\f(CW$obj\fR\->\fBfolderdir\fR( [$directory] )" 4 .IX Item "$obj->folderdir( [$directory] )" Inherited, see "Attributes" in Mail::Box .ie n .IP $obj\->\fBisTrusted\fR() 4 .el .IP \f(CW$obj\fR\->\fBisTrusted\fR() 4 .IX Item "$obj->isTrusted()" Inherited, see "Attributes" in Mail::Box .ie n .IP $obj\->\fBname\fR() 4 .el .IP \f(CW$obj\fR\->\fBname\fR() 4 .IX Item "$obj->name()" Inherited, see "Attributes" in Mail::Box .ie n .IP $obj\->\fBremoveEmpty\fR() 4 .el .IP \f(CW$obj\fR\->\fBremoveEmpty\fR() 4 .IX Item "$obj->removeEmpty()" Inherited, see "Attributes" in Mail::Box .ie n .IP $obj\->\fBtype\fR() 4 .el .IP \f(CW$obj\fR\->\fBtype\fR() 4 .IX Item "$obj->type()" Inherited, see "Attributes" in Mail::Box .SS "The folder" .IX Subsection "The folder" Extends "The folder" in Mail::Box::Dir. .ie n .IP "$obj\->\fBaddMessage\fR($message, %options)" 4 .el .IP "\f(CW$obj\fR\->\fBaddMessage\fR($message, \f(CW%options\fR)" 4 .IX Item "$obj->addMessage($message, %options)" Inherited, see "The folder" in Mail::Box .ie n .IP $obj\->\fBaddMessages\fR(@messages) 4 .el .IP \f(CW$obj\fR\->\fBaddMessages\fR(@messages) 4 .IX Item "$obj->addMessages(@messages)" Inherited, see "The folder" in Mail::Box .ie n .IP $class\->\fBappendMessages\fR(%options) 4 .el .IP \f(CW$class\fR\->\fBappendMessages\fR(%options) 4 .IX Item "$class->appendMessages(%options)" Append a message to a folder which is not open. Improves base, see "The folder" in Mail::Box .Sp .Vb 5 \& \-Option \-\-Defined in \-\-Default \& folder Mail::Box \& message Mail::Box undef \& messages Mail::Box undef \& share Mail::Box false .Ve .RS 4 .ie n .IP "folder => $name" 2 .el .IP "folder => \f(CW$name\fR" 2 .IX Item "folder => $name" .PD 0 .ie n .IP "message => $message" 2 .el .IP "message => \f(CW$message\fR" 2 .IX Item "message => $message" .ie n .IP "messages => $message|\e@messages" 2 .el .IP "messages => \f(CW$message\fR|\e@messages" 2 .IX Item "messages => $message|@messages" .IP "share => BOOLEAN" 2 .IX Item "share => BOOLEAN" .PD .RE .RS 4 .RE .ie n .IP $obj\->\fBclose\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBclose\fR(%options) 4 .IX Item "$obj->close(%options)" Inherited, see "The folder" in Mail::Box .ie n .IP "$obj\->\fBcopyTo\fR($folder, %options)" 4 .el .IP "\f(CW$obj\fR\->\fBcopyTo\fR($folder, \f(CW%options\fR)" 4 .IX Item "$obj->copyTo($folder, %options)" Inherited, see "The folder" in Mail::Box .ie n .IP $obj\->\fBdelete\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBdelete\fR(%options) 4 .IX Item "$obj->delete(%options)" Inherited, see "The folder" in Mail::Box .ie n .IP $obj\->\fBdirectory\fR() 4 .el .IP \f(CW$obj\fR\->\fBdirectory\fR() 4 .IX Item "$obj->directory()" Inherited, see "The folder" in Mail::Box::Dir .ie n .IP $obj\->\fBorganization\fR() 4 .el .IP \f(CW$obj\fR\->\fBorganization\fR() 4 .IX Item "$obj->organization()" Inherited, see "The folder" in Mail::Box .ie n .IP $obj\->\fBsize\fR() 4 .el .IP \f(CW$obj\fR\->\fBsize\fR() 4 .IX Item "$obj->size()" Inherited, see "The folder" in Mail::Box .ie n .IP $obj\->\fBupdate\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBupdate\fR(%options) 4 .IX Item "$obj->update(%options)" Inherited, see "The folder" in Mail::Box .ie n .IP $obj\->\fBurl\fR() 4 .el .IP \f(CW$obj\fR\->\fBurl\fR() 4 .IX Item "$obj->url()" Inherited, see "The folder" in Mail::Box .SS "Folder flags" .IX Subsection "Folder flags" Extends "Folder flags" in Mail::Box::Dir. .ie n .IP $obj\->\fBaccess\fR() 4 .el .IP \f(CW$obj\fR\->\fBaccess\fR() 4 .IX Item "$obj->access()" Inherited, see "Folder flags" in Mail::Box .ie n .IP $obj\->\fBisModified\fR() 4 .el .IP \f(CW$obj\fR\->\fBisModified\fR() 4 .IX Item "$obj->isModified()" Inherited, see "Folder flags" in Mail::Box .ie n .IP "$obj\->\fBmodified\fR( [BOOLEAN] )" 4 .el .IP "\f(CW$obj\fR\->\fBmodified\fR( [BOOLEAN] )" 4 .IX Item "$obj->modified( [BOOLEAN] )" Inherited, see "Folder flags" in Mail::Box .ie n .IP $obj\->\fBwritable\fR() 4 .el .IP \f(CW$obj\fR\->\fBwritable\fR() 4 .IX Item "$obj->writable()" Inherited, see "Folder flags" in Mail::Box .SS "The messages" .IX Subsection "The messages" Extends "The messages" in Mail::Box::Dir. .ie n .IP "$obj\->\fBcurrent\fR( [$number|$message|$message_id] )" 4 .el .IP "\f(CW$obj\fR\->\fBcurrent\fR( [$number|$message|$message_id] )" 4 .IX Item "$obj->current( [$number|$message|$message_id] )" Inherited, see "The messages" in Mail::Box .ie n .IP $obj\->\fBfind\fR($message_id) 4 .el .IP \f(CW$obj\fR\->\fBfind\fR($message_id) 4 .IX Item "$obj->find($message_id)" Inherited, see "The messages" in Mail::Box .ie n .IP "$obj\->\fBfindFirstLabeled\fR( $label, [BOOLEAN, [\e@msgs]] )" 4 .el .IP "\f(CW$obj\fR\->\fBfindFirstLabeled\fR( \f(CW$label\fR, [BOOLEAN, [\e@msgs]] )" 4 .IX Item "$obj->findFirstLabeled( $label, [BOOLEAN, [@msgs]] )" Inherited, see "The messages" in Mail::Box .ie n .IP "$obj\->\fBmessage\fR( $index, [$message] )" 4 .el .IP "\f(CW$obj\fR\->\fBmessage\fR( \f(CW$index\fR, [$message] )" 4 .IX Item "$obj->message( $index, [$message] )" Inherited, see "The messages" in Mail::Box .ie n .IP "$obj\->\fBmessageId\fR( $message_id, [$message] )" 4 .el .IP "\f(CW$obj\fR\->\fBmessageId\fR( \f(CW$message_id\fR, [$message] )" 4 .IX Item "$obj->messageId( $message_id, [$message] )" Inherited, see "The messages" in Mail::Box .ie n .IP $obj\->\fBmessageIds\fR() 4 .el .IP \f(CW$obj\fR\->\fBmessageIds\fR() 4 .IX Item "$obj->messageIds()" Inherited, see "The messages" in Mail::Box .ie n .IP "$obj\->\fBmessages\fR( <\*(AqALL\*(Aq|$range|\*(AqACTIVE\*(Aq|\*(AqDELETED\*(Aq|$label| !$label|$filter> )" 4 .el .IP "\f(CW$obj\fR\->\fBmessages\fR( <\*(AqALL\*(Aq|$range|\*(AqACTIVE\*(Aq|\*(AqDELETED\*(Aq|$label| !$label|$filter> )" 4 .IX Item "$obj->messages( <'ALL'|$range|'ACTIVE'|'DELETED'|$label| !$label|$filter> )" Inherited, see "The messages" in Mail::Box .ie n .IP $obj\->\fBnrMessages\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBnrMessages\fR(%options) 4 .IX Item "$obj->nrMessages(%options)" Inherited, see "The messages" in Mail::Box .ie n .IP "$obj\->\fBscanForMessages\fR($message, $message_ids, $timespan, $window)" 4 .el .IP "\f(CW$obj\fR\->\fBscanForMessages\fR($message, \f(CW$message_ids\fR, \f(CW$timespan\fR, \f(CW$window\fR)" 4 .IX Item "$obj->scanForMessages($message, $message_ids, $timespan, $window)" Inherited, see "The messages" in Mail::Box .SS Sub\-folders .IX Subsection "Sub-folders" Extends "Sub\-folders" in Mail::Box::Dir. .ie n .IP $any\->\fBlistSubFolders\fR(%options) 4 .el .IP \f(CW$any\fR\->\fBlistSubFolders\fR(%options) 4 .IX Item "$any->listSubFolders(%options)" Inherited, see "Sub\-folders" in Mail::Box .ie n .IP "$any\->\fBnameOfSubFolder\fR( $subname, [$parentname] )" 4 .el .IP "\f(CW$any\fR\->\fBnameOfSubFolder\fR( \f(CW$subname\fR, [$parentname] )" 4 .IX Item "$any->nameOfSubFolder( $subname, [$parentname] )" Inherited, see "Sub\-folders" in Mail::Box .ie n .IP $obj\->\fBopenRelatedFolder\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBopenRelatedFolder\fR(%options) 4 .IX Item "$obj->openRelatedFolder(%options)" Inherited, see "Sub\-folders" in Mail::Box .ie n .IP $obj\->\fBopenSubFolder\fR() 4 .el .IP \f(CW$obj\fR\->\fBopenSubFolder\fR() 4 .IX Item "$obj->openSubFolder()" Inherited, see "Sub\-folders" in Mail::Box .ie n .IP $any\->\fBtopFolderWithMessages\fR() 4 .el .IP \f(CW$any\fR\->\fBtopFolderWithMessages\fR() 4 .IX Item "$any->topFolderWithMessages()" Inherited, see "Sub\-folders" in Mail::Box .SS Internals .IX Subsection "Internals" Extends "Internals" in Mail::Box::Dir. .ie n .IP "$obj\->\fBcoerce\fR($message, %options)" 4 .el .IP "\f(CW$obj\fR\->\fBcoerce\fR($message, \f(CW%options\fR)" 4 .IX Item "$obj->coerce($message, %options)" Inherited, see "Internals" in Mail::Box .ie n .IP "$any\->\fBcreate\fR($foldername, %options)" 4 .el .IP "\f(CW$any\fR\->\fBcreate\fR($foldername, \f(CW%options\fR)" 4 .IX Item "$any->create($foldername, %options)" Inherited, see "Internals" in Mail::Box .Sp .Vb 2 \& \-Option \-\-Defined in\-\-Default \& folderdir Mail::Box undef .Ve .RS 4 .ie n .IP "folderdir => $directory" 2 .el .IP "folderdir => \f(CW$directory\fR" 2 .IX Item "folderdir => $directory" .RE .RS 4 .RE .ie n .IP "$obj\->\fBdetermineBodyType\fR($message, $head)" 4 .el .IP "\f(CW$obj\fR\->\fBdetermineBodyType\fR($message, \f(CW$head\fR)" 4 .IX Item "$obj->determineBodyType($message, $head)" Inherited, see "Internals" in Mail::Box .ie n .IP "$obj\->\fBfolderToDirectory\fR($foldername, $folderdir)" 4 .el .IP "\f(CW$obj\fR\->\fBfolderToDirectory\fR($foldername, \f(CW$folderdir\fR)" 4 .IX Item "$obj->folderToDirectory($foldername, $folderdir)" Inherited, see "Internals" in Mail::Box::Dir .ie n .IP "$class\->\fBfoundIn\fR( [$foldername], %options )" 4 .el .IP "\f(CW$class\fR\->\fBfoundIn\fR( [$foldername], \f(CW%options\fR )" 4 .IX Item "$class->foundIn( [$foldername], %options )" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBhighestMessageNumber\fR() 4 .el .IP \f(CW$obj\fR\->\fBhighestMessageNumber\fR() 4 .IX Item "$obj->highestMessageNumber()" Returns the highest number which is used in the folder to store a file. This method may be called when the folder is read (then this number can be derived without file\-system access), but also when the folder is not read (yet). .ie n .IP $obj\->\fBindex\fR() 4 .el .IP \f(CW$obj\fR\->\fBindex\fR() 4 .IX Item "$obj->index()" Create a index reader/writer object. .ie n .IP $obj\->\fBlabels\fR() 4 .el .IP \f(CW$obj\fR\->\fBlabels\fR() 4 .IX Item "$obj->labels()" Create a label reader/writer object. .ie n .IP "$obj\->\fBlineSeparator\fR( [] )" 4 .el .IP "\f(CW$obj\fR\->\fBlineSeparator\fR( [] )" 4 .IX Item "$obj->lineSeparator( [] )" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBlocker\fR() 4 .el .IP \f(CW$obj\fR\->\fBlocker\fR() 4 .IX Item "$obj->locker()" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBmessageInFile\fR($filename) 4 .el .IP \f(CW$obj\fR\->\fBmessageInFile\fR($filename) 4 .IX Item "$obj->messageInFile($filename)" Inherited, see "Internals" in Mail::Box::Dir .ie n .IP $obj\->\fBread\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBread\fR(%options) 4 .IX Item "$obj->read(%options)" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBreadMessageFilenames\fR($directory) 4 .el .IP \f(CW$obj\fR\->\fBreadMessageFilenames\fR($directory) 4 .IX Item "$obj->readMessageFilenames($directory)" Inherited, see "Internals" in Mail::Box::Dir .ie n .IP $obj\->\fBreadMessages\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBreadMessages\fR(%options) 4 .IX Item "$obj->readMessages(%options)" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBstoreMessage\fR($message) 4 .el .IP \f(CW$obj\fR\->\fBstoreMessage\fR($message) 4 .IX Item "$obj->storeMessage($message)" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBtoBeThreaded\fR($messages) 4 .el .IP \f(CW$obj\fR\->\fBtoBeThreaded\fR($messages) 4 .IX Item "$obj->toBeThreaded($messages)" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBtoBeUnthreaded\fR($messages) 4 .el .IP \f(CW$obj\fR\->\fBtoBeUnthreaded\fR($messages) 4 .IX Item "$obj->toBeUnthreaded($messages)" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBupdateMessages\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBupdateMessages\fR(%options) 4 .IX Item "$obj->updateMessages(%options)" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBwrite\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBwrite\fR(%options) 4 .IX Item "$obj->write(%options)" Inherited, see "Internals" in Mail::Box .ie n .IP $obj\->\fBwriteMessages\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBwriteMessages\fR(%options) 4 .IX Item "$obj->writeMessages(%options)" Inherited, see "Internals" in Mail::Box .Sp .Vb 3 \& \-Option \-\-Defined in \-\-Default \& messages Mail::Box \& renumber true .Ve .RS 4 .IP "messages => ARRAY" 2 .IX Item "messages => ARRAY" .PD 0 .IP "renumber => BOOLEAN" 2 .IX Item "renumber => BOOLEAN" .PD Permit renumbering of message. By default this is \f(CW\*(C`true\*(C'\fR, but for some unknown reason, you may be thinking that messages should not be renumbered. .RE .RS 4 .RE .SS "Other methods" .IX Subsection "Other methods" Extends "Other methods" in Mail::Box::Dir. .ie n .IP $any\->\fBtimespan2seconds\fR($time) 4 .el .IP \f(CW$any\fR\->\fBtimespan2seconds\fR($time) 4 .IX Item "$any->timespan2seconds($time)" Inherited, see "Other methods" in Mail::Box .SS "Error handling" .IX Subsection "Error handling" Extends "Error handling" in Mail::Box::Dir. .ie n .IP $obj\->\fBAUTOLOAD\fR() 4 .el .IP \f(CW$obj\fR\->\fBAUTOLOAD\fR() 4 .IX Item "$obj->AUTOLOAD()" Inherited, see "Error handling" in Mail::Reporter .ie n .IP $obj\->\fBnotImplemented\fR() 4 .el .IP \f(CW$obj\fR\->\fBnotImplemented\fR() 4 .IX Item "$obj->notImplemented()" Inherited, see "Error handling" in Mail::Reporter .SS Cleanup .IX Subsection "Cleanup" Extends "Cleanup" in Mail::Box::Dir. .ie n .IP $obj\->\fBDESTROY\fR() 4 .el .IP \f(CW$obj\fR\->\fBDESTROY\fR() 4 .IX Item "$obj->DESTROY()" Inherited, see "Cleanup" in Mail::Box .SH DETAILS .IX Header "DETAILS" Extends "DETAILS" in Mail::Box::Dir. .SS "Different kinds of folders" .IX Subsection "Different kinds of folders" Extends "Different kinds of folders" in Mail::Box::Dir. .SS "Available folder types" .IX Subsection "Available folder types" Extends "Available folder types" in Mail::Box::Dir. .SS "Folder class implementation" .IX Subsection "Folder class implementation" Extends "Folder class implementation" in Mail::Box::Dir. .SS "How MH folders work" .IX Subsection "How MH folders work" MH\-type folders use a directory to store the messages of one folder. Each message is stored in a separate file. This seems useful, because changes in a folder change only a few of these small files, in contrast with file\-based folders where changes in a folder cause rewrites of huge folder files. .PP However, MH\-based folders perform very bad if you need header information of all messages. For instance, if you want to have full knowledge about all message\-threads (see Mail::Box::Thread::Manager) in the folder, it requires to read all header lines in all message files. And usually, reading your messages in threads is desired. .PP So, each message is written in a separate file. The filenames are numbers, which count from \f(CW1\fR. Next to these message files, a directory may contain a file named \f(CW\*(C`.mh_sequences\*(C'\fR, storing labels which relate to the messages. Furthermore, a folder\-directory may contain sub\-directories, which are seen as sub\-folders. .SS "This implementation" .IX Subsection "This implementation" This implementation supports the \f(CW\*(C`.mh\-sequences\*(C'\fR file and sub\-folders. Next to this, considerable effort it made to avoid reading each message\-file. This should boost performance of the MailBox distribution over other Perl\-modules which are able to read folders. .PP Folder types which store their messages each in one file, together in one directory, are bad for performance. Consider that you want to know the subjects of all messages, while browser through a folder with your mail\-reading client. This would cause all message\-files to be read. .PP Mail::Box::MH has two ways to try improve performance. You can use an index\-file, and use on delay\-loading. The combination performs even better. Both are explained in the next sections. .SS "An index\-file" .IX Subsection "An index-file" If you specify new(keep_index), then all header\-lines of all messages from the folder which have been read once, will also be written into one dedicated index\-file (one file per folder). The default filename is \f(CW\*(C`.index\*(C'\fR .PP However, index\-files are not supported by any other reader which supports MH (as far as I know). If you read the folders with such I client, it will not cause unrecoverable conflicts with this index\-file, but at most be bad for performance. .PP If you do not (want to) use an index\-file, then delay\-loading may save your day. .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" .ie n .IP "Error: Folder $name is opened read\-only" 4 .el .IP "Error: Folder \f(CW$name\fR is opened read\-only" 4 .IX Item "Error: Folder $name is opened read-only" You can not write to this folder unless you have opened the folder to write or append with new(access), or the \f(CW\*(C`force\*(C'\fR option is set \f(CW\*(C`true\*(C'\fR. Cast by \f(CWwrite()\fR .ie n .IP "Error: cannot append message without lock on $folder." 4 .el .IP "Error: cannot append message without lock on \f(CW$folder\fR." 4 .IX Item "Error: cannot append message without lock on $folder." It is impossible to append one or more messages to the folder which is not opened, because locking it fails. The folder may be in use by an other application, or you may need to specify some lock related options (see \fBnew()\fR). Cast by \f(CWappendMessages()\fR .ie n .IP "Fault: cannot create MH folder $name: $!" 4 .el .IP "Fault: cannot create MH folder \f(CW$name:\fR $!" 4 .IX Item "Fault: cannot create MH folder $name: $!" For some reason, it is impossible to create the folder. Check the permissions and the \f(CW$name\fR of the folder. Does the path to the directory to be created exist? Cast by \f(CWcreate()\fR .ie n .IP "Fault: cannot create directory $dir for subfolder $name: $!" 4 .el .IP "Fault: cannot create directory \f(CW$dir\fR for subfolder \f(CW$name:\fR $!" 4 .IX Item "Fault: cannot create directory $dir for subfolder $name: $!" Cast by \f(CWopenSubFolder()\fR .ie n .IP "Error: cannot write folder $name without lock." 4 .el .IP "Error: cannot write folder \f(CW$name\fR without lock." 4 .IX Item "Error: cannot write folder $name without lock." It is impossible to get a lock on the folder, which means that the changes can not be made. You may need to tune the lock related options which are available at folder creation. Cast by \f(CWwriteMessages()\fR .ie n .IP "Warning: changes not written to read\-only folder $name." 4 .el .IP "Warning: changes not written to read\-only folder \f(CW$name\fR." 4 .IX Item "Warning: changes not written to read-only folder $name." You have opened the folder read\-only \-\-which is the default set by new(access)\-\-, made modifications, and now want to close it. Set close(force) if you want to overrule the access mode, or close the folder with close(write) set to \f(CW\*(C`NEVER\*(C'\fR. Cast by \f(CWclose()\fR .ie n .IP "Error: class $package does not implement method $method." 4 .el .IP "Error: class \f(CW$package\fR does not implement method \f(CW$method\fR." 4 .IX Item "Error: class $package does not implement method $method." Fatal error: the specific \f(CW$package\fR (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by \f(CWnotImplemented()\fR .IP "Error: copying failed for one message." 4 .IX Item "Error: copying failed for one message." For some reason, for instance disk full, removed by external process, or read\-protection, it is impossible to copy one of the messages. Copying will proceed for the other messages. Cast by \f(CWcopyTo()\fR .ie n .IP "Error: destination folder $name is not writable." 4 .el .IP "Error: destination folder \f(CW$name\fR is not writable." 4 .IX Item "Error: destination folder $name is not writable." The folder where the messages are copied to is not opened with write access (see new(access)). This has no relation with write permission to the folder which is controlled by your operating system. Cast by \f(CWcopyTo()\fR .ie n .IP "Warning: different messages with id $msgid." 4 .el .IP "Warning: different messages with id \f(CW$msgid\fR." 4 .IX Item "Warning: different messages with id $msgid." The message id is discovered more than once within the same folder, but the content of the message seems to be different. This should not be possible: each message must be unique. Cast by \f(CWmessageId()\fR .ie n .IP "Warning: folder $name not deleted: not writable." 4 .el .IP "Warning: folder \f(CW$name\fR not deleted: not writable." 4 .IX Item "Warning: folder $name not deleted: not writable." The folder must be opened with write access via new(access), otherwise removing it will be refused. So, you may have write\-access according to the operating system, but that will not automatically mean that this \&\f(CW\*(C`delete\*(C'\fR method permits you to. The reverse remark is valid as well. Cast by \f(CWdelete()\fR .IP "Error: invalid timespan \*(Aq$span\*(Aq." 4 .IX Item "Error: invalid timespan '$span'." The string does not follow the strict rules of the time span syntax which is permitted as parameter. Cast by \f(CWtimespan2seconds()\fR .IP "Warning: message\-id \*(Aq$msgid\*(Aq does not contain a domain." 4 .IX Item "Warning: message-id '$msgid' does not contain a domain." According to the RFCs, message\-ids need to contain a unique random part, then an \f(CW\*(C`@\*(C'\fR, and then a domain name. This is made to avoid the creation of two messages with the same id. The warning emerges when the \f(CW\*(C`@\*(C'\fR is missing from the string. Cast by \f(CWmessageId()\fR .ie n .IP "Error: unknown value to folder\->close(write => $when)." 4 .el .IP "Error: unknown value to folder\->close(write => \f(CW$when\fR)." 4 .IX Item "Error: unknown value to folder->close(write => $when)." Cast by \f(CWclose()\fR .IP "Error: you cannot add a message which is already part of a folder to a new one. Please use moveTo or copyTo." 4 .IX Item "Error: you cannot add a message which is already part of a folder to a new one. Please use moveTo or copyTo." Cast by \f(CWaddMessage()\fR .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail\-Box version 4.02, built on April 10, 2026. Website: \fIhttp://perl.overmeer.net/CPAN/\fR .SH LICENSE .IX Header "LICENSE" For contributors see file ChangeLog. .PP This software is copyright (c) 2001\-2026 by Mark Overmeer. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.