| 1 | package Mail::DMARC::Report; | ||||||||||
| 2 | 10 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 10 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 10 | ▶ | use feature 'signatures'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 10 | our $VERSION = '2.20261110'; | |||||||||
| 7 | |||||||||||
| 8 | 10 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 10 | ▶ | use IO::Compress::Gzip; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 10 | ▶ | use IO::Compress::Zip; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 10 | ▶ | use parent 'Mail::DMARC::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 10 | require Mail::DMARC::Report::URI; | |||||||||
| 15 | |||||||||||
| 16 | 11 | ▶ | sub compress( $self, $xml_ref ) { | ||||||||
|
Subroutine
compress: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||
| 17 | 11 | ▶ | croak "xml is not a reference!" if 'SCALAR' ne ref $xml_ref; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 11 | my $shrunk; | |||||||||
| 19 | 11 | my $zipper = { | |||||||||
| 20 | gz => \&IO::Compress::Gzip::gzip, # 2013 draft | ||||||||||
| 21 | zip => \&IO::Compress::Zip::zip, # legacy format | ||||||||||
| 22 | }; | ||||||||||
| 23 | |||||||||||
| 24 | # WARNING: changes here MAY require updates in SMTP::assemble_message | ||||||||||
| 25 | 11 | my $cf = 'gz'; | |||||||||
| 26 | 11 | ▶ | $zipper->{$cf}->( $xml_ref, \$shrunk ) or croak "unable to compress: $!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 11 | return $shrunk; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | sub init($self) { | ||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 31 | 1 | delete $self->{dmarc}; | |||||||||
| 32 | 1 | delete $self->{aggregate}; | |||||||||
| 33 | 1 | return; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 82 | ▶ | sub aggregate($self) { | ||||||||
|
Subroutine
aggregate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 37 | 82 | ▶ | return $self->{aggregate} if ref $self->{aggregate}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 22 | require Mail::DMARC::Report::Aggregate; | |||||||||
| 39 | 22 | return $self->{aggregate} = Mail::DMARC::Report::Aggregate->new(); | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | sub dmarc($self) { | ||||||||
|
Subroutine
dmarc: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 43 | 0 | return $self->{dmarc}; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 1 | ▶ | sub receive($self) { | ||||||||
|
Subroutine
receive: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 47 | 1 | ▶ | return $self->{receive} if ref $self->{receive}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 1 | require Mail::DMARC::Report::Receive; | |||||||||
| 49 | 1 | return $self->{receive} = Mail::DMARC::Report::Receive->new; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 42 | ▶ | sub sendit($self) { | ||||||||
|
Subroutine
sendit: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 53 | 42 | ▶ | return $self->{sendit} if ref $self->{sendit}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | 41 | require Mail::DMARC::Report::Send; | |||||||||
| 55 | 41 | return $self->{sendit} = Mail::DMARC::Report::Send->new(); | |||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 54 | ▶ | sub store($self) { | ||||||||
|
Subroutine
store: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 59 | 54 | ▶ | return $self->{store} if ref $self->{store}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 60 | 28 | require Mail::DMARC::Report::Store; | |||||||||
| 61 | 28 | return $self->{store} = Mail::DMARC::Report::Store->new(); | |||||||||
| 62 | } | ||||||||||
| 63 | |||||||||||
| 64 | 53 | ▶ | sub uri($self) { | ||||||||
|
Subroutine
uri: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 65 | 53 | ▶ | return $self->{uri} if ref $self->{uri}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 66 | 25 | return $self->{uri} = Mail::DMARC::Report::URI->new(); | |||||||||
| 67 | } | ||||||||||
| 68 | |||||||||||
| 69 | 12 | ▶ | sub save_aggregate($self) { | ||||||||
|
Subroutine
save_aggregate: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 70 | 12 | return $self->store->backend->save_aggregate( $self->aggregate ); | |||||||||
| 71 | } | ||||||||||
| 72 | |||||||||||
| 73 | 10 | 1; | |||||||||
| 74 | |||||||||||
| 75 | __END__ | ||||||||||