1Mail::Box::Search::SpamUAssesrasCsoinnt(r3i)buted Perl DMoaciulm:e:nBtoaxt:i:oSnearch::SpamAssassin(3)
2
3
4

NAME

6       Mail::Box::Search::SpamAssassin - select spam messages with
7       Mail::SpamAssassin
8

INHERITANCE

10        Mail::Box::Search::SpamAssassin
11          is a Mail::Box::Search
12          is a Mail::Reporter
13

SYNOPSIS

15        use Mail::Box::Manager;
16        my $mgr    = Mail::Box::Manager->new;
17        my $folder = $mgr->open('Inbox');
18
19        my $spam = Mail::Box::Search::SpamAssassin->new;
20        if($spam->search($message)) {...}
21
22        my @msgs   = $filter->search($folder);
23        foreach my $msg ($folder->messages)
24        {   $msg->delete if $msg->label('spam');
25        }
26
27        my $spam2 = Mail::Box::Search::SpamAssassin
28                      ->new(deliver => 'DELETE');
29        $spam2->search($folder);
30        $mgr->moveMessages($spamfolder, $folder->messages('spam'));
31

DESCRIPTION

33       Spam means "unsollicited e-mail", and is as name derived from a Monty
34       Python scatch.  Although Monty Python is fun, spam is a pain: it
35       needlessly spoils minutes of time from most people: telephone bills,
36       overful mailboxes which block honest e-mail, and accidentally removal
37       of honest e-mail which looks like spam.  Spam is the pest of Internet.
38
39       Happily, Mail::Box can be used as spam filter, in combination with the
40       useful Mail::SpamAssassin module (which must be installed separately).
41       Each message which is searched is wrapped in a
42       Mail::Message::Wrapper::SpamAssassin object.
43
44       The spam-assassin module version 2 is not really well adapted for
45       Mail::Message objects, which will make this search even slower than
46       spam-detection already is.
47

METHODS

49   Constructors
50       Mail::Box::Search::SpamAssassin->new(OPTIONS)
51           Create a spam filter.  Internally, a Mail::SpamAssassin object is
52           maintained.
53
54           Only the whole message can be searched; this is a limitation of the
55           Mail::SpamAssassin module.
56
57            -Option       --Defined in     --Default
58             binaries       Mail::Box::Search  <false>
59             decode         Mail::Box::Search  <true>
60             delayed        Mail::Box::Search  <true>
61             deleted        Mail::Box::Search  <false>
62             deliver        Mail::Box::Search  undef
63             in             Mail::Box::Search  'MESSAGE'
64             label                           c<'spam'>
65             limit          Mail::Box::Search  0
66             log            Mail::Reporter   'WARNINGS'
67             logical        Mail::Box::Search  'REPLACE'
68             multiparts     Mail::Box::Search  <true>
69             rewrite_mail                    <true>
70             sa_options                      { }
71             spam_assassin                   undef
72             trace          Mail::Reporter   'WARNINGS'
73
74           binaries => BOOLEAN
75           decode => BOOLEAN
76           delayed => BOOLEAN
77           deleted => BOOLEAN
78           deliver => undef|CODE|'DELETE'
79           in => 'HEAD'|'BODY'|'MESSAGE'
80           label => STRING|undef
81             Mark all selected message with the specified STRING.  If this
82             option is explicitly set to "undef", the label will not be set.
83
84           limit => NUMBER
85           log => LEVEL
86           logical => 'REPLACE'|'AND'|'OR'|'NOT'|'AND NOT'|'OR NOT'
87           multiparts => BOOLEAN
88           rewrite_mail => BOOLEAN
89             Add lines to the message header describing the results of the
90             spam scan. See Mail::SpamAssassin::PerMsgStatus subroutine
91             rewrite_mail.
92
93           sa_options => HASH
94             Options to create the internal Mail::SpamAssassin object; see its
95             manual page for the available options.  Other setting may be
96             provided via SpamAssassins configuration file mechanism, which is
97             explained in Mail::SpamAssassin::Conf.
98
99           spam_assassin => OBJECT
100             Provide a Mail::SpamAssassin object to be used for searching
101             spam.  If none is specified, one is created internally.  The
102             object can be retreived with assassinator().
103
104           trace => LEVEL
105
106           example:
107
108            my $filter = Mail::Box::Search::SpamAssassin
109                          ->new( found => 'DELETE' );
110
111   Searching
112       $obj->assassinator
113           Returns the internally maintained assassinator object.  You may
114           want to reach this object for complex configuration.
115
116       $obj->inBody(PART, BODY)
117           See "Searching" in Mail::Box::Search
118
119       $obj->inHead(PART, HEAD)
120           See "Searching" in Mail::Box::Search
121
122       $obj->search(FOLDER|THREAD|MESSAGE|ARRAY-OF-MESSAGES)
123           See "Searching" in Mail::Box::Search
124
125       $obj->searchPart(PART)
126           See "Searching" in Mail::Box::Search
127
128   The Results
129       $obj->printMatch([FILEHANDLE], HASH)
130           See "The Results" in Mail::Box::Search
131
132   Error handling
133       $obj->AUTOLOAD
134           See "Error handling" in Mail::Reporter
135
136       $obj->addReport(OBJECT)
137           See "Error handling" in Mail::Reporter
138
139       $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
140           Mail::Box::Search::SpamAssassin->defaultTrace([LEVEL]|[LOGLEVEL,
141           TRACELEVEL]|[LEVEL, CALLBACK])
142
143           See "Error handling" in Mail::Reporter
144
145       $obj->errors
146           See "Error handling" in Mail::Reporter
147
148       $obj->log([LEVEL [,STRINGS]])
149           Mail::Box::Search::SpamAssassin->log([LEVEL [,STRINGS]])
150
151           See "Error handling" in Mail::Reporter
152
153       $obj->logPriority(LEVEL)
154           Mail::Box::Search::SpamAssassin->logPriority(LEVEL)
155
156           See "Error handling" in Mail::Reporter
157
158       $obj->logSettings
159           See "Error handling" in Mail::Reporter
160
161       $obj->notImplemented
162           See "Error handling" in Mail::Reporter
163
164       $obj->report([LEVEL])
165           See "Error handling" in Mail::Reporter
166
167       $obj->reportAll([LEVEL])
168           See "Error handling" in Mail::Reporter
169
170       $obj->trace([LEVEL])
171           See "Error handling" in Mail::Reporter
172
173       $obj->warnings
174           See "Error handling" in Mail::Reporter
175
176   Cleanup
177       $obj->DESTROY
178           See "Cleanup" in Mail::Reporter
179
180       $obj->inGlobalDestruction
181           See "Cleanup" in Mail::Reporter
182

DIAGNOSTICS

184       Error: Package $package does not implement $method.
185           Fatal error: the specific package (or one of its superclasses) does
186           not implement this method where it should. This message means that
187           some other related classes do implement this method however the
188           class at hand does not.  Probably you should investigate this and
189           probably inform the author of the package.
190

SEE ALSO

192       This module is part of Mail-Box distribution version 2.097, built on
193       January 26, 2011. Website: http://perl.overmeer.net/mailbox/
194

LICENSE

196       Copyrights 2001-2011 by Mark Overmeer. For other contributors see
197       ChangeLog.
198
199       This program is free software; you can redistribute it and/or modify it
200       under the same terms as Perl itself.  See
201       http://www.perl.com/perl/misc/Artistic.html
202
203
204
205perl v5.12.3                      2011-01-26Mail::Box::Search::SpamAssassin(3)
Impressum