.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Mail::Message::Head::SpamGroup 3" .TH Mail::Message::Head::SpamGroup 3 2026-04-11 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Mail::Message::Head::SpamGroup \- spam fighting related header fields .SH INHERITANCE .IX Header "INHERITANCE" .Vb 3 \& Mail::Message::Head::SpamGroup \& is a Mail::Message::Head::FieldGroup \& is a Mail::Reporter .Ve .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& my $sg = Mail::Message::Head::SpamGroup\->new(head => $head, ...); \& $head\->addSpamGroup($sg); \& \& my $sg = $head\->addSpamGroup( ); \& $sg\->delete; \& \& my @sgs = $head\->spamGroups; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" A \fIspam group\fR is a set of header fields which are added by spam detection and spam fighting software. This class knows various details about that software. .PP Extends "DESCRIPTION" in Mail::Message::Head::FieldGroup. .SH METHODS .IX Header "METHODS" Extends "METHODS" in Mail::Message::Head::FieldGroup. .SS Constructors .IX Subsection "Constructors" Extends "Constructors" in Mail::Message::Head::FieldGroup. .ie n .IP $obj\->\fBclone\fR() 4 .el .IP \f(CW$obj\fR\->\fBclone\fR() 4 .IX Item "$obj->clone()" Inherited, see "Constructors" in Mail::Message::Head::FieldGroup .ie n .IP "$any\->\fBfighter\fR($name, %options)" 4 .el .IP "\f(CW$any\fR\->\fBfighter\fR($name, \f(CW%options\fR)" 4 .IX Item "$any->fighter($name, %options)" Get the settings of a certain spam\-fighter, optionally after setting them. The \fBknownFighters()\fR method returns the defined names. The names are case\-sensitive. .Sp The \f(CW%options\fR are all passed as settings to the spamfilter, except the few which are listed here specifically. .Sp .Vb 4 \& \-Option \-\-Default \& fields \& isspam \& version undef .Ve .RS 4 .IP "fields => REGEXP" 2 .IX Item "fields => REGEXP" The regular expression which indicates which of the header fields are added by the spam fighter software. .IP "isspam => CODE" 2 .IX Item "isspam => CODE" The CODE must return \f(CW\*(C`true\*(C'\fR or \f(CW\*(C`false\*(C'\fR, to indicate whether the spam fighter thinks that the message contains spam. The CODE ref is called with the spamgroup object (under construction) and the header which is inspected. .IP "version => CODE" 2 .IX Item "version => CODE" Can be called to collect the official name and the version of the software which is used to detect spam. The CODE ref is called with the spamgroup object (under construction) and the header which is inspected. .RE .RS 4 .Sp » example: adding your own spam\-fighter definitions .Sp .Vb 4 \& Mail::Message::Head::SpamGroup\->fighter( \*(AqMY\-OWN\*(Aq, \& fields => qw/^x\-MY\-SPAM\-DETECTOR\-/, \& isspam => sub { my ($sg, $head) = @_; $head\->fields > 100 }, \& ); .Ve .RE .ie n .IP "$obj\->\fBfrom\fR($head|$message, %options)" 4 .el .IP "\f(CW$obj\fR\->\fBfrom\fR($head|$message, \f(CW%options\fR)" 4 .IX Item "$obj->from($head|$message, %options)" Returns a list of \f(CW\*(C`Mail::Message::Head::SpamGroup\*(C'\fR objects, based on the specified \f(CW$message\fR or message \f(CW$head\fR. Improves base, see "Constructors" in Mail::Message::Head::FieldGroup .Sp .Vb 2 \& \-Option\-\-Default \& types undef .Ve .RS 4 .IP "types => ARRAY\-OF\-NAMES" 2 .IX Item "types => ARRAY-OF-NAMES" Only the specified types will be tried. If the ARRAY is empty, an empty list is returned. Without this option, all sets are returned. .RE .RS 4 .RE .ie n .IP "$any\->\fBhabeasSweFieldsCorrect\fR( [$message|$head] )" 4 .el .IP "\f(CW$any\fR\->\fBhabeasSweFieldsCorrect\fR( [$message|$head] )" 4 .IX Item "$any->habeasSweFieldsCorrect( [$message|$head] )" Returns a \f(CW\*(C`true\*(C'\fR value if the \f(CW$message\fR or \f(CW$head\fR contains \f(CW\*(C`Habeas\-SWE\*(C'\fR fields which are correct. Without argument, this is used as instance method on an existing Spam\-Group. .Sp » example: checking Habeas\-SWE fields .Sp .Vb 3 \& if(Mail::Message::Head::SpamGroup\->habeasSweFieldsCorrect($message)) \& { $message\->label(spam => 0); \& } \& \& my $sg = $message\->head\->spamGroups(\*(AqHabeas\-SWE\*(Aq); \& if($sg\->habeasSweFieldsCorrect) { ... }; \& \& use List::Util \*(Aqfirst\*(Aq; \& if(first {$_\->habeasSweFieldsCorrect} $head\->spamGroups) \& { ... \& } .Ve .ie n .IP $any\->\fBimplementedTypes\fR() 4 .el .IP \f(CW$any\fR\->\fBimplementedTypes\fR() 4 .IX Item "$any->implementedTypes()" Inherited, see "Constructors" in Mail::Message::Head::FieldGroup .ie n .IP $any\->\fBisSpamGroupFieldName\fR($name) 4 .el .IP \f(CW$any\fR\->\fBisSpamGroupFieldName\fR($name) 4 .IX Item "$any->isSpamGroupFieldName($name)" .ie n .IP $any\->\fBknownFighters\fR() 4 .el .IP \f(CW$any\fR\->\fBknownFighters\fR() 4 .IX Item "$any->knownFighters()" Returns an unsorted list of all names representing pre\-defined spam\-fighter software. You can ask details about them, and register more fighters with the \fBfighter()\fR method. .ie n .IP "$class\->\fBnew\fR($fields, %options)" 4 .el .IP "\f(CW$class\fR\->\fBnew\fR($fields, \f(CW%options\fR)" 4 .IX Item "$class->new($fields, %options)" Construct an object which maintains one set of fields which were added by spam fighting software. Improves base, see "Constructors" in Mail::Message::Head::FieldGroup .Sp .Vb 5 \& \-Option \-\-Defined in \-\-Default \& head Mail::Message::Head::FieldGroup undef \& software Mail::Message::Head::FieldGroup undef \& type Mail::Message::Head::FieldGroup undef \& version Mail::Message::Head::FieldGroup undef .Ve .RS 4 .ie n .IP "head => $head" 2 .el .IP "head => \f(CW$head\fR" 2 .IX Item "head => $head" .PD 0 .IP "software => STRING" 2 .IX Item "software => STRING" .IP "type => STRING" 2 .IX Item "type => STRING" .IP "version => STRING" 2 .IX Item "version => STRING" .PD .RE .RS 4 .RE .ie n .IP "$obj\->\fBspamDetected\fR( [BOOLEAN] )" 4 .el .IP "\f(CW$obj\fR\->\fBspamDetected\fR( [BOOLEAN] )" 4 .IX Item "$obj->spamDetected( [BOOLEAN] )" Returns (after setting) whether this group of spam headers thinks that this is spam. See \fBMail::Message::Head::Complete::spamDetected()\fR. .Sp » example: .Sp .Vb 1 \& die if $head\->spamDetected; \& \& foreach my $sg ($head\->spamGroups) \& { print $sg\->type." found spam\en" if $sg\->spamDetected; \& } .Ve .SS Attributes .IX Subsection "Attributes" Extends "Attributes" in Mail::Message::Head::FieldGroup. .SS "The header" .IX Subsection "The header" Extends "The header" in Mail::Message::Head::FieldGroup. .ie n .IP "$obj\->\fBadd\fR( <$field, $value> | $object )" 4 .el .IP "\f(CW$obj\fR\->\fBadd\fR( <$field, \f(CW$value\fR> | \f(CW$object\fR )" 4 .IX Item "$obj->add( <$field, $value> | $object )" Inherited, see "The header" in Mail::Message::Head::FieldGroup .ie n .IP "$obj\->\fBaddFields\fR( [$fieldnames] )" 4 .el .IP "\f(CW$obj\fR\->\fBaddFields\fR( [$fieldnames] )" 4 .IX Item "$obj->addFields( [$fieldnames] )" Inherited, see "The header" in Mail::Message::Head::FieldGroup .ie n .IP $obj\->\fBattach\fR($head) 4 .el .IP \f(CW$obj\fR\->\fBattach\fR($head) 4 .IX Item "$obj->attach($head)" Inherited, see "The header" in Mail::Message::Head::FieldGroup .ie n .IP $obj\->\fBdelete\fR() 4 .el .IP \f(CW$obj\fR\->\fBdelete\fR() 4 .IX Item "$obj->delete()" Inherited, see "The header" in Mail::Message::Head::FieldGroup .ie n .IP $obj\->\fBfieldNames\fR() 4 .el .IP \f(CW$obj\fR\->\fBfieldNames\fR() 4 .IX Item "$obj->fieldNames()" Inherited, see "The header" in Mail::Message::Head::FieldGroup .ie n .IP $obj\->\fBfields\fR() 4 .el .IP \f(CW$obj\fR\->\fBfields\fR() 4 .IX Item "$obj->fields()" Inherited, see "The header" in Mail::Message::Head::FieldGroup .ie n .IP $obj\->\fBhead\fR() 4 .el .IP \f(CW$obj\fR\->\fBhead\fR() 4 .IX Item "$obj->head()" Inherited, see "The header" in Mail::Message::Head::FieldGroup .SS "Access to the header" .IX Subsection "Access to the header" Extends "Access to the header" in Mail::Message::Head::FieldGroup. .ie n .IP $obj\->\fBsoftware\fR() 4 .el .IP \f(CW$obj\fR\->\fBsoftware\fR() 4 .IX Item "$obj->software()" Inherited, see "Access to the header" in Mail::Message::Head::FieldGroup .ie n .IP $obj\->\fBtype\fR() 4 .el .IP \f(CW$obj\fR\->\fBtype\fR() 4 .IX Item "$obj->type()" Inherited, see "Access to the header" in Mail::Message::Head::FieldGroup .ie n .IP $obj\->\fBversion\fR() 4 .el .IP \f(CW$obj\fR\->\fBversion\fR() 4 .IX Item "$obj->version()" Inherited, see "Access to the header" in Mail::Message::Head::FieldGroup .SS Internals .IX Subsection "Internals" Extends "Internals" in Mail::Message::Head::FieldGroup. .ie n .IP "$obj\->\fBcollectFields\fR( [$name] )" 4 .el .IP "\f(CW$obj\fR\->\fBcollectFields\fR( [$name] )" 4 .IX Item "$obj->collectFields( [$name] )" Inherited, see "Internals" in Mail::Message::Head::FieldGroup .ie n .IP "$obj\->\fBdetected\fR($type, $software, $version)" 4 .el .IP "\f(CW$obj\fR\->\fBdetected\fR($type, \f(CW$software\fR, \f(CW$version\fR)" 4 .IX Item "$obj->detected($type, $software, $version)" Inherited, see "Internals" in Mail::Message::Head::FieldGroup .SS "Error handling" .IX Subsection "Error handling" Extends "Error handling" in Mail::Message::Head::FieldGroup. .ie n .IP $obj\->\fBAUTOLOAD\fR() 4 .el .IP \f(CW$obj\fR\->\fBAUTOLOAD\fR() 4 .IX Item "$obj->AUTOLOAD()" Inherited, see "Error handling" in Mail::Reporter .ie n .IP $obj\->\fBdetails\fR() 4 .el .IP \f(CW$obj\fR\->\fBdetails\fR() 4 .IX Item "$obj->details()" Inherited, see "Error handling" in Mail::Message::Head::FieldGroup .ie n .IP $obj\->\fBnotImplemented\fR() 4 .el .IP \f(CW$obj\fR\->\fBnotImplemented\fR() 4 .IX Item "$obj->notImplemented()" Inherited, see "Error handling" in Mail::Reporter .ie n .IP "$obj\->\fBprint\fR( [$fh] )" 4 .el .IP "\f(CW$obj\fR\->\fBprint\fR( [$fh] )" 4 .IX Item "$obj->print( [$fh] )" Inherited, see "Error handling" in Mail::Message::Head::FieldGroup .SS Cleanup .IX Subsection "Cleanup" Extends "Cleanup" in Mail::Message::Head::FieldGroup. .ie n .IP $obj\->\fBDESTROY\fR() 4 .el .IP \f(CW$obj\fR\->\fBDESTROY\fR() 4 .IX Item "$obj->DESTROY()" Inherited, see "Cleanup" in Mail::Reporter .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" .ie n .IP "Error: class $package does not implement method $method." 4 .el .IP "Error: class \f(CW$package\fR does not implement method \f(CW$method\fR." 4 .IX Item "Error: class $package does not implement method $method." Fatal error: the specific \f(CW$package\fR (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by \f(CWnotImplemented()\fR .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail\-Message version 4.05, built on April 10, 2026. Website: \fIhttp://perl.overmeer.net/mailbox/\fR .SH LICENSE .IX Header "LICENSE" For contributors see file ChangeLog. .PP This software is copyright (c) 2001\-2026 by Mark Overmeer. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.