line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2004 Anthony D. Urso. All rights reserved. |
2
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
3
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Mail::DomainKeys::Header; |
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
118385
|
use strict; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
9448
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = "0.88"; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
1
|
|
|
1
|
0
|
19
|
my $type = shift; |
13
|
1
|
|
|
|
|
5
|
my %prms = @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
3
|
my $self = {}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
6
|
$self->{'ATTR'} = $prms{'Key'}; |
19
|
1
|
|
|
|
|
3
|
$self->{'SIGN'} = $prms{'Signed'}; |
20
|
1
|
|
|
|
|
3
|
$self->{'VALU'} = $prms{'Value'}; |
21
|
1
|
|
|
|
|
4
|
$self->{'LINE'} = $prms{'Line'}; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
5
|
bless $self, $type; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub parse { |
27
|
36
|
|
|
36
|
0
|
61
|
my $type = shift; |
28
|
36
|
|
|
|
|
111
|
my %prms = @_; |
29
|
|
|
|
|
|
|
|
30
|
36
|
|
|
|
|
57
|
my $self = {}; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
36
|
50
|
|
|
|
95
|
$prms{'String'} or |
34
|
|
|
|
|
|
|
return; |
35
|
|
|
|
|
|
|
|
36
|
36
|
|
|
|
|
81
|
$self->{'LINE'} = $prms{'String'}; |
37
|
36
|
|
|
|
|
68
|
$self->{'SIGN'} = $prms{'Signed'}; |
38
|
|
|
|
|
|
|
|
39
|
36
|
|
|
|
|
164
|
bless $self, $type; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub append { |
43
|
18
|
|
|
18
|
0
|
28
|
my $self = shift; |
44
|
18
|
|
|
|
|
31
|
my $cont = shift; |
45
|
|
|
|
|
|
|
|
46
|
18
|
|
|
|
|
49
|
$self->line($self->line . $cont); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub unfolded { |
50
|
15
|
|
|
15
|
0
|
20
|
my $self = shift; |
51
|
|
|
|
|
|
|
|
52
|
15
|
|
|
|
|
25
|
my $line = $self->line; |
53
|
15
|
|
|
|
|
26
|
$line =~ s/\n//g; |
54
|
|
|
|
|
|
|
|
55
|
15
|
|
|
|
|
65
|
return $line . "\n"; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub vunfolded { |
59
|
13
|
|
|
13
|
0
|
33
|
my $self = shift; |
60
|
|
|
|
|
|
|
|
61
|
13
|
|
|
|
|
43
|
my $valu = $self->value; |
62
|
13
|
|
|
|
|
58
|
$valu =~ s/\n//g; |
63
|
|
|
|
|
|
|
|
64
|
13
|
|
|
|
|
139
|
return $valu . "\n"; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub key { |
68
|
192
|
|
|
192
|
0
|
318
|
my $self = shift; |
69
|
|
|
|
|
|
|
|
70
|
192
|
50
|
|
|
|
692
|
$self->line =~ /^([!-9;-\176]+)[ \t]*:/s and |
71
|
|
|
|
|
|
|
return $1; |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
0
|
return; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub line { |
77
|
271
|
|
|
271
|
0
|
390
|
my $self = shift; |
78
|
|
|
|
|
|
|
|
79
|
271
|
100
|
|
|
|
801
|
(@_) and |
80
|
|
|
|
|
|
|
$self->{'LINE'} = shift; |
81
|
|
|
|
|
|
|
|
82
|
271
|
|
|
|
|
2556
|
$self->{'LINE'}; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub signed { |
86
|
72
|
|
|
72
|
0
|
171
|
my $self = shift; |
87
|
|
|
|
|
|
|
|
88
|
72
|
100
|
|
|
|
175
|
(@_) and |
89
|
|
|
|
|
|
|
$self->{'SIGN'} = shift; |
90
|
|
|
|
|
|
|
|
91
|
72
|
|
|
|
|
330
|
$self->{'SIGN'}; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub value { |
95
|
13
|
|
|
13
|
0
|
89
|
my $self = shift; |
96
|
|
|
|
|
|
|
|
97
|
13
|
50
|
|
|
|
36
|
$self->line =~ /^[!-9;-\176]+[ \t]*:(.*)\z/s and |
98
|
|
|
|
|
|
|
return $1; |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
return; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
1; |