See METHODS in Mail::Reporter
A Mail::Box::Thread::Manager
object is usually created by a
Mail::Box::Manager. One manager can produce more than one of these
objects. One thread manager can combine messages from a set of folders,
which may be partially overlapping with other objects of the same type.
Option | Defined in | Default |
---|---|---|
dummy_type | ||
folder |
| |
folders |
| |
log | Mail::Reporter |
|
thread_body | <false> | |
thread_type | ||
timespan |
| |
trace | Mail::Reporter |
|
window |
|
use Mail::Box::Manager; my $mgr = Mail::Box::Manager->new; my $inbox = $mgr->open(folder => $ENV{MAIL}); my $read = $mgr->open(folder => 'Mail/read'); my $threads = $mgr->threads(folders => [$inbox, $read]); # longer alternative for last line: my $threads = $mgr->threads; $threads->includeFolder($inbox); $threads->includeFolder($read);
Returns the folders as managed by this threader.
Add one or more folders to the list of folders whose messages are organized in the threads maintained by this object. Duplicated inclusions will not cause any problems.
From the folders, the messages which have their header lines parsed (see Mail::Box about lazy extracting) will be immediately scanned. Messages of which the header is known only later will have to report this (see toBeThreaded()).
$threads->includeFolder($inbox, $draft);
Remove one or more folders from the list of folders whose messages are organized in the threads maintained by this object.
$threads->removeFolder($draft);
Returns all messages which start a thread. The list may contain dummy messages and messages which are scheduled for deletion.
To be able to return all threads, thread construction on each message is performed first, which may be slow for some folder-types because is will enforce parsing of message-bodies.
Returns the list of all messages which are known to be the start of a thread. Threads containing messages which where not read from their folder (like often happens MH-folder messages) are not yet known, and hence will not be returned.
The list may contain dummy messages, and messages which are scheduled for deletion. Threads are detected based on explicitly calling inThread() and thread() with a messages from the folder.
Be warned that, each time a message's header is read from the folder, the return of the method can change.
Returns all known() threads, in sorted order. By default, the threads will be sorted on timestamp, But a different COMPARE method can be specified.
Returns the thread where this MESSAGE is the start of. However, there is a possibility that this message is a reply itself.
Usually, all messages which are in reply of this message are dated later than the specified one. All headers of messages later than this one are getting parsed first, for each folder in this threads-object.
my $threads = $mgr->threads(folder => $inbox); my $thread = $threads->thread($inbox->message(3)); print $thread->string;
Based on a message, and facts from previously detected threads, try to build solid knowledge about the thread where this message is in.
Get a replacement message to be used in threads. Be warned that a dummy is not a member of any folder, so the program working with threads must test with Mail::Message::isDummy() before trying things only available to real messages.
Collect the thread-information of one message. The `In-Reply-To' and `Reference' header-fields are processed. If this method is called on a message whose header was not read yet (as usual for MH-folders, for instance) the reading of that header will be triggered here.
Remove the message from the thread-infrastructure. A message is replaced by a dummy.
Include the specified messages in/from the threads managed by this object, if this folder is maintained by this thread-manager.
Remove the specified messages in/from the threads managed by this object, if this folder is maintained by this thread-manager.