| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mail::DMARC::Report::Aggregate::Record::Auth_Results; |
|
2
|
|
|
|
|
|
|
our $VERSION = '1.20230215'; |
|
3
|
13
|
|
|
13
|
|
895
|
use strict; |
|
|
13
|
|
|
|
|
41
|
|
|
|
13
|
|
|
|
|
380
|
|
|
4
|
13
|
|
|
13
|
|
79
|
use warnings; |
|
|
13
|
|
|
|
|
23
|
|
|
|
13
|
|
|
|
|
311
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
13
|
|
|
13
|
|
69
|
use Carp; |
|
|
13
|
|
|
|
|
26
|
|
|
|
13
|
|
|
|
|
6400
|
|
|
7
|
|
|
|
|
|
|
require Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF; |
|
8
|
|
|
|
|
|
|
require Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
|
11
|
18
|
|
|
18
|
0
|
1789
|
my ( $class, @args ) = @_; |
|
12
|
18
|
50
|
|
|
|
71
|
croak "invalid arguments" if @args % 2; |
|
13
|
|
|
|
|
|
|
|
|
14
|
18
|
|
|
|
|
98
|
my $self = bless { spf => [], dkim => [] }, $class; |
|
15
|
18
|
100
|
|
|
|
115
|
return $self if 0 == scalar @args; |
|
16
|
|
|
|
|
|
|
|
|
17
|
9
|
|
|
|
|
30
|
my %args = @args; |
|
18
|
9
|
|
|
|
|
32
|
foreach my $key ( keys %args ) { |
|
19
|
17
|
|
|
|
|
75
|
$self->$key( $args{$key} ); |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
9
|
|
|
|
|
58
|
return $self; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub spf { |
|
26
|
28
|
|
|
28
|
0
|
3575
|
my ($self, @args) = @_; |
|
27
|
28
|
100
|
|
|
|
171
|
return $self->{spf} if 0 == scalar @args; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# one shot |
|
30
|
19
|
100
|
100
|
|
|
155
|
if (1 == scalar @args && ref $args[0] eq 'ARRAY') { |
|
31
|
|
|
|
|
|
|
#warn "SPF one shot"; |
|
32
|
15
|
|
|
|
|
39
|
my $iter = 0; |
|
33
|
15
|
|
|
|
|
30
|
foreach my $d ( @{ $args[0] }) { |
|
|
15
|
|
|
|
|
58
|
|
|
34
|
29
|
|
|
|
|
158
|
$self->{spf}->[$iter] = |
|
35
|
|
|
|
|
|
|
Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new($d); |
|
36
|
29
|
|
|
|
|
78
|
$iter++; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
15
|
|
|
|
|
60
|
return $self->{spf}; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#warn "SPF iterative"; |
|
42
|
4
|
|
|
|
|
7
|
push @{ $self->{spf} }, |
|
|
4
|
|
|
|
|
28
|
|
|
43
|
|
|
|
|
|
|
Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new(@args); |
|
44
|
|
|
|
|
|
|
|
|
45
|
4
|
|
|
|
|
12
|
return $self->{spf}; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub dkim { |
|
49
|
30
|
|
|
30
|
0
|
4347
|
my ($self, @args) = @_; |
|
50
|
30
|
100
|
|
|
|
139
|
return $self->{dkim} if 0 == scalar @args; |
|
51
|
|
|
|
|
|
|
|
|
52
|
19
|
100
|
100
|
|
|
146
|
if (1 == scalar @args && ref $args[0] eq 'ARRAY') { |
|
53
|
|
|
|
|
|
|
#warn "dkim one shot"; |
|
54
|
14
|
|
|
|
|
40
|
my $iter = 0; |
|
55
|
14
|
|
|
|
|
27
|
foreach my $d ( @{ $args[0] }) { |
|
|
14
|
|
|
|
|
56
|
|
|
56
|
20
|
|
|
|
|
132
|
$self->{dkim}->[$iter] = |
|
57
|
|
|
|
|
|
|
Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new($d); |
|
58
|
20
|
|
|
|
|
55
|
$iter++; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
14
|
|
|
|
|
54
|
return $self->{dkim}; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#warn "dkim iterative"; |
|
64
|
5
|
|
|
|
|
9
|
push @{ $self->{dkim}}, |
|
|
5
|
|
|
|
|
30
|
|
|
65
|
|
|
|
|
|
|
Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new(@args); |
|
66
|
|
|
|
|
|
|
|
|
67
|
5
|
|
|
|
|
14
|
return $self->{dkim}; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |