line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DMARC::Result::Reason; |
2
|
|
|
|
|
|
|
our $VERSION = '1.20230215'; |
3
|
7
|
|
|
7
|
|
48
|
use strict; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
206
|
|
4
|
7
|
|
|
7
|
|
36
|
use warnings; |
|
7
|
|
|
|
|
21
|
|
|
7
|
|
|
|
|
161
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
34
|
use Carp; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
2065
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
21
|
|
|
21
|
0
|
58
|
my ( $class, @args ) = @_; |
10
|
21
|
50
|
|
|
|
64
|
croak "invalid arguments" if @args % 2; |
11
|
21
|
|
|
|
|
69
|
my %args = @args; |
12
|
21
|
|
|
|
|
54
|
my $self = bless {}, $class; |
13
|
21
|
|
|
|
|
71
|
foreach my $key ( keys %args ) { |
14
|
33
|
|
|
|
|
118
|
$self->$key( $args{$key} ); |
15
|
|
|
|
|
|
|
} |
16
|
15
|
|
|
|
|
61
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub type { |
20
|
21
|
50
|
|
21
|
1
|
65
|
return $_[0]->{type} if 1 == scalar @_; |
21
|
|
|
|
|
|
|
croak "invalid type" |
22
|
21
|
100
|
|
|
|
45
|
if 0 == grep {/^$_[1]$/ix} |
|
126
|
|
|
|
|
1156
|
|
23
|
|
|
|
|
|
|
qw/ forwarded sampled_out trusted_forwarder |
24
|
|
|
|
|
|
|
mailing_list local_policy other /; |
25
|
15
|
|
|
|
|
70
|
return $_[0]->{type} = $_[1]; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub comment { |
29
|
13
|
100
|
|
13
|
1
|
60
|
return $_[0]->{comment} if 1 == scalar @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# comment is optional and requires no validation |
32
|
12
|
|
|
|
|
37
|
return $_[0]->{comment} = $_[1]; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |