.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 turned on, 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Mail::Box::File 3pm" .TH Mail::Box::File 3pm "2014-08-24" "perl v5.20.0" "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::File \- handle file\-based folders .SH "INHERITANCE" .IX Header "INHERITANCE" .Vb 3 \& Mail::Box::File \& is a Mail::Box \& is a Mail::Reporter \& \& Mail::Box::File is extended by \& Mail::Box::Dbx \& Mail::Box::Mbox .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Mail::Box::File\*(C'\fR is the base-class for all file-based folders: folders which bundle multiple messages into one single file. Usually, these messages are separated by a special line which indicates the start of the next one. .PP Extends \*(L"\s-1DESCRIPTION\*(R"\s0 in Mail::Box. .SH "OVERLOADED" .IX Header "OVERLOADED" Extends \*(L"\s-1OVERLOADED\*(R"\s0 in Mail::Box. .ie n .IP "overload: \fB""""\fR" 4 .el .IP "overload: \fB``''\fR" 4 .IX Item "overload: """"" Inherited, see \*(L"\s-1OVERLOADED\*(R"\s0 in Mail::Box .IP "overload: \fB@{}\fR" 4 .IX Item "overload: @{}" Inherited, see \*(L"\s-1OVERLOADED\*(R"\s0 in Mail::Box .IP "overload: \fBcmp\fR" 4 .IX Item "overload: cmp" Inherited, see \*(L"\s-1OVERLOADED\*(R"\s0 in Mail::Box .SH "METHODS" .IX Header "METHODS" Extends \*(L"\s-1METHODS\*(R"\s0 in Mail::Box. .SS "Constructors" .IX Subsection "Constructors" Extends \*(L"Constructors\*(R" in Mail::Box. .IP "Mail::Box::File\->\fBnew\fR(%options)" 4 .IX Item "Mail::Box::File->new(%options)" .Vb 10 \& \-Option \-\-Defined in \-\-Default \& access Mail::Box \*(Aqr\*(Aq \& body_delayed_type Mail::Box Mail::Message::Body::Delayed \& body_type \& coerce_options Mail::Box [] \& create Mail::Box \& extract Mail::Box 10240 \& field_type Mail::Box undef \& fix_headers Mail::Box \& folder Mail::Box $ENV{MAIL} \& folderdir Mail::Box $ENV{HOME}.\*(Aq/Mail\*(Aq \& head_delayed_type Mail::Box Mail::Message::Head::Delayed \& head_type Mail::Box Mail::Message::Head::Complete \& keep_dups Mail::Box \& lock_extension \*(Aq.lock\*(Aq \& 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 \& log Mail::Reporter \*(AqWARNINGS\*(Aq \& manager Mail::Box undef \& message_type Mail::Box Mail::Box::File::Message \& multipart_type Mail::Box Mail::Message::Body::Multipart \& remove_when_empty Mail::Box \& save_on_exit Mail::Box \& trace Mail::Reporter \*(AqWARNINGS\*(Aq \& trusted Mail::Box \& write_policy undef .Ve .RS 4 .IP "access => \s-1MODE\s0" 2 .IX Item "access => MODE" .PD 0 .IP "body_delayed_type => \s-1CLASS\s0" 2 .IX Item "body_delayed_type => CLASS" .IP "body_type => CLASS|CODE" 2 .IX Item "body_type => CLASS|CODE" .PD The default \f(CW\*(C`body_type\*(C'\fR option for \f(CW\*(C`File\*(C'\fR folders, which will cause messages larger than 10kB to be stored in files and smaller files in memory, is implemented like this: .Sp .Vb 6 \& sub determine_body_type($$) \& { my $head = shift; \& my $size = shift || 0; \& \*(AqMail::Message::Body::\*(Aq \& . ($size > 10000 ? \*(AqFile\*(Aq : \*(AqLines\*(Aq); \& } .Ve .IP "coerce_options => \s-1ARRAY\s0" 2 .IX Item "coerce_options => ARRAY" .PD 0 .IP "create => \s-1BOOLEAN\s0" 2 .IX Item "create => BOOLEAN" .IP "extract => \s-1INTEGER\s0 | \s-1CODE\s0 | \s-1METHOD\s0 | '\s-1LAZY\s0'|'\s-1ALWAYS\s0'" 2 .IX Item "extract => INTEGER | CODE | METHOD | 'LAZY'|'ALWAYS'" .IP "field_type => \s-1CLASS\s0" 2 .IX Item "field_type => CLASS" .IP "fix_headers => \s-1BOOLEAN\s0" 2 .IX Item "fix_headers => BOOLEAN" .IP "folder => \s-1FOLDERNAME\s0" 2 .IX Item "folder => FOLDERNAME" .IP "folderdir => \s-1DIRECTORY\s0" 2 .IX Item "folderdir => DIRECTORY" .IP "head_delayed_type => \s-1CLASS\s0" 2 .IX Item "head_delayed_type => CLASS" .IP "head_type => \s-1CLASS\s0" 2 .IX Item "head_type => CLASS" .IP "keep_dups => \s-1BOOLEAN\s0" 2 .IX Item "keep_dups => BOOLEAN" .IP "lock_extension => FILENAME|STRING" 2 .IX Item "lock_extension => FILENAME|STRING" .PD When the dotlock locking mechanism is used, the lock is created with a hardlink to the folder file. For \f(CW\*(C`Mail::Box::File\*(C'\fR type of folders, this file is by default named as the folder-file itself followed by \&\f(CW\*(C`.lock\*(C'\fR. For example: the \f(CW\*(C`Mail/inbox\*(C'\fR folder file will have a hardlink made as \f(CW\*(C`Mail/inbox.lock\*(C'\fR. .Sp You may specify an absolute filename, a relative (to the folder's directory) filename, or an extension (preceded by a dot). So valid examples are: .Sp .Vb 3 \& .lock # appended to the folder\*(Aqs filename \& my_own_lockfile.test # full filename, same dir \& /etc/passwd # somewhere else .Ve .Sp When the program runs with less privileges (as normal user), often the default inbox folder can not be locked with the lockfile name which is produced by default. .IP "lock_file => \s-1FILENAME\s0" 2 .IX Item "lock_file => FILENAME" .PD 0 .IP "lock_timeout => \s-1SECONDS\s0" 2 .IX Item "lock_timeout => SECONDS" .IP "lock_type => CLASS|STRING|ARRAY" 2 .IX Item "lock_type => CLASS|STRING|ARRAY" .IP "lock_wait => \s-1SECONDS\s0" 2 .IX Item "lock_wait => SECONDS" .IP "locker => \s-1OBJECT\s0" 2 .IX Item "locker => OBJECT" .IP "log => \s-1LEVEL\s0" 2 .IX Item "log => LEVEL" .IP "manager => \s-1MANAGER\s0" 2 .IX Item "manager => MANAGER" .IP "message_type => \s-1CLASS\s0" 2 .IX Item "message_type => CLASS" .IP "multipart_type => \s-1CLASS\s0" 2 .IX Item "multipart_type => CLASS" .IP "remove_when_empty => \s-1BOOLEAN\s0" 2 .IX Item "remove_when_empty => BOOLEAN" .IP "save_on_exit => \s-1BOOLEAN\s0" 2 .IX Item "save_on_exit => BOOLEAN" .IP "trace => \s-1LEVEL\s0" 2 .IX Item "trace => LEVEL" .IP "trusted => \s-1BOOLEAN\s0" 2 .IX Item "trusted => BOOLEAN" .IP "write_policy => '\s-1REPLACE\s0'|'\s-1INPLACE\s0'|undef" 2 .IX Item "write_policy => 'REPLACE'|'INPLACE'|undef" .PD Sets the default write policy, as default for a later call to write(policy). With \f(CW\*(C`undef\*(C'\fR, the best policy is autodetected. .RE .RS 4 .RE .SS "The folder" .IX Subsection "The folder" Extends \*(L"The folder\*(R" in Mail::Box. .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 \*(L"The folder\*(R" 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 \*(L"The folder\*(R" in Mail::Box .IP "Mail::Box::File\->\fBappendMessages\fR(%options)" 4 .IX Item "Mail::Box::File->appendMessages(%options)" Appending messages to a file based folder which is not opened is a little risky. In practice, this is often done without locking the folder. So, another application may write to the folder at the same time... :( Hopefully, all goes fast enough that the chance on collition is small. .Sp All \f(CW%options\fR of \fIMail::Box::Mbox::new()\fR can be supplied. .Sp .Vb 6 \& \-Option \-\-Defined in \-\-Default \& folder Mail::Box \& lock_type NONE \& message Mail::Box undef \& messages Mail::Box undef \& share Mail::Box .Ve .RS 4 .IP "folder => \s-1FOLDERNAME\s0" 2 .IX Item "folder => FOLDERNAME" .PD 0 .IP "lock_type => ..." 2 .IX Item "lock_type => ..." .PD See Mail::Box::new(lock_type) for possible values. .IP "message => \s-1MESSAGE\s0" 2 .IX Item "message => MESSAGE" .PD 0 .IP "messages => ARRAY-OF-MESSAGES" 2 .IX Item "messages => ARRAY-OF-MESSAGES" .IP "share => \s-1BOOLEAN\s0" 2 .IX Item "share => BOOLEAN" .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)" .PD Inherited, see \*(L"The folder\*(R" 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 \*(L"The folder\*(R" 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 \*(L"The folder\*(R" in Mail::Box .ie n .IP "$obj\->\fBfilename\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBfilename\fR()" 4 .IX Item "$obj->filename()" Returns the filename for this folder, which may be an absolute or relative path to the file. .Sp example: .Sp .Vb 1 \& print $folder\->filename; .Ve .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 \*(L"The folder\*(R" 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 \*(L"The folder\*(R" in Mail::Box .ie n .IP "$obj\->\fBorganization\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBorganization\fR()" 4 .IX Item "$obj->organization()" Inherited, see \*(L"The folder\*(R" 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 \*(L"The folder\*(R" 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 \*(L"The folder\*(R" 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 \*(L"The folder\*(R" 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 \*(L"The folder\*(R" in Mail::Box .SS "Folder flags" .IX Subsection "Folder flags" Extends \*(L"Folder flags\*(R" in Mail::Box. .ie n .IP "$obj\->\fBaccess\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBaccess\fR()" 4 .IX Item "$obj->access()" Inherited, see \*(L"Folder flags\*(R" 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 \*(L"Folder flags\*(R" in Mail::Box .ie n .IP "$obj\->\fBmodified\fR( [\s-1BOOLEAN\s0] )" 4 .el .IP "\f(CW$obj\fR\->\fBmodified\fR( [\s-1BOOLEAN\s0] )" 4 .IX Item "$obj->modified( [BOOLEAN] )" Inherited, see \*(L"Folder flags\*(R" 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 \*(L"Folder flags\*(R" in Mail::Box .SS "The messages" .IX Subsection "The messages" Extends \*(L"The messages\*(R" in Mail::Box. .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 \*(L"The messages\*(R" 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 \*(L"The messages\*(R" in Mail::Box .ie n .IP "$obj\->\fBfindFirstLabeled\fR( $label, [\s-1BOOLEAN,\s0 [$msgs]] )" 4 .el .IP "\f(CW$obj\fR\->\fBfindFirstLabeled\fR( \f(CW$label\fR, [\s-1BOOLEAN,\s0 [$msgs]] )" 4 .IX Item "$obj->findFirstLabeled( $label, [BOOLEAN, [$msgs]] )" Inherited, see \*(L"The messages\*(R" 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 \*(L"The messages\*(R" 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 \*(L"The messages\*(R" 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 \*(L"The messages\*(R" in Mail::Box .ie n .IP "$obj\->\fBmessages\fR( <'\s-1ALL\s0'|$range|'\s-1ACTIVE\s0'|'\s-1DELETED\s0'|$label| !$label|$filter> )" 4 .el .IP "\f(CW$obj\fR\->\fBmessages\fR( <'\s-1ALL\s0'|$range|'\s-1ACTIVE\s0'|'\s-1DELETED\s0'|$label| !$label|$filter> )" 4 .IX Item "$obj->messages( <'ALL'|$range|'ACTIVE'|'DELETED'|$label| !$label|$filter> )" Inherited, see \*(L"The messages\*(R" 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 \*(L"The messages\*(R" 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 \*(L"The messages\*(R" in Mail::Box .SS "Sub-folders" .IX Subsection "Sub-folders" Extends \*(L"Sub-folders\*(R" in Mail::Box. .ie n .IP "$obj\->\fBlistSubFolders\fR(%options)" 4 .el .IP "\f(CW$obj\fR\->\fBlistSubFolders\fR(%options)" 4 .IX Item "$obj->listSubFolders(%options)" .PD 0 .IP "Mail::Box::File\->\fBlistSubFolders\fR(%options)" 4 .IX Item "Mail::Box::File->listSubFolders(%options)" .PD Inherited, see \*(L"Sub-folders\*(R" in Mail::Box .ie n .IP "$obj\->\fBnameOfSubFolder\fR( $subname, [$parentname] )" 4 .el .IP "\f(CW$obj\fR\->\fBnameOfSubFolder\fR( \f(CW$subname\fR, [$parentname] )" 4 .IX Item "$obj->nameOfSubFolder( $subname, [$parentname] )" .PD 0 .ie n .IP "Mail::Box::File\->\fBnameOfSubFolder\fR( $subname, [$parentname] )" 4 .el .IP "Mail::Box::File\->\fBnameOfSubFolder\fR( \f(CW$subname\fR, [$parentname] )" 4 .IX Item "Mail::Box::File->nameOfSubFolder( $subname, [$parentname] )" .PD Inherited, see \*(L"Sub-folders\*(R" 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 \*(L"Sub-folders\*(R" in Mail::Box .ie n .IP "$obj\->\fBopenSubFolder\fR($subname, %options)" 4 .el .IP "\f(CW$obj\fR\->\fBopenSubFolder\fR($subname, \f(CW%options\fR)" 4 .IX Item "$obj->openSubFolder($subname, %options)" Inherited, see \*(L"Sub-folders\*(R" in Mail::Box .ie n .IP "$obj\->\fBtopFolderWithMessages\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBtopFolderWithMessages\fR()" 4 .IX Item "$obj->topFolderWithMessages()" .PD 0 .IP "Mail::Box::File\->\fBtopFolderWithMessages\fR()" 4 .IX Item "Mail::Box::File->topFolderWithMessages()" .PD Inherited, see \*(L"Sub-folders\*(R" in Mail::Box .SS "Internals" .IX Subsection "Internals" Extends \*(L"Internals\*(R" in Mail::Box. .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 \*(L"Internals\*(R" in Mail::Box .ie n .IP "$obj\->\fBcreate\fR($foldername, %options)" 4 .el .IP "\f(CW$obj\fR\->\fBcreate\fR($foldername, \f(CW%options\fR)" 4 .IX Item "$obj->create($foldername, %options)" .PD 0 .ie n .IP "Mail::Box::File\->\fBcreate\fR($foldername, %options)" 4 .el .IP "Mail::Box::File\->\fBcreate\fR($foldername, \f(CW%options\fR)" 4 .IX Item "Mail::Box::File->create($foldername, %options)" .PD .Vb 2 \& \-Option \-\-Defined in\-\-Default \& folderdir Mail::Box undef .Ve .RS 4 .IP "folderdir => \s-1DIRECTORY\s0" 2 .IX Item "folderdir => DIRECTORY" .RE .RS 4 .RE .PD 0 .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)" .PD Inherited, see \*(L"Internals\*(R" in Mail::Box .ie n .IP "$obj\->\fBfolderToFilename\fR( $foldername, $folderdir, [$subext] )" 4 .el .IP "\f(CW$obj\fR\->\fBfolderToFilename\fR( \f(CW$foldername\fR, \f(CW$folderdir\fR, [$subext] )" 4 .IX Item "$obj->folderToFilename( $foldername, $folderdir, [$subext] )" .PD 0 .ie n .IP "Mail::Box::File\->\fBfolderToFilename\fR( $foldername, $folderdir, [$subext] )" 4 .el .IP "Mail::Box::File\->\fBfolderToFilename\fR( \f(CW$foldername\fR, \f(CW$folderdir\fR, [$subext] )" 4 .IX Item "Mail::Box::File->folderToFilename( $foldername, $folderdir, [$subext] )" .PD Translate a folder name into a filename, using the \&\f(CW$folderdir\fR value to replace a leading \f(CW\*(C`=\*(C'\fR. \f(CW$subext\fR is only used for \s-1MBOX\s0 folders. .ie n .IP "Mail::Box::File\->\fBfoundIn\fR( [$foldername], %options )" 4 .el .IP "Mail::Box::File\->\fBfoundIn\fR( [$foldername], \f(CW%options\fR )" 4 .IX Item "Mail::Box::File->foundIn( [$foldername], %options )" Inherited, see \*(L"Internals\*(R" in Mail::Box .ie n .IP "$obj\->\fBlineSeparator\fR( [] )" 4 .el .IP "\f(CW$obj\fR\->\fBlineSeparator\fR( [] )" 4 .IX Item "$obj->lineSeparator( [] )" Inherited, see \*(L"Internals\*(R" 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 \*(L"Internals\*(R" in Mail::Box .ie n .IP "$obj\->\fBmessageCreateOptions\fR( [$type, $config] )" 4 .el .IP "\f(CW$obj\fR\->\fBmessageCreateOptions\fR( [$type, \f(CW$config\fR] )" 4 .IX Item "$obj->messageCreateOptions( [$type, $config] )" Returns a key-value list of options to be used each time a new message is read from a file. The list is preceded by the \f(CW$type\fR of message which has to be created. .Sp This data is used by \fIreadMessages()\fR and \fIupdateMessages()\fR. With \&\f(CW$type\fR and \f(CW$config\fR, a new configuration is set. .ie n .IP "$obj\->\fBmoveAwaySubFolder\fR($directory, $extension)" 4 .el .IP "\f(CW$obj\fR\->\fBmoveAwaySubFolder\fR($directory, \f(CW$extension\fR)" 4 .IX Item "$obj->moveAwaySubFolder($directory, $extension)" The \f(CW$directory\fR is renamed by appending the \f(CW$extension\fR, which defaults to \f(CW".d"\fR, to make place for a folder file on that specific location. \f(CW\*(C`false\*(C'\fR is returned if this failed. .ie n .IP "$obj\->\fBparser\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBparser\fR()" 4 .IX Item "$obj->parser()" Create a parser for this mailbox. The parser stays alive as long as the folder is open. .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 \*(L"Internals\*(R" in Mail::Box .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 \*(L"Internals\*(R" 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 \*(L"Internals\*(R" 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 \*(L"Internals\*(R" 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 \*(L"Internals\*(R" 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)" For file based folders, the file handle stays open until the folder is closed. Update is therefore rather simple: move to the end of the last known message, and continue reading... .ie n .IP "$obj\->\fBwrite\fR(%options)" 4 .el .IP "\f(CW$obj\fR\->\fBwrite\fR(%options)" 4 .IX Item "$obj->write(%options)" .Vb 4 \& \-Option \-\-Defined in \-\-Default \& force Mail::Box \& policy undef \& save_deleted Mail::Box .Ve .RS 4 .IP "force => \s-1BOOLEAN\s0" 2 .IX Item "force => BOOLEAN" .PD 0 .IP "policy => '\s-1REPLACE\s0'|'\s-1INPLACE\s0'|undef" 2 .IX Item "policy => 'REPLACE'|'INPLACE'|undef" .PD In what way will the mail folder be updated. If not specified during the write, the value of the new(write_policy) at folder creation is taken. .Sp Valid values: .RS 2 .IP "\(bu" 4 \&\f(CW\*(C`REPLACE\*(C'\fR .Sp First a new folder is written in the same directory as the folder which has to be updated, and then a call to move will throw away the old immediately replacing it by the new. .Sp Writing in \f(CW\*(C`REPLACE\*(C'\fR module is slightly optimized: messages which are not modified are copied from file to file, byte by byte. This is much faster than printing the data which is will be done for modified messages. .IP "\(bu" 4 \&\f(CW\*(C`INPLACE\*(C'\fR .Sp The original folder file will be opened read/write. All message which where not changed will be left untouched, until the first deleted or modified message is detected. All further messages are printed again. .IP "\(bu" 4 \&\f(CW\*(C`undef\*(C'\fR .Sp As default, or when \f(CW\*(C`undef\*(C'\fR is explicitly specified, first \f(CW\*(C`REPLACE\*(C'\fR mode is tried. Only when that fails, an \f(CW\*(C`INPLACE\*(C'\fR update is performed. .RE .RS 2 .Sp \&\f(CW\*(C`INPLACE\*(C'\fR will be much faster than \f(CW\*(C`REPLACE\*(C'\fR when applied on large folders, however requires the \f(CW\*(C`truncate\*(C'\fR function to be implemented on your operating system (at least available for recent versions of Linux, Solaris, Tru64, \s-1HPUX\s0). It is also dangerous: when the program is interrupted during the update process, the folder is corrupted. Data may be lost. .Sp However, in some cases it is not possible to write the folder with \&\f(CW\*(C`REPLACE\*(C'\fR. For instance, the usual incoming mail folder on \s-1UNIX\s0 is stored in a directory where a user can not write. Of course, the \&\f(CW\*(C`root\*(C'\fR and \f(CW\*(C`mail\*(C'\fR users can, but if you want to use this Perl module with permission of a normal user, you can only get it to work in \f(CW\*(C`INPLACE\*(C'\fR mode. Be warned that in this case folder locking via a lockfile is not possible as well. .RE .IP "save_deleted => \s-1BOOLEAN\s0" 2 .IX Item "save_deleted => BOOLEAN" .RE .RS 4 .RE .PD 0 .ie n .IP "$obj\->\fBwriteMessages\fR(%options)" 4 .el .IP "\f(CW$obj\fR\->\fBwriteMessages\fR(%options)" 4 .IX Item "$obj->writeMessages(%options)" .PD Inherited, see \*(L"Internals\*(R" in Mail::Box .SS "Other methods" .IX Subsection "Other methods" Extends \*(L"Other methods\*(R" in Mail::Box. .ie n .IP "$obj\->\fBtimespan2seconds\fR($time)" 4 .el .IP "\f(CW$obj\fR\->\fBtimespan2seconds\fR($time)" 4 .IX Item "$obj->timespan2seconds($time)" .PD 0 .IP "Mail::Box::File\->\fBtimespan2seconds\fR($time)" 4 .IX Item "Mail::Box::File->timespan2seconds($time)" .PD Inherited, see \*(L"Other methods\*(R" in Mail::Box .SS "Error handling" .IX Subsection "Error handling" Extends \*(L"Error handling\*(R" in Mail::Box. .ie n .IP "$obj\->\fB\s-1AUTOLOAD\s0\fR()" 4 .el .IP "\f(CW$obj\fR\->\fB\s-1AUTOLOAD\s0\fR()" 4 .IX Item "$obj->AUTOLOAD()" Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBaddReport\fR($object)" 4 .el .IP "\f(CW$obj\fR\->\fBaddReport\fR($object)" 4 .IX Item "$obj->addReport($object)" Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBdefaultTrace\fR( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )" 4 .el .IP "\f(CW$obj\fR\->\fBdefaultTrace\fR( [$level]|[$loglevel, \f(CW$tracelevel\fR]|[$level, \f(CW$callback\fR] )" 4 .IX Item "$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )" .PD 0 .ie n .IP "Mail::Box::File\->\fBdefaultTrace\fR( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )" 4 .el .IP "Mail::Box::File\->\fBdefaultTrace\fR( [$level]|[$loglevel, \f(CW$tracelevel\fR]|[$level, \f(CW$callback\fR] )" 4 .IX Item "Mail::Box::File->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )" .PD Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBerrors\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBerrors\fR()" 4 .IX Item "$obj->errors()" Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBlog\fR( [$level, [$strings]] )" 4 .el .IP "\f(CW$obj\fR\->\fBlog\fR( [$level, [$strings]] )" 4 .IX Item "$obj->log( [$level, [$strings]] )" .PD 0 .IP "Mail::Box::File\->\fBlog\fR( [$level, [$strings]] )" 4 .IX Item "Mail::Box::File->log( [$level, [$strings]] )" .PD Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBlogPriority\fR($level)" 4 .el .IP "\f(CW$obj\fR\->\fBlogPriority\fR($level)" 4 .IX Item "$obj->logPriority($level)" .PD 0 .IP "Mail::Box::File\->\fBlogPriority\fR($level)" 4 .IX Item "Mail::Box::File->logPriority($level)" .PD Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBlogSettings\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBlogSettings\fR()" 4 .IX Item "$obj->logSettings()" Inherited, see \*(L"Error handling\*(R" 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 \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBreport\fR( [$level] )" 4 .el .IP "\f(CW$obj\fR\->\fBreport\fR( [$level] )" 4 .IX Item "$obj->report( [$level] )" Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBreportAll\fR( [$level] )" 4 .el .IP "\f(CW$obj\fR\->\fBreportAll\fR( [$level] )" 4 .IX Item "$obj->reportAll( [$level] )" Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBtrace\fR( [$level] )" 4 .el .IP "\f(CW$obj\fR\->\fBtrace\fR( [$level] )" 4 .IX Item "$obj->trace( [$level] )" Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .ie n .IP "$obj\->\fBwarnings\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBwarnings\fR()" 4 .IX Item "$obj->warnings()" Inherited, see \*(L"Error handling\*(R" in Mail::Reporter .SS "Cleanup" .IX Subsection "Cleanup" Extends \*(L"Cleanup\*(R" in Mail::Box. .ie n .IP "$obj\->\fB\s-1DESTROY\s0\fR()" 4 .el .IP "\f(CW$obj\fR\->\fB\s-1DESTROY\s0\fR()" 4 .IX Item "$obj->DESTROY()" Inherited, see \*(L"Cleanup\*(R" in Mail::Box .SS "\s-1DETAILS\s0" .IX Subsection "DETAILS" \fIFile based folders\fR .IX Subsection "File based folders" .PP File based folders maintain a folder (a set of messages) in one single file. The advantage is that your folder has only one single name, which speeds-up access to all messages at once. .PP The disadvantage over directory based folder (see Mail::Box::Dir) is that you have to construct some means to keep all message apart, for instance by adding a message separator, and this will cause problems. Where access to all messages at once is faster in file based folders, access to a single message is (much) slower, because the whole folder must be read. .SH "DETAILS" .IX Header "DETAILS" Extends \*(L"\s-1DETAILS\*(R"\s0 in Mail::Box. .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .ie n .IP "Error: Cannot append messages to folder file $filename: $!" 4 .el .IP "Error: Cannot append messages to folder file \f(CW$filename:\fR $!" 4 .IX Item "Error: Cannot append messages to folder file $filename: $!" Appending messages to a not-opened file-organized folder may fail when the operating system does not allow write access to the file at hand. .ie n .IP "Error: Cannot create directory $dir for folder $name." 4 .el .IP "Error: Cannot create directory \f(CW$dir\fR for folder \f(CW$name\fR." 4 .IX Item "Error: Cannot create directory $dir for folder $name." While creating a file-organized folder, at most one level of directories is created above it. Apparently, more levels of directories are needed, or the operating system does not allow you to create the directory. .ie n .IP "Error: Cannot create folder file $name: $!" 4 .el .IP "Error: Cannot create folder file \f(CW$name:\fR $!" 4 .IX Item "Error: Cannot create folder file $name: $!" The file-organized folder file cannot be created for the indicated reason. In common cases, the operating system does not grant you write access to the directory where the folder file should be stored. .ie n .IP "Error: Cannot get a lock on $type folder $self." 4 .el .IP "Error: Cannot get a lock on \f(CW$type\fR folder \f(CW$self\fR." 4 .IX Item "Error: Cannot get a lock on $type folder $self." A lock is required to get access to the folder. If no locking is needed, specify the \s-1NONE\s0 lock type. .ie n .IP "Error: Cannot move away sub-folder $dir" 4 .el .IP "Error: Cannot move away sub-folder \f(CW$dir\fR" 4 .IX Item "Error: Cannot move away sub-folder $dir" .PD 0 .ie n .IP "Warning: Cannot remove folder $name file $filename: $!" 4 .el .IP "Warning: Cannot remove folder \f(CW$name\fR file \f(CW$filename:\fR $!" 4 .IX Item "Warning: Cannot remove folder $name file $filename: $!" .PD Writing an empty folder will usually cause that folder to be removed, which fails for the indicated reason. new(remove_when_empty) .ie n .IP "Warning: Cannot remove folder $name file $filename: $!" 4 .el .IP "Warning: Cannot remove folder \f(CW$name\fR file \f(CW$filename:\fR $!" 4 .IX Item "Warning: Cannot remove folder $name file $filename: $!" Writing an empty folder will usually cause that folder to be removed, which fails for the indicated reason. new(remove_when_empty) controls whether the empty folder will removed; setting it to false (\f(CW0\fR) may be needed to avoid this message. .ie n .IP "Error: Cannot replace $filename by $tempname, to update folder $name: $!" 4 .el .IP "Error: Cannot replace \f(CW$filename\fR by \f(CW$tempname\fR, to update folder \f(CW$name:\fR $!" 4 .IX Item "Error: Cannot replace $filename by $tempname, to update folder $name: $!" The replace policy wrote a new folder file to update the existing, but was unable to give the final touch: replacing the old version of the folder file for the indicated reason. .ie n .IP "Warning: Changes not written to read-only folder $self." 4 .el .IP "Warning: Changes not written to read-only folder \f(CW$self\fR." 4 .IX Item "Warning: Changes not written to read-only folder $self." 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. .IP "Error: Copying failed for one message." 4 .IX Item "Error: Copying failed for one message." For some reason, for instance disc full, removed by external process, or read-protection, it is impossible to copy one of the messages. Copying will proceed for the other messages. .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 controled by your operating system. .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. .ie n .IP "Error: File too short to get write message $nr ($size, $need)" 4 .el .IP "Error: File too short to get write message \f(CW$nr\fR ($size, \f(CW$need\fR)" 4 .IX Item "Error: File too short to get write message $nr ($size, $need)" Mail::Box is lazy: it tries to leave messages in the folders until they are used, which saves time and memory usage. When this message appears, something is terribly wrong: some lazy message are needed for updating the folder, but they cannot be retrieved from the original file anymore. In this case, messages can be lost. .Sp This message does appear regularly on Windows systems when using the \&'replace' write policy. Please help to find the cause, probably something to do with Windows incorrectly handling multiple filehandles open in the same file. .ie n .IP "Warning: Folder $name file $filename is write-protected." 4 .el .IP "Warning: Folder \f(CW$name\fR file \f(CW$filename\fR is write-protected." 4 .IX Item "Warning: Folder $name file $filename is write-protected." The folder is opened writable or for appending via new(access), but the operating system does not permit writing to the file. The folder will be opened read-only. .ie n .IP "Error: Folder $name not deleted: not writable." 4 .el .IP "Error: Folder \f(CW$name\fR not deleted: not writable." 4 .IX Item "Error: 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. .IP "Error: Invalid timespan '$timespan' specified." 4 .IX Item "Error: Invalid timespan '$timespan' specified." The string does not follow the strict rules of the time span syntax which is permitted as parameter. .IP "Warning: Message-id '$msgid' 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. .ie n .IP "Error: Package $package does not implement $method." 4 .el .IP "Error: Package \f(CW$package\fR does not implement \f(CW$method\fR." 4 .IX Item "Error: Package $package does not implement $method." Fatal error: the specific package (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. .ie n .IP "Error: Unable to create subfolder $name of $folder." 4 .el .IP "Error: Unable to create subfolder \f(CW$name\fR of \f(CW$folder\fR." 4 .IX Item "Error: Unable to create subfolder $name of $folder." The copy includes the subfolders, but for some reason it was not possible to copy one of these. Copying will proceed for all other sub-folders. .ie n .IP "Error: Unable to update folder $self." 4 .el .IP "Error: Unable to update folder \f(CW$self\fR." 4 .IX Item "Error: Unable to update folder $self." When a folder is to be written, both replace and inplace write policies are tried, If both fail, the whole update fails. You may see other, related, error messages to indicate the real problem. .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail-Box distribution version 2.117, built on August 24, 2014. Website: \fIhttp://perl.overmeer.net/mailbox/\fR .SH "LICENSE" .IX Header "LICENSE" Copyrights 2001\-2014 by [Mark Overmeer]. For other contributors see ChangeLog. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \fIhttp://www.perl.com/perl/misc/Artistic.html\fR