Mail::Box::Mbox - handle folders in Mbox format
Mail::Box::Mbox is a Mail::Box::File is a Mail::Box is a Mail::Reporter
use Mail::Box::Mbox; my $folder = Mail::Box::Mbox->new(folder => $ENV{MAIL}, ...);
This documentation describes how Mbox mailboxes work, and also describes what you can do with the Mbox folder object Mail::Box::Mbox.
(Class method)
OPTION DEFAULT access 'r' body_delayed_type 'Mail::Message::Body::Delayed' body_type <see description> coerce_options [] create <false> extract 10240 field_type undef fix_headers <false> folder $ENV{MAIL} folderdir $ENV{HOME}.'/Mail' head_delayed_type 'Mail::Message::Head::Delayed' head_type 'Mail::Message::Head::Complete' keep_dups <false> lock_extension '.lock' lock_file <foldername>.<lock-extension> lock_timeout 1 hour lock_type 'Mail::Box::Locker::DotLock' lock_wait 10 seconds locker undef log 'WARNINGS' manager undef message_type 'Mail::Box::Mbox::Message' multipart_type 'Mail::Message::Body::Multipart' remove_when_empty <true> save_on_exit <true> subfolder_extension '.d' trace 'WARNINGS' trusted <depends on folder location> write_policy undef
See Mail::Box::new(access)
See Mail::Box::new(body_delayed_type)
See Mail::Box::File::new(body_type)
See Mail::Box::new(coerce_options)
See Mail::Box::new(create)
See Mail::Box::new(extract)
See Mail::Box::new(field_type)
See Mail::Box::new(fix_headers)
See Mail::Box::new(folder)
See Mail::Box::new(folderdir)
See Mail::Box::new(head_delayed_type)
See Mail::Box::new(head_type)
See Mail::Box::new(keep_dups)
See Mail::Box::File::new(lock_extension)
See Mail::Box::new(lock_file)
See Mail::Box::new(lock_timeout)
See Mail::Box::new(lock_type)
See Mail::Box::new(lock_wait)
See Mail::Box::new(locker)
See Mail::Reporter::new(log)
See Mail::Box::new(manager)
See Mail::Box::new(message_type)
See Mail::Box::new(multipart_type)
See Mail::Box::new(remove_when_empty)
See Mail::Box::new(save_on_exit)
Mbox folders do not support sub-folders. However, this module can simulate sub-directories if the user wants it to. When a subfolder of folder xyz is created, we create a directory which is called xyz.d to contain them. This extension .d can be changed using this option.
xyz
xyz.d
.d
See Mail::Reporter::new(trace)
See Mail::Box::new(trusted)
See Mail::Box::File::new(write_policy)
See Mail::Box::clone()
OPTION DEFAULT folderdir undef subfolder_extension undef
See Mail::Box::create(folderdir)
If a directory is found on the location of the folder to be created, this STRING is used to extend that directory name with. This will cause the directory to be seen as sub-folder for the created folder. This argument is passed to dirToSubfolder().
See Mail::Box::folderdir()
If no FOLDERNAME is specified, then the folder option is taken.
folder
OPTION DEFAULT folder undef folderdir undef subfolder_extension <from object>
See Mail::Box::foundIn(folderdir)
See Mail::Box::addMessage()
See Mail::Box::addMessages()
See Mail::Box::copyTo()
See Mail::Box::File::filename()
See Mail::Box::isModified()
See Mail::Box::modified()
See Mail::Box::name()
See Mail::Box::organization()
See Mail::Box::type()
See Mail::Box::update()
See Mail::Box::url()
See Mail::Box::writable()
See Mail::Box::DESTROY()
See Mail::Box::close()
See Mail::Box::delete()
See Mail::Box::current()
See Mail::Box::find()
See Mail::Box::message()
See Mail::Box::messageId()
See Mail::Box::messageIds()
See Mail::Box::messages()
See Mail::Box::scanForMessages()
OPTION DEFAULT check <false> folder <obligatory> folderdir <from folder> skip_empty <false> subfolder_extension <from object>
See Mail::Box::listSubFolders(check)
See Mail::Box::listSubFolders(folder)
See Mail::Box::listSubFolders(folderdir)
See Mail::Box::listSubFolders(skip_empty)
When the method is called on an open folder, the extension defined by it is used to detect sub-folders by default. Otherwise, '.d' is taken.
'.d'
See Mail::Box::nameOfSubfolder()
See Mail::Box::openRelatedFolder()
See Mail::Box::openSubFolder()
See Mail::Box::toBeThreaded()
See Mail::Box::toBeUnthreaded()
See Mail::Box::File::appendMessages()
See Mail::Box::coerce()
See Mail::Box::determineBodyType()
The DIRECTORY is renamed by appending the EXTENSION, which defaults to ".d", to make place for a folder file on that specific location. false is returned if this failed.
".d"
false
(Class or Instance method) Translate a folder name into a filename, using the FOLDERDIR value to replace a leading =. If no EXTENSION is specified and this method is called as instance method, new(subfolder_extension) is used. Otherwise, the extension default to '.d'.
=
See Mail::Box::lineSeparator()
See Mail::Box::locker()
See Mail::Box::File::parser()
See Mail::Box::read()
See Mail::Box::readMessages()
See Mail::Box::storeMessage()
See Mail::Box::updateMessages()
See Mail::Box::File::write()
See Mail::Box::writeMessages()
See Mail::Reporter::defaultTrace()
See Mail::Reporter::errors()
See Mail::Reporter::log()
See Mail::Reporter::report()
See Mail::Reporter::reportAll()
See Mail::Reporter::trace()
See Mail::Reporter::warnings()
See Mail::Reporter::AUTOLOAD()
See Mail::Reporter::inGlobalDestruction()
See Mail::Reporter::logPriority()
See Mail::Reporter::logSettings()
See Mail::Reporter::notImplemented()
See Mail::Box::timespan2seconds()
MBOX folders store many messages in one file. Each message begins with a line which starts with the string From . Lines inside a message which accidentally start with From are, in the file, preceded by `>'. This character is stripped when the message is read.
From
In this respect must be noted that the format of the MBOX files is not strictly defined. The exact content of the separator lines differ between Mail User Agents (MUA's). Besides, some MUAs (like mutt) forget to encode the From lines within message bodies, breaking other parsers....
MBOX folders do not have a sub-folder concept as directory based folders do, but this MBOX module tries to simulate them. In this implementation a directory like
Mail/subject1/
is taken as an empty folder Mail/subject1, with the folders in that directory as sub-folders for it. You may also use
Mail/subject1
Mail/subject1 Mail/subject1.d/
where Mail/subject1 is the folder, and the folders in the Mail/subject1.d directory are used as sub-folders. If your situation is similar to the first example and you want to put messages in that empty folder, the directory is automatically (and transparently) renamed, so that the second situation is reached.
Mail/subject1.d
A good start to read is Mail::Box-Overview. More documentation and a mailinglist are available from the project's website at http://perl.overmeer.net/mailbox/.
Written by Mark Overmeer (mark@overmeer.net) with the help of many. See the ChangeLog for details.
This code is beta, version 2.038.
Copyright (c) 2001-2003 by the authors. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mail::Box, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Box
CPAN shell
perl -MCPAN -e shell install Mail::Box
For more information on module installation, please visit the detailed CPAN module installation guide.