| 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
| |||||||||||
| 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
| |||||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 1 | 1; | |||||||||
| 24 | |||||||||||
| 25 | __END__ | ||||||||||