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
48       Extends "DESCRIPTION" in Mail::Box::Search.
49

METHODS

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

DIAGNOSTICS

193       Error: Package $package does not implement $method.
194           Fatal error: the specific package (or one of its superclasses) does
195           not implement this method where it should. This message means that
196           some other related classes do implement this method however the
197           class at hand does not.  Probably you should investigate this and
198           probably inform the author of the package.
199

SEE ALSO

201       This module is part of Mail-Box distribution version 3.009, built on
202       August 18, 2020. Website: http://perl.overmeer.net/CPAN/
203

LICENSE

205       Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see
206       ChangeLog.
207
208       This program is free software; you can redistribute it and/or modify it
209       under the same terms as Perl itself.  See http://dev.perl.org/licenses/
210
211
212
213perl v5.36.0                      2022-07-22Mail::Box::Search::SpamAssassin(3)
Impressum