SpamMonkey::Result - Result object for spam test


SpamMonkey documentation Contained in the SpamMonkey distribution.

Index


Code Index:

NAME

Top

SpamMonkey::Result - Result object for spam test

SYNOPSIS

Top

    if ($result->is_spam) {
        $result->rewrite;
        print $result->email->as_string;
    }

DESCRIPTION

Top

This class provides utility methods for dealing with the results of a SpamMonkey test.

METHODS

Top

is_spam

Returns true if the message scores more than the required threshold.

hits

Returns a list of the names of rules that matched.

describe_hits

Returns a list of the descriptions of rules that matched.

score

Returns the score for this test.


SpamMonkey documentation Contained in the SpamMonkey distribution.
package SpamMonkey::Result;

sub is_spam {
    my $self = shift;
    $self->{score} > $self->{monkey}{conf}{settings}{required_score};
}

sub hits {
    my $self = shift;
    @{$self->{matched}||[]};
}

sub describe_hits {
    my $self = shift;
    map { $self->{monkey}{conf}{descriptions}{$_} || $_ } $self->hits
}

sub score { shift->{score} }

1;