| 1 | package Mail::Decency::ContentFilter::Core::Spam; | ||||||||||||
| 2 | |||||||||||||
| 3 | 5 | ▶ | use Moose::Role; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 5 | ▶ | use version 0.74; our $VERSION = qv( "v0.1.6" ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | =head1 NAME | ||||||||||||
| 8 | |||||||||||||
| 9 | Mail::Decency::ContentFilter::Core::Spam | ||||||||||||
| 10 | |||||||||||||
| 11 | =head1 DESCRIPTION | ||||||||||||
| 12 | |||||||||||||
| 13 | For all modules being a spam filter (scoring mails) | ||||||||||||
| 14 | |||||||||||||
| 15 | =head1 CLASS ATTRIBUTES | ||||||||||||
| 16 | |||||||||||||
| 17 | =head2 weight_innocent : Int | ||||||||||||
| 18 | |||||||||||||
| 19 | Default weight of innocent mails.. used in descendant modules | ||||||||||||
| 20 | |||||||||||||
| 21 | =cut | ||||||||||||
| 22 | |||||||||||||
| 23 | 5 | has weight_innocent => ( is => 'rw', isa => 'Int', default => 10 ); | |||||||||||
| 24 | |||||||||||||
| 25 | =head2 weight_spam : Int | ||||||||||||
| 26 | |||||||||||||
| 27 | Default weight of spam mails .. used in descendant modules | ||||||||||||
| 28 | |||||||||||||
| 29 | =cut | ||||||||||||
| 30 | |||||||||||||
| 31 | 5 | has weight_spam => ( is => 'rw', isa => 'Int', default => -50 ); | |||||||||||
| 32 | |||||||||||||
| 33 | |||||||||||||
| 34 | =head2 METHODS | ||||||||||||
| 35 | |||||||||||||
| 36 | =head2 pre_init | ||||||||||||
| 37 | |||||||||||||
| 38 | Add check params: weight_innocent, weight_spam to list of check params | ||||||||||||
| 39 | |||||||||||||
| 40 | =cut | ||||||||||||
| 41 | |||||||||||||
| 42 | 0 | ▶ | before init => sub { | ||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||
| 43 | 0 | my ( $self ) = @_; | |||||||||||
| 44 | 0 | ▶ | push @{ $self->{ config_params } ||=[] }, qw/ weight_innocent weight_spam /; | ||||||||||
|
Condition0%0/2
$self->{"config_params"} ||= []
MC/DC0%0/1
$self->{"config_params"} ||= []
$self->{"config_params"}
Truth table0%0/2
A
A= $self->{"config_params"}
| |||||||||||||
| 45 | 5 | }; | |||||||||||
| 46 | |||||||||||||
| 47 | =head2 add_spam_score | ||||||||||||
| 48 | |||||||||||||
| 49 | =cut | ||||||||||||
| 50 | |||||||||||||
| 51 | 0 | ▶ | sub add_spam_score { | ||||||||||
|
Subroutine
add_spam_score: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 52 | 0 | my ( $self, $score, $info ) = @_; | |||||||||||
| 53 | 0 | return $self->server->add_spam_score( $score, $self, $info ); | |||||||||||
| 54 | } | ||||||||||||
| 55 | |||||||||||||
| 56 | |||||||||||||
| 57 | =head1 AUTHOR | ||||||||||||
| 58 | |||||||||||||
| 59 | Ulrich Kautz <uk@fortrabbit.de> | ||||||||||||
| 60 | |||||||||||||
| 61 | =head1 COPYRIGHT | ||||||||||||
| 62 | |||||||||||||
| 63 | Copyright (c) 2010 the L</AUTHOR> as listed above | ||||||||||||
| 64 | |||||||||||||
| 65 | =head1 LICENCSE | ||||||||||||
| 66 | |||||||||||||
| 67 | This library is free software and may be distributed under the same terms as perl itself. | ||||||||||||
| 68 | |||||||||||||
| 69 | =cut | ||||||||||||
| 70 | |||||||||||||
| 71 | |||||||||||||
| 72 | 5 | 1; | |||||||||||