| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# This code is part of Perl distribution Mail-Box version 4.01. |
|
2
|
|
|
|
|
|
|
# The POD got stripped from this file by OODoc version 3.05. |
|
3
|
|
|
|
|
|
|
# For contributors see file ChangeLog. |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# This software is copyright (c) 2001-2025 by Mark Overmeer. |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
|
8
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
|
9
|
|
|
|
|
|
|
# SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Mail::Message::Head::Subset;{ |
|
13
|
|
|
|
|
|
|
our $VERSION = '4.01'; |
|
14
|
|
|
|
|
|
|
} |
|
15
|
|
|
|
|
|
|
|
|
16
|
11
|
|
|
11
|
|
75
|
use parent 'Mail::Message::Head'; |
|
|
11
|
|
|
|
|
31
|
|
|
|
11
|
|
|
|
|
97
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
11
|
|
|
11
|
|
950
|
use strict; |
|
|
11
|
|
|
|
|
25
|
|
|
|
11
|
|
|
|
|
300
|
|
|
19
|
11
|
|
|
11
|
|
55
|
use warnings; |
|
|
11
|
|
|
|
|
33
|
|
|
|
11
|
|
|
|
|
806
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
11
|
|
|
11
|
|
78
|
use Log::Report 'mail-box', import => [ qw// ]; |
|
|
11
|
|
|
|
|
36
|
|
|
|
11
|
|
|
|
|
101
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use Object::Realize::Later |
|
24
|
11
|
|
|
|
|
101
|
becomes => 'Mail::Message::Head::Complete', |
|
25
|
|
|
|
|
|
|
realize => 'load', |
|
26
|
11
|
|
|
11
|
|
2012
|
believe_caller => 1; |
|
|
11
|
|
|
|
|
43
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
11
|
|
|
11
|
|
9408
|
use Date::Parse qw/str2time/; |
|
|
11
|
|
|
|
|
26
|
|
|
|
11
|
|
|
|
|
6976
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#-------------------- |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub count($) |
|
33
|
0
|
|
|
0
|
1
|
|
{ my ($self, $name) = @_; |
|
34
|
0
|
0
|
|
|
|
|
my @values = $self->get($name) |
|
35
|
|
|
|
|
|
|
or return $self->load->count($name); |
|
36
|
0
|
|
|
|
|
|
scalar @values; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub get($;$) |
|
41
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
|
42
|
|
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
|
if(wantarray) |
|
44
|
0
|
|
|
|
|
|
{ my @values = $self->SUPER::get(@_); |
|
45
|
0
|
0
|
|
|
|
|
return @values if @values; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
else |
|
48
|
0
|
|
|
|
|
|
{ my $value = $self->SUPER::get(@_); |
|
49
|
0
|
0
|
|
|
|
|
return $value if defined $value; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
$self->load->get(@_); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
#-------------------- |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub guessBodySize() |
|
59
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
|
60
|
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $cl = $self->SUPER::get('Content-Length'); |
|
62
|
0
|
0
|
0
|
|
|
|
return $1 if defined $cl && $cl =~ m/(\d+)/; |
|
63
|
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my $lines = $self->SUPER::get('Lines'); # 40 chars per lines |
|
65
|
0
|
0
|
0
|
|
|
|
defined $lines && $lines =~ m/(\d+)/ ? $1 * 40 : undef |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Be careful not to trigger loading: this is not the thoroughness |
|
69
|
|
|
|
|
|
|
# we want from this method. |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub guessTimestamp() |
|
72
|
0
|
|
|
0
|
0
|
|
{ my $self = shift; |
|
73
|
0
|
0
|
|
|
|
|
return $self->{MMHS_timestamp} if $self->{MMHS_timestamp}; |
|
74
|
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
my $stamp; |
|
76
|
0
|
0
|
|
|
|
|
if(my $date = $self->SUPER::get('date')) |
|
77
|
0
|
|
|
|
|
|
{ $stamp = str2time($date, 'GMT'); |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
|
|
80
|
0
|
0
|
|
|
|
|
unless($stamp) |
|
81
|
0
|
|
|
|
|
|
{ foreach my $time ($self->SUPER::get('received')) |
|
82
|
0
|
|
|
|
|
|
{ $stamp = str2time($time, 'GMT'); |
|
83
|
0
|
0
|
|
|
|
|
last if $stamp; |
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
$self->{MMHS_timestamp} = $stamp; |
|
88
|
|
|
|
|
|
|
} |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
#-------------------- |
|
91
|
|
|
|
|
|
|
|
|
92
|
0
|
|
|
0
|
1
|
|
sub load() { $_[0] = $_[0]->message->loadHead } |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |