line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DMARC::Report; |
2
|
9
|
|
|
9
|
|
644
|
use strict; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
304
|
|
3
|
9
|
|
|
9
|
|
91
|
use warnings; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
379
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.20230215'; |
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
68
|
use Carp; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
504
|
|
8
|
9
|
|
|
9
|
|
4288
|
use IO::Compress::Gzip; |
|
9
|
|
|
|
|
234553
|
|
|
9
|
|
|
|
|
526
|
|
9
|
9
|
|
|
9
|
|
5488
|
use IO::Compress::Zip; |
|
9
|
|
|
|
|
119801
|
|
|
9
|
|
|
|
|
501
|
|
10
|
|
|
|
|
|
|
|
11
|
9
|
|
|
9
|
|
75
|
use parent 'Mail::DMARC::Base'; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
158
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
require Mail::DMARC::Report::Aggregate; |
14
|
|
|
|
|
|
|
require Mail::DMARC::Report::Send; |
15
|
|
|
|
|
|
|
require Mail::DMARC::Report::Store; |
16
|
|
|
|
|
|
|
require Mail::DMARC::Report::Receive; |
17
|
|
|
|
|
|
|
require Mail::DMARC::Report::URI; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub compress { |
20
|
5
|
|
|
5
|
0
|
64
|
my ( $self, $xml_ref ) = @_; |
21
|
5
|
50
|
|
|
|
26
|
croak "xml is not a reference!" if 'SCALAR' ne ref $xml_ref; |
22
|
5
|
|
|
|
|
11
|
my $shrunk; |
23
|
5
|
|
|
|
|
32
|
my $zipper = { |
24
|
|
|
|
|
|
|
gz => \&IO::Compress::Gzip::gzip, # 2013 draft |
25
|
|
|
|
|
|
|
zip => \&IO::Compress::Zip::zip, # legacy format |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
# WARNING: changes here MAY require updates in SMTP::assemble_message |
28
|
|
|
|
|
|
|
# my $cf = ( time > 1372662000 ) ? 'gz' : 'zip'; # gz after 7/1/13 |
29
|
5
|
|
|
|
|
11
|
my $cf = 'gz'; |
30
|
5
|
50
|
|
|
|
35
|
$zipper->{$cf}->( $xml_ref, \$shrunk ) or croak "unable to compress: $!"; |
31
|
5
|
|
|
|
|
13313
|
return $shrunk; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub init { |
35
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
36
|
0
|
|
|
|
|
0
|
delete $self->{dmarc}; |
37
|
0
|
|
|
|
|
0
|
delete $self->{aggregate}; |
38
|
0
|
|
|
|
|
0
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub aggregate { |
42
|
42
|
|
|
42
|
0
|
10972
|
my $self = shift; |
43
|
42
|
100
|
|
|
|
254
|
return $self->{aggregate} if ref $self->{aggregate}; |
44
|
10
|
|
|
|
|
89
|
return $self->{aggregate} = Mail::DMARC::Report::Aggregate->new(); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub dmarc { |
48
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
49
|
0
|
|
|
|
|
0
|
return $self->{dmarc}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub receive { |
53
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
54
|
1
|
50
|
|
|
|
5
|
return $self->{receive} if ref $self->{receive}; |
55
|
1
|
|
|
|
|
10
|
return $self->{receive} = Mail::DMARC::Report::Receive->new; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub sendit { |
59
|
5
|
|
|
5
|
0
|
412
|
my $self = shift; |
60
|
5
|
50
|
|
|
|
21
|
return $self->{sendit} if ref $self->{sendit}; |
61
|
5
|
|
|
|
|
44
|
return $self->{sendit} = Mail::DMARC::Report::Send->new(); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub store { |
65
|
21
|
|
|
21
|
0
|
53
|
my $self = shift; |
66
|
21
|
100
|
|
|
|
158
|
return $self->{store} if ref $self->{store}; |
67
|
12
|
|
|
|
|
149
|
return $self->{store} = Mail::DMARC::Report::Store->new(); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub uri { |
71
|
27
|
|
|
27
|
0
|
47
|
my $self = shift; |
72
|
27
|
100
|
|
|
|
114
|
return $self->{uri} if ref $self->{uri}; |
73
|
10
|
|
|
|
|
103
|
return $self->{uri} = Mail::DMARC::Report::URI->new(); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub save_aggregate { |
77
|
5
|
|
|
5
|
0
|
13
|
my $self = shift; |
78
|
5
|
|
|
|
|
19
|
return $self->store->backend->save_aggregate( $self->aggregate ); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |