1Mail::Box::Search::SpamUAssesrasCsoinnt(r3i)buted Perl DMoaciulm:e:nBtoaxt:i:oSnearch::SpamAssassin(3)
2
3
4
6 Mail::Box::Search::SpamAssassin - select spam messages with Mail::Spa‐
7 mAssassin
8
10 Mail::Box::Search::SpamAssassin
11 is a Mail::Box::Search
12 is a Mail::Reporter
13
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
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 need‐
35 lessly spoils minutes of time from most people: telephone bills, over‐
36 ful mailboxes which block honest e-mail, and accidentally removal of
37 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 Mail::Message::Wrap‐
42 per::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
49 Constructors
50
51 Mail::Box::Search::SpamAssassin->new(OPTIONS)
52
53 Create a spam filter. Internally, a Mail::SpamAssassin object is
54 maintained.
55
56 Only the whole message can be searched; this is a limitation of the
57 Mail::SpamAssassin module.
58
59 Option --Defined in --Default
60 binaries Mail::Box::Search <false>
61 decode Mail::Box::Search <true>
62 delayed Mail::Box::Search <true>
63 deleted Mail::Box::Search <false>
64 deliver Mail::Box::Search undef
65 in Mail::Box::Search 'MESSAGE'
66 label c<'spam'>
67 limit Mail::Box::Search 0
68 log Mail::Reporter 'WARNINGS'
69 logical Mail::Box::Search 'REPLACE'
70 multiparts Mail::Box::Search <true>
71 rewrite_mail <true>
72 sa_options { }
73 spam_assassin undef
74 trace Mail::Reporter 'WARNINGS'
75
76 . binaries BOOLEAN
77
78 . decode BOOLEAN
79
80 . delayed BOOLEAN
81
82 . deleted BOOLEAN
83
84 . deliver undef⎪CODE⎪'DELETE'
85
86 . in 'HEAD'⎪'BODY'⎪'MESSAGE'
87
88 . label STRING⎪undef
89
90 Mark all selected message with the specified STRING. If this
91 option is explicitly set to "undef", the label will not be set.
92
93 . limit NUMBER
94
95 . log LEVEL
96
97 . logical 'REPLACE'⎪'AND'⎪'OR'⎪'NOT'⎪'AND NOT'⎪'OR NOT'
98
99 . multiparts BOOLEAN
100
101 . rewrite_mail BOOLEAN
102
103 Add lines to the message header describing the results of the
104 spam scan. See Mail::SpamAssassin::PerMsgStatus subroutine re‐
105 write_mail.
106
107 . sa_options HASH
108
109 Options to create the internal Mail::SpamAssassin object; see
110 its manual page for the available options. Other setting may
111 be provided via SpamAssassins configuration file mechanism,
112 which is explained in Mail::SpamAssassin::Conf.
113
114 . spam_assassin OBJECT
115
116 Provide a Mail::SpamAssassin object to be used for searching
117 spam. If none is specified, one is created internally. The
118 object can be retreived with assassinator().
119
120 . trace LEVEL
121
122 Example:
123
124 my $filter = Mail::Box::Search::SpamAssassin
125 ->new( found => 'DELETE' );
126
127 Searching
128
129 $obj->assassinator
130
131 Returns the internally maintained assassinator object. You may
132 want to reach this object for complex configuration.
133
134 $obj->inBody(PART, BODY)
135
136 See "Searching" in Mail::Box::Search
137
138 $obj->inHead(PART, HEAD)
139
140 See "Searching" in Mail::Box::Search
141
142 $obj->search(FOLDER⎪THREAD⎪MESSAGE⎪ARRAY-OF-MESSAGES)
143
144 See "Searching" in Mail::Box::Search
145
146 $obj->searchPart(PART)
147
148 See "Searching" in Mail::Box::Search
149
150 The Results
151
152 $obj->printMatch([FILEHANDLE], HASH)
153
154 See "The Results" in Mail::Box::Search
155
156 Error handling
157
158 $obj->AUTOLOAD
159
160 See "Error handling" in Mail::Reporter
161
162 $obj->addReport(OBJECT)
163
164 See "Error handling" in Mail::Reporter
165
166 $obj->defaultTrace([LEVEL]⎪[LOGLEVEL, TRACELEVEL]⎪[LEVEL, CALLBACK])
167
168 Mail::Box::Search::SpamAssassin->defaultTrace([LEVEL]⎪[LOGLEVEL,
169 TRACELEVEL]⎪[LEVEL, CALLBACK])
170
171 See "Error handling" in Mail::Reporter
172
173 $obj->errors
174
175 See "Error handling" in Mail::Reporter
176
177 $obj->log([LEVEL [,STRINGS]])
178
179 Mail::Box::Search::SpamAssassin->log([LEVEL [,STRINGS]])
180
181 See "Error handling" in Mail::Reporter
182
183 $obj->logPriority(LEVEL)
184
185 Mail::Box::Search::SpamAssassin->logPriority(LEVEL)
186
187 See "Error handling" in Mail::Reporter
188
189 $obj->logSettings
190
191 See "Error handling" in Mail::Reporter
192
193 $obj->notImplemented
194
195 See "Error handling" in Mail::Reporter
196
197 $obj->report([LEVEL])
198
199 See "Error handling" in Mail::Reporter
200
201 $obj->reportAll([LEVEL])
202
203 See "Error handling" in Mail::Reporter
204
205 $obj->trace([LEVEL])
206
207 See "Error handling" in Mail::Reporter
208
209 $obj->warnings
210
211 See "Error handling" in Mail::Reporter
212
213 Cleanup
214
215 $obj->DESTROY
216
217 See "Cleanup" in Mail::Reporter
218
219 $obj->inGlobalDestruction
220
221 See "Cleanup" in Mail::Reporter
222
224 Error: Package $package does not implement $method.
225
226 Fatal error: the specific package (or one of its superclasses) does not
227 implement this method where it should. This message means that some
228 other related classes do implement this method however the class at
229 hand does not. Probably you should investigate this and probably
230 inform the author of the package.
231
233 This module is part of Mail-Box distribution version 2.070, built on
234 March 25, 2007. Website: http://perl.overmeer.net/mailbox/
235
237 Copyrights 2001-2007 by Mark Overmeer.For other contributors see
238 ChangeLog.
239
240 This program is free software; you can redistribute it and/or modify it
241 under the same terms as Perl itself. See
242 http://www.perl.com/perl/misc/Artistic.html
243
244
245
246perl v5.8.8 2007-03-25Mail::Box::Search::SpamAssassin(3)