blib/lib/Mail/DMARC/Report/Send.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 52 CC 3 SCAR 12.4
CC
3
Cov
0%
http
6.0
smtp
6.0
too_big_report
2.0
CRAP 3.5
1 package Mail::DMARC::Report::Send;
2 use strict;
3 use warnings;
4 use feature 'signatures';
5  
6 our $VERSION = '2.20260827';
7  
8 use parent 'Mail::DMARC::Base';
9  
10 sub http($self) {
11 return $self->{http} if ref $self->{http};
12 require Mail::DMARC::Report::Send::HTTP;
13 return $self->{http} = Mail::DMARC::Report::Send::HTTP->new();
14 }
15  
16 sub smtp($self) {
17 return $self->{smtp} if ref $self->{smtp};
18 require Mail::DMARC::Report::Send::SMTP;
19 return $self->{smtp} = Mail::DMARC::Report::Send::SMTP->new();
20 }
21  
22 sub too_big_report( $self, $arg_ref ) {
23  
24 my $OrgName = $self->config->{organization}{org_name};
25 my $Domain = $self->config->{organization}{domain};
26 my $ver = $Mail::DMARC::Base::VERSION || ''; # undef in author environ
27 my $uri = $arg_ref->{uri};
28 my $bytes = $arg_ref->{report_bytes};
29 my $report_id = $arg_ref->{report_id};
30 my $rep_domain = $arg_ref->{report_domain};
31 my $date = $self->smtp->get_timestamp_rfc2822;
32  
33 return <<"EO_TOO_BIG"
34  
35 This is a 'too big' DMARC notice. The aggregate report was NOT delivered.
36  
37 Report-Date: $date
38 Report-Domain: $rep_domain
39 Report-ID: $report_id
40 Report-Size: $bytes
41 Submitter: $Domain
42 Submitting-URI: $uri
43  
44 Submitted by $OrgName
45 Generated with Mail::DMARC $ver
46  
47 EO_TOO_BIG
48 ;
49 }
50  
51 1;
52  
53 __END__
54  
55 =pod
56  
57 =head1 NAME
58  
59 Mail::DMARC::Report::Send - report sending dispatch class
60  
61 =head1 VERSION
62  
63 version 2.20260827
64  
65 =head1 DESCRIPTION
66  
67 Send DMARC reports, via SMTP or HTTP.
68  
69 =head2 Report Sender
70  
71 A report sender needs to:
72  
73 1. store reports
74 2. bundle aggregated reports
75 3. format report in XML
76 4. gzip the XML
77 5. deliver report to Author Domain
78  
79 This class and subclasses provide methods used by L<dmarc_send_reports>.
80  
81 =head1 12.2.1 Email
82  
83 L<Mail::DMARC::Report::Send::SMTP>
84  
85 =head1 12.2.2. HTTP
86  
87 L<Mail::DMARC::Report::Send::HTTP>
88  
89 =head1 12.2.3. Other Methods
90  
91 Other registered URI schemes may be explicitly supported in later versions.
92  
93 =head1 AUTHORS
94  
95 =over 4
96  
97 =item *
98  
99 Matt Simerson <msimerson@cpan.org>
100  
101 =item *
102  
103 Davide Migliavacca <shari@cpan.org>
104  
105 =item *
106  
107 Marc Bradshaw <marc@marcbradshaw.net>
108  
109 =back
110  
111 =head1 COPYRIGHT AND LICENSE
112  
113 This software is copyright (c) 2026 by Matt Simerson.
114  
115 This is free software; you can redistribute it and/or modify it under
116 the same terms as the Perl 5 programming language system itself.
117  
118 =cut