1Mail::Message::Head::SpUasmeGrroCuopn(t3r)ibuted Perl DoMcauimle:n:tMaetsisoange::Head::SpamGroup(3)
2
3
4
6 Mail::Message::Head::SpamGroup - spam fighting related header fields
7
9 Mail::Message::Head::SpamGroup
10 is a Mail::Message::Head::FieldGroup
11 is a Mail::Reporter
12
14 my $sg = Mail::Message::Head::SpamGroup->new(head => $head, ...);
15 $head->addSpamGroup($sg);
16
17 my $sg = $head->addSpamGroup( <options> );
18 $sg->delete;
19
20 my @sgs = $head->spamGroups;
21
23 A spam group is a set of header fields which are added by spam detec‐
24 tion and spam fighting software. This class knows various details
25 about that software.
26
28 Constructors
29
30 $obj->clone
31
32 See "Constructors" in Mail::Message::Head::FieldGroup
33
34 $obj->fighter(NAME, [SETTINGS])
35
36 Mail::Message::Head::SpamGroup->fighter(NAME, [SETTINGS])
37
38 Get the SETTINGS of a certain spam-fighter, optionally after set‐
39 ting them. The knownFighters() method returns the defined names.
40 The names are case-sensitive.
41
42 Option --Default
43 fields <required>
44 isspam <required>
45 version undef
46
47 . fields REGEXP
48
49 The regular expression which indicates which of the header
50 fields are added by the spam fighter software.
51
52 . isspam CODE
53
54 The CODE must return true or false, to indicate whether the
55 spam fighter thinks that the message contains spam. The CODE
56 ref is called with the spamgroup object (under construction)
57 and the header which is inspected.
58
59 . version CODE
60
61 Can be called to collect the official name and the version of
62 the software which is used to detect spam. The CODE ref is
63 called with the spamgroup object (under construction) and the
64 header which is inspected.
65
66 Example: adding your own spam-fighter definitions
67
68 Mail::Message::Head::SpamGroup->fighter( 'MY-OWN',
69 fields => qw/^x-MY-SPAM-DETECTOR-/,
70 isspam => sub { my ($sg, $head) = @_; $head->fields > 100 }
71 );
72
73 $obj->from(HEAD⎪MESSAGE, OPTIONS)
74
75 Returns a list of "Mail::Message::Head::SpamGroup" objects, based
76 on the specified MESSAGE or message HEAD.
77
78 Option--Default
79 types undef
80
81 . types ARRAY-OF-NAMES
82
83 Only the specified types will be tried. If the ARRAY is empty,
84 an empty list is returned. Without this option, all sets are
85 returned.
86
87 $obj->habeasSweFieldsCorrect([MESSAGE⎪HEAD])
88
89 Mail::Message::Head::SpamGroup->habeasSweFieldsCorrect([MESSAGE⎪HEAD])
90
91 Returns a true value if the MESSAGE or HEAD contains "Habeas-SWE"
92 fields which are correct. Without argument, this is used as
93 instance method on an existing Spam-Group.
94
95 Example: checking Habeas-SWE fields
96
97 if(Mail::Message::Head::SpamGroup->habeasSweFieldsCorrect($message))
98 { $message->label(spam => 0);
99 }
100
101 my $sg = $message->head->spamGroups('Habeas-SWE');
102 if($sg->habeasSweFieldsCorrect) { ... };
103
104 use List::Util 'first';
105 if(first {$_->habeasSweFieldsCorrect} $head->spamGroups)
106 { ...
107 }
108
109 $obj->implementedTypes
110
111 Mail::Message::Head::SpamGroup->implementedTypes
112
113 See "Constructors" in Mail::Message::Head::FieldGroup
114
115 $obj->isSpamGroupFieldName(NAME)
116
117 Mail::Message::Head::SpamGroup->isSpamGroupFieldName(NAME)
118
119 $obj->knownFighters
120
121 Mail::Message::Head::SpamGroup->knownFighters
122
123 Returns an unsorted list of all names representing pre-defined
124 spam-fighter software. You can ask details about them, and regis‐
125 ter more fighters with the fighter() method.
126
127 Mail::Message::Head::SpamGroup->new(FIELDS, OPTIONS)
128
129 Construct an object which maintains one set of fields which were
130 added by spam fighting software.
131
132 Option --Defined in --Default
133 head Mail::Message::Head::FieldGroup undef
134 log Mail::Reporter 'WARNINGS'
135 software Mail::Message::Head::FieldGroup undef
136 trace Mail::Reporter 'WARNINGS'
137 type Mail::Message::Head::FieldGroup undef
138 version Mail::Message::Head::FieldGroup undef
139
140 . head HEAD
141
142 . log LEVEL
143
144 . software STRING
145
146 . trace LEVEL
147
148 . type STRING
149
150 . version STRING
151
152 $obj->spamDetected([BOOLEAN])
153
154 Returns (after setting) whether this group of spam headers thinks
155 that this is spam. See Mail::Message::Head::Complete::spamDe‐
156 tected().
157
158 Example:
159
160 die if $head->spamDetected;
161
162 foreach my $sg ($head->spamGroups)
163 { print $sg->type." found spam\n" if $sg->spamDetected;
164 }
165
166 The header
167
168 $obj->add((FIELD, VALUE) ⎪ OBJECT)
169
170 See "The header" in Mail::Message::Head::FieldGroup
171
172 $obj->addFields([FIELDNAMES])
173
174 See "The header" in Mail::Message::Head::FieldGroup
175
176 $obj->attach(HEAD)
177
178 See "The header" in Mail::Message::Head::FieldGroup
179
180 $obj->delete
181
182 See "The header" in Mail::Message::Head::FieldGroup
183
184 $obj->fieldNames
185
186 See "The header" in Mail::Message::Head::FieldGroup
187
188 $obj->fields
189
190 See "The header" in Mail::Message::Head::FieldGroup
191
192 $obj->head
193
194 See "The header" in Mail::Message::Head::FieldGroup
195
196 Access to the header
197
198 $obj->software
199
200 See "Access to the header" in Mail::Message::Head::FieldGroup
201
202 $obj->type
203
204 See "Access to the header" in Mail::Message::Head::FieldGroup
205
206 $obj->version
207
208 See "Access to the header" in Mail::Message::Head::FieldGroup
209
210 Internals
211
212 $obj->collectFields([NAME])
213
214 See "Internals" in Mail::Message::Head::FieldGroup
215
216 $obj->detected(TYPE, SOFTWARE, VERSION)
217
218 See "Internals" in Mail::Message::Head::FieldGroup
219
220 Error handling
221
222 $obj->AUTOLOAD
223
224 See "Error handling" in Mail::Reporter
225
226 $obj->addReport(OBJECT)
227
228 See "Error handling" in Mail::Reporter
229
230 $obj->defaultTrace([LEVEL]⎪[LOGLEVEL, TRACELEVEL]⎪[LEVEL, CALLBACK])
231
232 Mail::Message::Head::SpamGroup->defaultTrace([LEVEL]⎪[LOGLEVEL,
233 TRACELEVEL]⎪[LEVEL, CALLBACK])
234
235 See "Error handling" in Mail::Reporter
236
237 $obj->details
238
239 See "Error handling" in Mail::Message::Head::FieldGroup
240
241 $obj->errors
242
243 See "Error handling" in Mail::Reporter
244
245 $obj->log([LEVEL [,STRINGS]])
246
247 Mail::Message::Head::SpamGroup->log([LEVEL [,STRINGS]])
248
249 See "Error handling" in Mail::Reporter
250
251 $obj->logPriority(LEVEL)
252
253 Mail::Message::Head::SpamGroup->logPriority(LEVEL)
254
255 See "Error handling" in Mail::Reporter
256
257 $obj->logSettings
258
259 See "Error handling" in Mail::Reporter
260
261 $obj->notImplemented
262
263 See "Error handling" in Mail::Reporter
264
265 $obj->print([FILEHANDLE])
266
267 See "Error handling" in Mail::Message::Head::FieldGroup
268
269 $obj->report([LEVEL])
270
271 See "Error handling" in Mail::Reporter
272
273 $obj->reportAll([LEVEL])
274
275 See "Error handling" in Mail::Reporter
276
277 $obj->trace([LEVEL])
278
279 See "Error handling" in Mail::Reporter
280
281 $obj->warnings
282
283 See "Error handling" in Mail::Reporter
284
285 Cleanup
286
287 $obj->DESTROY
288
289 See "Cleanup" in Mail::Reporter
290
291 $obj->inGlobalDestruction
292
293 See "Cleanup" in Mail::Reporter
294
296 Spam fighting fields
297
298 Detected spam fighting software
299
300 The Mail::Message::Head::SpamGroup class can be used to detect fields
301 which were produced by different spam fighting software.
302
303 * SpamAssassin
304 These fields are added by Mail::SpamAssassin, which is the central
305 implementation of the spam-assassin package. The homepage of this
306 GPL'ed project can be found at <http://spamassassin.org>.
307
308 * Habeas-SWE
309 Habeas tries to fight spam via the standard copyright protection
310 mechanism: Sender Warranted E-mail (SWE). Only when you have a con‐
311 tract with Habeas, you are permitted to add a few copyrighted lines
312 to your e-mail. Spam senders will be refused a contract. Mail
313 clients which see these nine lines are (quite) sure that the mes‐
314 sage is sincere.
315
316 See <http://www.habeas.com> for all the details on this commercial
317 product.
318
319 * MailScanner
320 The MailScanner filter is developed and maintained by transtec Com‐
321 puters. The software is available for free download from
322 <http://www.sng.ecs.soton.ac.uk/mailscanner/>. Commercial support
323 is provided via <http://www.mailscanner.biz>.
324
326 Error: Package $package does not implement $method.
327
328 Fatal error: the specific package (or one of its superclasses) does not
329 implement this method where it should. This message means that some
330 other related classes do implement this method however the class at
331 hand does not. Probably you should investigate this and probably
332 inform the author of the package.
333
335 This module is part of Mail-Box distribution version 2.070, built on
336 March 25, 2007. Website: http://perl.overmeer.net/mailbox/
337
339 Copyrights 2001-2007 by Mark Overmeer.For other contributors see
340 ChangeLog.
341
342 This program is free software; you can redistribute it and/or modify it
343 under the same terms as Perl itself. See
344 http://www.perl.com/perl/misc/Artistic.html
345
346
347
348perl v5.8.8 2007-03-25 Mail::Message::Head::SpamGroup(3)