=encoding utf8 =head1 NAME Mail::Box::Search - select messages within a mail box =head1 INHERITANCE Mail::Box::Search is a Mail::Reporter Mail::Box::Search is extended by Mail::Box::Search::Grep Mail::Box::Search::SpamAssassin Mail::Server::IMAP4::Search =head1 SYNOPSIS use Mail::Box::Manager; my $mgr = Mail::Box::Manager->new; my $folder = $mgr->open('Inbox'); my $filter = Mail::Box::Search::[something]->new; my @msgs = $filter->search($folder, ...); if($filter->search($message)) {...} =head1 DESCRIPTION This C class is the base class for various message scan algorithms. The selected messages can be labeled. Boolean operations on messages are supported. Currently implemented searches: =over 4 =item L Match header or body against a regular expression in a UNIX C like fashion. =item L Try to detect spam, using Mail::SpamAssassin. =item Mail::Box::Search::IMAP Search an IMAP folder for special interface IMAP folders provide for it. UNDER CONSTRUCTION till L is complete. =back Extends L<"DESCRIPTION" in Mail::Reporter|Mail::Reporter/"DESCRIPTION">. =head1 METHODS Extends L<"METHODS" in Mail::Reporter|Mail::Reporter/"METHODS">. =head2 Constructors Extends L<"Constructors" in Mail::Reporter|Mail::Reporter/"Constructors">. =over 4 =item Mail::Box::Search-EB(%options) Create a filter. -Option --Defined in --Default binaries decode delayed deleted deliver undef in 'BODY' label undef limit 0 log Mail::Reporter 'WARNINGS' logical 'REPLACE' multiparts trace Mail::Reporter 'WARNINGS' =over 2 =item binaries => BOOLEAN Whether to include binary bodies in the search. =item decode => BOOLEAN Decode the messages before the search takes place. Even plain text messages can be encoded, for instance as C, which may disturb the results. However, decoding will slow-down the search. =item delayed => BOOLEAN Include the delayed messages (which will be parsed) in the search. If you set this to false, you may find fewer hits. =item deleted => BOOLEAN In most cases, you will not be interested in results which are found in messages flagged to be deleted. However, with this option you can specify you want them to be searched too. =item deliver => undef|CODE|'DELETE' The exact functionality of this parameter differs per search method, so read the applicable man-page. In any case C means that details are not collected for this search, which is the fastest search. C will flag the message to be flagged for deletion. You may also specify your own CODE reference. With an reference to an array, the information about the matches is collected as a list of hashes, one hash per match. =item in => 'HEAD'|'BODY'|'MESSAGE' Where to look for the match. =item label => STRING Mark all selected messages with the specified STRING. If this field is not specified, the message will not get a label; search() also returns a list of selected messages. =item limit => NUMBER Limit the search to the specified NUMBER of messages. When the NUMBER is positive, the search starts at the first message in the folder or thread. A negative NUMBER starts at the end of the folder. If the limit is set to zero, there is no limit. =item log => LEVEL =item logical => 'REPLACE'|'AND'|'OR'|'NOT'|'AND NOT'|'OR NOT' Only applicable in combination with a C