| 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
| |||||||||||
| 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
| |||||||||||
| 24 | ->address($header_from_address); | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 1 | 1; | |||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||