line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DMARC::Report::Aggregate::Record::Auth_Results; |
2
|
|
|
|
|
|
|
our $VERSION = '1.20210927'; |
3
|
13
|
|
|
13
|
|
907
|
use strict; |
|
13
|
|
|
|
|
28
|
|
|
13
|
|
|
|
|
488
|
|
4
|
13
|
|
|
13
|
|
70
|
use warnings; |
|
13
|
|
|
|
|
34
|
|
|
13
|
|
|
|
|
340
|
|
5
|
|
|
|
|
|
|
|
6
|
13
|
|
|
13
|
|
68
|
use Carp; |
|
13
|
|
|
|
|
27
|
|
|
13
|
|
|
|
|
6435
|
|
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
|
1067
|
my ( $class, @args ) = @_; |
12
|
18
|
50
|
|
|
|
65
|
croak "invalid arguments" if @args % 2; |
13
|
|
|
|
|
|
|
|
14
|
18
|
|
|
|
|
98
|
my $self = bless { spf => [], dkim => [] }, $class; |
15
|
18
|
100
|
|
|
|
113
|
return $self if 0 == scalar @args; |
16
|
|
|
|
|
|
|
|
17
|
9
|
|
|
|
|
27
|
my %args = @args; |
18
|
9
|
|
|
|
|
79
|
foreach my $key ( keys %args ) { |
19
|
17
|
|
|
|
|
63
|
$self->$key( $args{$key} ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
9
|
|
|
|
|
45
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub spf { |
26
|
28
|
|
|
28
|
0
|
2929
|
my ($self, @args) = @_; |
27
|
28
|
100
|
|
|
|
152
|
return $self->{spf} if 0 == scalar @args; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# one shot |
30
|
19
|
100
|
100
|
|
|
126
|
if (1 == scalar @args && ref $args[0] eq 'ARRAY') { |
31
|
|
|
|
|
|
|
#warn "SPF one shot"; |
32
|
15
|
|
|
|
|
37
|
my $iter = 0; |
33
|
15
|
|
|
|
|
27
|
foreach my $d ( @{ $args[0] }) { |
|
15
|
|
|
|
|
51
|
|
34
|
29
|
|
|
|
|
145
|
$self->{spf}->[$iter] = |
35
|
|
|
|
|
|
|
Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new($d); |
36
|
29
|
|
|
|
|
70
|
$iter++; |
37
|
|
|
|
|
|
|
} |
38
|
15
|
|
|
|
|
55
|
return $self->{spf}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#warn "SPF iterative"; |
42
|
4
|
|
|
|
|
8
|
push @{ $self->{spf} }, |
|
4
|
|
|
|
|
29
|
|
43
|
|
|
|
|
|
|
Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new(@args); |
44
|
|
|
|
|
|
|
|
45
|
4
|
|
|
|
|
19
|
return $self->{spf}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub dkim { |
49
|
30
|
|
|
30
|
0
|
4020
|
my ($self, @args) = @_; |
50
|
30
|
100
|
|
|
|
136
|
return $self->{dkim} if 0 == scalar @args; |
51
|
|
|
|
|
|
|
|
52
|
19
|
100
|
100
|
|
|
131
|
if (1 == scalar @args && ref $args[0] eq 'ARRAY') { |
53
|
|
|
|
|
|
|
#warn "dkim one shot"; |
54
|
14
|
|
|
|
|
25
|
my $iter = 0; |
55
|
14
|
|
|
|
|
23
|
foreach my $d ( @{ $args[0] }) { |
|
14
|
|
|
|
|
40
|
|
56
|
20
|
|
|
|
|
127
|
$self->{dkim}->[$iter] = |
57
|
|
|
|
|
|
|
Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new($d); |
58
|
20
|
|
|
|
|
45
|
$iter++; |
59
|
|
|
|
|
|
|
} |
60
|
14
|
|
|
|
|
43
|
return $self->{dkim}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#warn "dkim iterative"; |
64
|
5
|
|
|
|
|
10
|
push @{ $self->{dkim}}, |
|
5
|
|
|
|
|
32
|
|
65
|
|
|
|
|
|
|
Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new(@args); |
66
|
|
|
|
|
|
|
|
67
|
5
|
|
|
|
|
22
|
return $self->{dkim}; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |