Mail::Message::Head::SpamGroup3pm
Spam fighting related header fields
Usage
my $sg = Mail::Message::Head::SpamGroup->new(head => $head, ...);$head->addSpamGroup($sg);my $sg = $head->addSpamGroup( <options> );$sg->delete;my @sgs = $head->spamGroups;
Inheritance
Mail::Message::Head::SpamGroupis a Mail::Message::Head::FieldGroupis a Mail::Reporter
Overview
A spam group is a set of header fields which are added by spam detection and spam fighting software. This class knows various details about that software.
Extends "DESCRIPTION" in Mail::Message::Head::FieldGroup.
Methods
Extends "METHODS" in Mail::Message::Head::FieldGroup.
Constructors
Extends "Constructors" in Mail::Message::Head::FieldGroup.
- $obj->
clone() -
Inherited, see "Constructors" in Mail::Message::Head::FieldGroup
- $any->
fighter($name, %options) -
Get the settings of a certain spam-fighter, optionally after setting them. The
knownFighters()method returns the defined names. The names are case-sensitive.The
%optionsare all passed as settings to the spamfilter, except the few which are listed here specifically.-Option --Defaultfields <required>isspam <required>version undef- fields => REGEXP
-
The regular expression which indicates which of the header fields are added by the spam fighter software.
- isspam => CODE
-
The CODE must return
"true"or"false", 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.
- 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.
» example: adding your own spam-fighter definitions
Mail::Message::Head::SpamGroup->fighter( 'MY-OWN',fields => qw/^x-MY-SPAM-DETECTOR-/,isspam => sub { my ($sg, $head) = @_; $head->fields > 100 },);
- $obj->
from($head|$message, %options) -
Returns a list of
"Mail::Message::Head::SpamGroup"objects, based on the specified$messageor message$head. Improves base, see "Constructors" in Mail::Message::Head::FieldGroup-Option--Defaulttypes undef- 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.
- $any->
habeasSweFieldsCorrect( [$message|$head] ) -
Returns a
"true"value if the$messageor$headcontains"Habeas-SWE"fields which are correct. Without argument, this is used as instance method on an existing Spam-Group.» example: checking Habeas-SWE fields
if(Mail::Message::Head::SpamGroup->habeasSweFieldsCorrect($message)){ $message->label(spam => 0);}my $sg = $message->head->spamGroups('Habeas-SWE');if($sg->habeasSweFieldsCorrect) { ... };use List::Util 'first';if(first {$_->habeasSweFieldsCorrect} $head->spamGroups){ ...}
- $any->
implementedTypes() -
Inherited, see "Constructors" in Mail::Message::Head::FieldGroup
- $any->
isSpamGroupFieldName($name)
- $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
fighter()method.
- $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
-Option --Defined in --Defaulthead Mail::Message::Head::FieldGroup undefsoftware Mail::Message::Head::FieldGroup undeftype Mail::Message::Head::FieldGroup undefversion Mail::Message::Head::FieldGroup undef- head => $head
- software => STRING
- type => STRING
- version => STRING
- $obj->
spamDetected( [BOOLEAN] ) -
Returns (after setting) whether this group of spam headers thinks that this is spam. See
Mail::Message::Head::Complete::spamDetected().» example:
die if $head->spamDetected;foreach my $sg ($head->spamGroups){ print $sg->type." found spam\n" if $sg->spamDetected;}
Attributes
Extends "Attributes" in Mail::Message::Head::FieldGroup.
The header
Extends "The header" in Mail::Message::Head::FieldGroup.
$obj->
|
Inherited, see "The header" in Mail::Message::Head::FieldGroup |
|---|---|
$obj->
|
Inherited, see "The header" in Mail::Message::Head::FieldGroup |
$obj->
|
Inherited, see "The header" in Mail::Message::Head::FieldGroup |
$obj->
|
Inherited, see "The header" in Mail::Message::Head::FieldGroup |
$obj->
|
Inherited, see "The header" in Mail::Message::Head::FieldGroup |
$obj->
|
Inherited, see "The header" in Mail::Message::Head::FieldGroup |
$obj->
|
Inherited, see "The header" in Mail::Message::Head::FieldGroup |
Access to the header
Extends "Access to the header" in Mail::Message::Head::FieldGroup.
$obj->
|
Inherited, see "Access to the header" in Mail::Message::Head::FieldGroup |
|---|---|
$obj->
|
Inherited, see "Access to the header" in Mail::Message::Head::FieldGroup |
$obj->
|
Inherited, see "Access to the header" in Mail::Message::Head::FieldGroup |
Internals
Extends "Internals" in Mail::Message::Head::FieldGroup.
$obj->
|
Inherited, see "Internals" in Mail::Message::Head::FieldGroup |
|---|---|
$obj->
|
Inherited, see "Internals" in Mail::Message::Head::FieldGroup |
Error handling
Extends "Error handling" in Mail::Message::Head::FieldGroup.
$obj->AUTOLOAD()
|
Inherited, see "Error handling" in Mail::Reporter |
|---|---|
$obj->
|
Inherited, see "Error handling" in Mail::Message::Head::FieldGroup |
$obj->
|
Inherited, see "Error handling" in Mail::Reporter |
$obj->
|
Inherited, see "Error handling" in Mail::Message::Head::FieldGroup |
Cleanup
Extends "Cleanup" in Mail::Message::Head::FieldGroup.
- $obj->DESTROY()
-
Inherited, see "Cleanup" in Mail::Reporter
Diagnostics
- Error: class $package does not implement method $method.
-
Fatal error: the specific
$package(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 bynotImplemented()
Releases
12 releases since Debian 3.1 (Sarge); the text changed 11 times.