line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2020 by [Mark Overmeer]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.02. |
5
|
|
|
|
|
|
|
# This code is part of distribution Mail-Box. Meta-POD processed with |
6
|
|
|
|
|
|
|
# OODoc into POD and HTML manual-pages. See README.md |
7
|
|
|
|
|
|
|
# Copyright Mark Overmeer. Licensed under the same terms as Perl itself. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Mail::Message::Head::Subset; |
10
|
11
|
|
|
11
|
|
77
|
use vars '$VERSION'; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
566
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.009'; |
12
|
|
|
|
|
|
|
|
13
|
11
|
|
|
11
|
|
60
|
use base 'Mail::Message::Head'; |
|
11
|
|
|
|
|
36
|
|
|
11
|
|
|
|
|
1069
|
|
14
|
|
|
|
|
|
|
|
15
|
11
|
|
|
11
|
|
76
|
use strict; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
286
|
|
16
|
11
|
|
|
11
|
|
59
|
use warnings; |
|
11
|
|
|
|
|
31
|
|
|
11
|
|
|
|
|
442
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use Object::Realize::Later |
19
|
11
|
|
|
|
|
72
|
becomes => 'Mail::Message::Head::Complete', |
20
|
|
|
|
|
|
|
realize => 'load', |
21
|
11
|
|
|
11
|
|
69
|
believe_caller => 1; |
|
11
|
|
|
|
|
22
|
|
22
|
|
|
|
|
|
|
|
23
|
11
|
|
|
11
|
|
11388
|
use Date::Parse qw(str2time); |
|
11
|
|
|
|
|
28667
|
|
|
11
|
|
|
|
|
5246
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub count($) |
27
|
0
|
|
|
0
|
1
|
|
{ my ($self, $name) = @_; |
28
|
0
|
0
|
|
|
|
|
my @values = $self->get($name) |
29
|
|
|
|
|
|
|
or return $self->load->count($name); |
30
|
0
|
|
|
|
|
|
scalar @values; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub get($;$) |
35
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
|
if(wantarray) |
38
|
0
|
|
|
|
|
|
{ my @values = $self->SUPER::get(@_); |
39
|
0
|
0
|
|
|
|
|
return @values if @values; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
else |
42
|
0
|
|
|
|
|
|
{ my $value = $self->SUPER::get(@_); |
43
|
0
|
0
|
|
|
|
|
return $value if defined $value; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$self->load->get(@_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
#------------------------------------------- |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub guessBodySize() |
53
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
my $cl = $self->SUPER::get('Content-Length'); |
56
|
0
|
0
|
0
|
|
|
|
return $1 if defined $cl && $cl =~ m/(\d+)/; |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
my $lines = $self->SUPER::get('Lines'); # 40 chars per lines |
59
|
0
|
0
|
0
|
|
|
|
return $1*40 if defined $lines && $lines =~ m/(\d+)/; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
undef; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
#------------------------------------------- |
65
|
|
|
|
|
|
|
# Be careful not to trigger loading: this is not the thoroughness |
66
|
|
|
|
|
|
|
# we want from this method. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub guessTimestamp() |
69
|
0
|
|
|
0
|
0
|
|
{ my $self = shift; |
70
|
0
|
0
|
|
|
|
|
return $self->{MMHS_timestamp} if $self->{MMHS_timestamp}; |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
my $stamp; |
73
|
0
|
0
|
|
|
|
|
if(my $date = $self->SUPER::get('date')) |
74
|
0
|
|
|
|
|
|
{ $stamp = str2time($date, 'GMT'); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
0
|
|
|
|
|
unless($stamp) |
78
|
0
|
|
|
|
|
|
{ foreach ($self->SUPER::get('received')) |
79
|
0
|
|
|
|
|
|
{ $stamp = str2time($_, 'GMT'); |
80
|
0
|
0
|
|
|
|
|
last if $stamp; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
$self->{MMHS_timestamp} = $stamp; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
#------------------------------------------- |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
0
|
1
|
|
sub load() { $_[0] = $_[0]->message->loadHead } |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
1; |