| 1 | package Mail::DMARC::Report::Aggregate::Record::Auth_Results; | ||||||||||||||||||||||||||||
| 2 | 17 | our $VERSION = '2.20261110'; | |||||||||||||||||||||||||||
| 3 | 17 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 17 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 17 | ▶ | use feature 'signatures'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 17 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 17 | require Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF; | |||||||||||||||||||||||||||
| 9 | 17 | require Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 34 | ▶ | sub new( $class, @args ) { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 34 | ▶ | croak "invalid arguments" if @args % 2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 34 | my $self = bless { spf => [], dkim => [] }, $class; | |||||||||||||||||||||||||||
| 15 | 34 | ▶ | return $self if !@args; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 18 | my %args = @args; | |||||||||||||||||||||||||||
| 18 | 18 | foreach my $key ( keys %args ) { | |||||||||||||||||||||||||||
| 19 | 35 | $self->$key( $args{$key} ); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 18 | return $self; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 51 | ▶ | sub spf( $self, @args ) { | ||||||||||||||||||||||||||
|
Subroutine
spf: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 26 | 51 | ▶ | return $self->{spf} if !@args; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | # one shot | ||||||||||||||||||||||||||||
| 29 | 35 | ▶ | if ( @args == 1 && ref $args[0] eq 'ARRAY' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@args == 1 and ref $args[0] eq "ARRAY"
MC/DC100%2/2
@args == 1 and ref $args[0] eq "ARRAY"
@args == 1
ref $args[0] eq "ARRAY"
Truth table100%3/3
A and B
A= @args == 1B= ref $args[0] eq "ARRAY"
| |||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | #warn "SPF one shot"; | ||||||||||||||||||||||||||||
| 32 | 31 | my $iter = 0; | |||||||||||||||||||||||||||
| 33 | 31 | foreach my $d ( @{ $args[0] } ) { | |||||||||||||||||||||||||||
| 34 | 48 | $self->{spf}->[$iter] | |||||||||||||||||||||||||||
| 35 | = Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new( | ||||||||||||||||||||||||||||
| 36 | $d); | ||||||||||||||||||||||||||||
| 37 | 48 | $iter++; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | 31 | return $self->{spf}; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | #warn "SPF iterative"; | ||||||||||||||||||||||||||||
| 43 | 4 | push @{ $self->{spf} }, | |||||||||||||||||||||||||||
| 44 | Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new(@args); | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 4 | return $self->{spf}; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 53 | ▶ | sub dkim( $self, @args ) { | ||||||||||||||||||||||||||
|
Subroutine
dkim: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 50 | 53 | ▶ | return $self->{dkim} if !@args; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 35 | ▶ | if ( @args == 1 && ref $args[0] eq 'ARRAY' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@args == 1 and ref $args[0] eq "ARRAY"
MC/DC100%2/2
@args == 1 and ref $args[0] eq "ARRAY"
@args == 1
ref $args[0] eq "ARRAY"
Truth table100%3/3
A and B
A= @args == 1B= ref $args[0] eq "ARRAY"
| |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | #warn "dkim one shot"; | ||||||||||||||||||||||||||||
| 55 | 30 | my $iter = 0; | |||||||||||||||||||||||||||
| 56 | 30 | foreach my $d ( @{ $args[0] } ) { | |||||||||||||||||||||||||||
| 57 | 38 | $self->{dkim}->[$iter] | |||||||||||||||||||||||||||
| 58 | = Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new( | ||||||||||||||||||||||||||||
| 59 | $d); | ||||||||||||||||||||||||||||
| 60 | 38 | $iter++; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | 30 | return $self->{dkim}; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | #warn "dkim iterative"; | ||||||||||||||||||||||||||||
| 66 | 5 | push @{ $self->{dkim} }, | |||||||||||||||||||||||||||
| 67 | Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new(@args); | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | 5 | return $self->{dkim}; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 17 | 1; | |||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | __END__ | ||||||||||||||||||||||||||||