SYNOPSIS

 use Mail::Box::Manager;
 my $mgr     = new Mail::Box::Manager;

 # Create folder objects.
 my $folder   = $mgr->open(folder => $ENV{MAIL});
 my $message1 = $folder->message(0);
 $mgr->copyMessage('Draft', $message);

 my @messages = $folder->message(0,3);
 $mgr->moveMessage('Outbox', @messages, create => 1 );
 $mgr->close($folder);

 # Create thread-detectors (see Mail::Box::Thread::Manager)
 my $t       = $mgr->threads($inbox, $outbox);

 my $threads = $mgr->threads(folder => $folder);
 foreach my $thread ($threads->all)
 {   $thread->print;
 }

 $mgr->registerType(mbox => 'Mail::Box::MyType');

See SYNOPSIS in Mail::Reporter

DESCRIPTION

The manager keeps track on a set of open folders and a set of message-thread supporting objects. You are not obliged to use this object (you can directly create a Mail::Box::Mbox if you prefer), but you will create more portable and safer code if you do use it.

See DESCRIPTION in Mail::Reporter

DETAILS

On many places in the documentation you can read that it is useful to have a manager object. There are two of them: the Mail::Box::Manager, which maintains a set of open folders, and an extension of it: the Mail::Box::Manage::User.

Managing open folders

It is useful to start your program by creating a folder manager object, an Mail::Box::Manager. The object takes a few burdons from your neck:

The manager is really simplifying things, and should therefore be the base of all programs. However, it is possible to write useful programs without it.

Managing a user

One step further is the Mail::Box::Manage::User object (since MailBox v2.057), which not only keeps track on open folders, but also collects information about not-open folders.

The user class is, as the name says, targeted on managing one single user. Where the Mail::Box::Manager will open any set of folder files, probably from multiple users, the user class want one root folder directory.

In many aspects, the user manager simplifies the task for user-based servers and other user-centric applications by setting smart defaults.