Mail/Qmail/Filter/ValidateFrom.pm

filter: Statementstmt 61.9% 13 / 21 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 1 / 1 totaltotal 53.1% 17 / 32 CC 3 SCAR 16.7
CC
3
Cov
52%
filter
12.0
__ANON__
2.0
__ANON__
1.3
CRAP 5.3
« Mail/Qmail/Filter/ValidateSender.pm ↑ Summary Mail/Qmail/Filter/RequireFrom.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::ValidateFrom;
5  
6 1 our $VERSION = '1.21';
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 0 ▶has reject_text => sub {
Subroutine __ANON__: not called CC=1 SCAR=2.6
13 0 ▶ sub { "Invalid e-mail address <$_[0]> in From header line" }
Subroutine __ANON__: not called CC=1 SCAR=6.9
14 0 };
15  
16 0 ▶sub filter {
Subroutine filter: not called CC=3 SCAR=24.8
Pod documented
17 0 my $self = shift;
18 0 ▶ my $header_from = $self->message->header_from or return;
Branch: 1 branch
BranchTrueFalseTotal
my $header_from = $self->message->header_from or return 0 0 0
19 0 my $header_from_address = $header_from->address;
20  
21 0 require Email::Valid;
22 $self->reject( $self->reject_text, $header_from_address )
23 0 ▶ unless Email::Valid->new( %{ $self->params } )
Branch: 1 branch
BranchTrueFalseTotal
unless "Email::Valid"->new(%{$self->params;})->address($header_from_address) 0 0 0
24 ->address($header_from_address);
25 }
26  
27 1 1;
28  
29 __END__
« Mail/Qmail/Filter/ValidateSender.pm ↑ Summary Mail/Qmail/Filter/RequireFrom.pm »