1Mail::Message::Head::SpUasmeGrroCuopn(t3r)ibuted Perl DoMcauimle:n:tMaetsisoange::Head::SpamGroup(3)
2
3
4

NAME

6       Mail::Message::Head::SpamGroup - spam fighting related header fields
7

INHERITANCE

9        Mail::Message::Head::SpamGroup
10          is a Mail::Message::Head::FieldGroup
11          is a Mail::Reporter
12

SYNOPSIS

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

DESCRIPTION

23       A spam group is a set of header fields which are added by spam
24       detection and spam fighting software.  This class knows various details
25       about that software.
26

METHODS

28   Constructors
29       $obj->clone
30           See "Constructors" in Mail::Message::Head::FieldGroup
31
32       $obj->fighter(NAME, [SETTINGS])
33           Mail::Message::Head::SpamGroup->fighter(NAME, [SETTINGS])
34
35           Get the SETTINGS of a certain spam-fighter, optionally after
36           setting them.  The knownFighters() method returns the defined
37           names.  The names are case-sensitive.
38
39            -Option --Default
40             fields   <required>
41             isspam   <required>
42             version  undef
43
44           fields => REGEXP
45             The regular expression which indicates which of the header fields
46             are added by the spam fighter software.
47
48           isspam => CODE
49             The CODE must return true or false, to indicate whether the spam
50             fighter thinks that the message contains spam.  The CODE ref is
51             called with the spamgroup object (under construction) and the
52             header which is inspected.
53
54           version => CODE
55             Can be called to collect the official name and the version of the
56             software which is used to detect spam.  The CODE ref is called
57             with the spamgroup object (under construction) and the header
58             which is inspected.
59
60           example: adding your own spam-fighter definitions
61
62            Mail::Message::Head::SpamGroup->fighter( 'MY-OWN',
63               fields => qw/^x-MY-SPAM-DETECTOR-/,
64               isspam => sub { my ($sg, $head) = @_; $head->fields > 100 }
65              );
66
67       $obj->from(HEAD|MESSAGE, OPTIONS)
68           Returns a list of "Mail::Message::Head::SpamGroup" objects, based
69           on the specified MESSAGE or message HEAD.
70
71            -Option--Default
72             types   undef
73
74           types => ARRAY-OF-NAMES
75             Only the specified types will be tried.  If the ARRAY is empty,
76             an empty list is returned.  Without this option, all sets are
77             returned.
78
79       $obj->habeasSweFieldsCorrect([MESSAGE|HEAD])
80           Mail::Message::Head::SpamGroup->habeasSweFieldsCorrect([MESSAGE|HEAD])
81
82           Returns a true value if the MESSAGE or HEAD contains "Habeas-SWE"
83           fields which are correct.  Without argument, this is used as
84           instance method on an existing Spam-Group.
85
86           example: checking Habeas-SWE fields
87
88            if(Mail::Message::Head::SpamGroup->habeasSweFieldsCorrect($message))
89            {   $message->label(spam => 0);
90            }
91
92            my $sg = $message->head->spamGroups('Habeas-SWE');
93            if($sg->habeasSweFieldsCorrect) { ... };
94
95            use List::Util 'first';
96            if(first {$_->habeasSweFieldsCorrect} $head->spamGroups)
97            {   ...
98            }
99
100       $obj->implementedTypes
101           Mail::Message::Head::SpamGroup->implementedTypes
102
103           See "Constructors" in Mail::Message::Head::FieldGroup
104
105       $obj->isSpamGroupFieldName(NAME)
106           Mail::Message::Head::SpamGroup->isSpamGroupFieldName(NAME)
107
108       $obj->knownFighters
109           Mail::Message::Head::SpamGroup->knownFighters
110
111           Returns an unsorted list of all names representing pre-defined
112           spam-fighter software.  You can ask details about them, and
113           register more fighters with the fighter() method.
114
115       Mail::Message::Head::SpamGroup->new(FIELDS, OPTIONS)
116           Construct an object which maintains one set of fields which were
117           added by spam fighting software.
118
119            -Option  --Defined in     --Default
120             head      Mail::Message::Head::FieldGroup  undef
121             log       Mail::Reporter   'WARNINGS'
122             software  Mail::Message::Head::FieldGroup  undef
123             trace     Mail::Reporter   'WARNINGS'
124             type      Mail::Message::Head::FieldGroup  undef
125             version   Mail::Message::Head::FieldGroup  undef
126
127           head => HEAD
128           log => LEVEL
129           software => STRING
130           trace => LEVEL
131           type => STRING
132           version => STRING
133       $obj->spamDetected([BOOLEAN])
134           Returns (after setting) whether this group of spam headers thinks
135           that this is spam.  See
136           Mail::Message::Head::Complete::spamDetected().
137
138           example:
139
140             die if $head->spamDetected;
141
142             foreach my $sg ($head->spamGroups)
143             {   print $sg->type." found spam\n" if $sg->spamDetected;
144             }
145
146   The header
147       $obj->add((FIELD, VALUE) | OBJECT)
148           See "The header" in Mail::Message::Head::FieldGroup
149
150       $obj->addFields([FIELDNAMES])
151           See "The header" in Mail::Message::Head::FieldGroup
152
153       $obj->attach(HEAD)
154           See "The header" in Mail::Message::Head::FieldGroup
155
156       $obj->delete
157           See "The header" in Mail::Message::Head::FieldGroup
158
159       $obj->fieldNames
160           See "The header" in Mail::Message::Head::FieldGroup
161
162       $obj->fields
163           See "The header" in Mail::Message::Head::FieldGroup
164
165       $obj->head
166           See "The header" in Mail::Message::Head::FieldGroup
167
168   Access to the header
169       $obj->software
170           See "Access to the header" in Mail::Message::Head::FieldGroup
171
172       $obj->type
173           See "Access to the header" in Mail::Message::Head::FieldGroup
174
175       $obj->version
176           See "Access to the header" in Mail::Message::Head::FieldGroup
177
178   Internals
179       $obj->collectFields([NAME])
180           See "Internals" in Mail::Message::Head::FieldGroup
181
182       $obj->detected(TYPE, SOFTWARE, VERSION)
183           See "Internals" in Mail::Message::Head::FieldGroup
184
185   Error handling
186       $obj->AUTOLOAD
187           See "Error handling" in Mail::Reporter
188
189       $obj->addReport(OBJECT)
190           See "Error handling" in Mail::Reporter
191
192       $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
193           Mail::Message::Head::SpamGroup->defaultTrace([LEVEL]|[LOGLEVEL,
194           TRACELEVEL]|[LEVEL, CALLBACK])
195
196           See "Error handling" in Mail::Reporter
197
198       $obj->details
199           See "Error handling" in Mail::Message::Head::FieldGroup
200
201       $obj->errors
202           See "Error handling" in Mail::Reporter
203
204       $obj->log([LEVEL [,STRINGS]])
205           Mail::Message::Head::SpamGroup->log([LEVEL [,STRINGS]])
206
207           See "Error handling" in Mail::Reporter
208
209       $obj->logPriority(LEVEL)
210           Mail::Message::Head::SpamGroup->logPriority(LEVEL)
211
212           See "Error handling" in Mail::Reporter
213
214       $obj->logSettings
215           See "Error handling" in Mail::Reporter
216
217       $obj->notImplemented
218           See "Error handling" in Mail::Reporter
219
220       $obj->print([FILEHANDLE])
221           See "Error handling" in Mail::Message::Head::FieldGroup
222
223       $obj->report([LEVEL])
224           See "Error handling" in Mail::Reporter
225
226       $obj->reportAll([LEVEL])
227           See "Error handling" in Mail::Reporter
228
229       $obj->trace([LEVEL])
230           See "Error handling" in Mail::Reporter
231
232       $obj->warnings
233           See "Error handling" in Mail::Reporter
234
235   Cleanup
236       $obj->DESTROY
237           See "Cleanup" in Mail::Reporter
238
239       $obj->inGlobalDestruction
240           See "Cleanup" in Mail::Reporter
241

DETAILS

243   Spam fighting fields
244       Detected spam fighting software
245
246       The Mail::Message::Head::SpamGroup class can be used to detect fields
247       which were produced by different spam fighting software.
248
249       ·   SpamAssassin
250
251           These fields are added by Mail::SpamAssassin, which is the central
252           implementation of the spam-assassin package.  The homepage of this
253           GPL'ed project can be found at <http://spamassassin.org>.
254
255       ·   Habeas-SWE
256
257           Habeas tries to fight spam via the standard copyright protection
258           mechanism: Sender Warranted E-mail (SWE). Only when you have a
259           contract with Habeas, you are permitted to add a few copyrighted
260           lines to your e-mail. Spam senders will be refused a contract.
261           Mail clients which see these nine lines are (quite) sure that the
262           message is sincere.
263
264           See <http://www.habeas.com> for all the details on this commercial
265           product.
266
267       ·   MailScanner
268
269           The MailScanner filter is developed and maintained by transtec
270           Computers.  The software is available for free download from
271           <http://www.sng.ecs.soton.ac.uk/mailscanner/>.  Commercial support
272           is provided via <http://www.mailscanner.biz>.
273

DIAGNOSTICS

275       Error: Package $package does not implement $method.
276           Fatal error: the specific package (or one of its superclasses) does
277           not implement this method where it should. This message means that
278           some other related classes do implement this method however the
279           class at hand does not.  Probably you should investigate this and
280           probably inform the author of the package.
281

SEE ALSO

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

LICENSE

287       Copyrights 2001-2011 by Mark Overmeer. For other contributors see
288       ChangeLog.
289
290       This program is free software; you can redistribute it and/or modify it
291       under the same terms as Perl itself.  See
292       http://www.perl.com/perl/misc/Artistic.html
293
294
295
296perl v5.12.3                      2011-01-26 Mail::Message::Head::SpamGroup(3)
Impressum