Mail/Qmail/Filter/ValidateSender.pm

filter: Statementstmt 72.2% 13 / 18 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 62.9% 17 / 27 CC 3 SCAR 18.7
CC
3
Cov
59%
filter
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« Mail/Qmail/Filter/RewriteFrom.pm ↑ Summary Mail/Qmail/Filter/ValidateFrom.pm »
1 1 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Mail::Qmail::Filter::ValidateSender;
5  
6 1 our $VERSION = '1.01';
7  
8 1 ▶use Mo qw(coerce default);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 extends 'Mail::Qmail::Filter';
10  
11 1 has 'params' => {};
12 1 has 'reject_text' => 'Invalid sender address.';
13  
14 0 ▶sub filter {
Subroutine filter: not called CC=3 SCAR=24.8
Pod documented
15 0 my $self = shift;
16 0 ▶ length( my $mail_from = $self->message->from ) or return;
Branch: 1 branch
BranchTrueFalseTotal
length(my $mail_from = $self->message->from) or return 0 0 0
17  
18 0 require Email::Valid;
19 $self->reject( $self->reject_text, $mail_from )
20 0 ▶ unless Email::Valid->new( %{ $self->params } )->address($mail_from);
Branch: 1 branch
BranchTrueFalseTotal
unless "Email::Valid"->new(%{$self->params;})->address($mail_from) 0 0 0
21 }
22  
23 1 1;
24  
25 __END__
« Mail/Qmail/Filter/RewriteFrom.pm ↑ Summary Mail/Qmail/Filter/ValidateFrom.pm »