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