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