line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
34186
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
3
|
|
|
|
|
|
|
package Mail::Audit::DKIM; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Mail::Audit::DKIM::VERSION = '0.003'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# ABSTRACT: Mail::Audit plugin for domain key verification |
8
|
1
|
|
|
1
|
|
831
|
use Mail::DKIM::Verifier; |
|
1
|
|
|
|
|
157096
|
|
|
1
|
|
|
|
|
49
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
|
|
17
|
use Sub::Exporter 0.900 -setup => { |
11
|
|
|
|
|
|
|
into => 'Mail::Audit', |
12
|
|
|
|
|
|
|
exports => [ qw(result result_detail passes) ], |
13
|
|
|
|
|
|
|
groups => [ default => [ -all => { -prefix => 'dkim_' } ] ], |
14
|
1
|
|
|
1
|
|
943
|
}; |
|
1
|
|
|
|
|
14620
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _result_detail { |
17
|
4
|
|
|
4
|
|
6
|
my ($mail_audit) = @_; |
18
|
|
|
|
|
|
|
|
19
|
4
|
|
33
|
|
|
28
|
return $mail_audit->{__PACKAGE__}{result_detail} ||= do { |
20
|
4
|
|
|
|
|
46
|
my $verifier = Mail::DKIM::Verifier->new; |
21
|
|
|
|
|
|
|
|
22
|
4
|
|
|
|
|
199
|
my $string = $mail_audit->as_string; |
23
|
4
|
|
|
|
|
1188
|
my @lines = split /\x0d\x0a|\x0a\x0d|\x0a|\x0d/, $string; |
24
|
|
|
|
|
|
|
|
25
|
4
|
|
|
|
|
14
|
for my $line (@lines) { |
26
|
61
|
|
|
|
|
12162
|
$verifier->PRINT($line . "\x0d\x0a"); |
27
|
|
|
|
|
|
|
} |
28
|
4
|
|
|
|
|
173
|
$verifier->CLOSE; |
29
|
|
|
|
|
|
|
|
30
|
4
|
|
|
|
|
18294
|
$verifier->result_detail; |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub result_detail { |
35
|
0
|
|
|
0
|
0
|
0
|
my ($mail_audit) = @_; |
36
|
0
|
|
|
|
|
0
|
return _result_detail($mail_audit); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub result { |
40
|
4
|
|
|
4
|
0
|
113555
|
my ($mail_audit) = @_; |
41
|
4
|
|
|
|
|
15
|
my ($result) = _result_detail($mail_audit) =~ /\A(\w+)(?:\s|$)/; |
42
|
4
|
|
|
|
|
257
|
return $result; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub passes { |
46
|
0
|
|
|
0
|
0
|
|
my ($mail_audit) = @_; |
47
|
0
|
|
|
|
|
|
return _result_detail($mail_audit) =~ /^pass/; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |