line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2019 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-IMAP4. 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::Box::IMAP4::Head; |
10
|
2
|
|
|
2
|
|
11
|
use vars '$VERSION'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
89
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.006'; |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
9
|
use base 'Mail::Message::Head'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
166
|
|
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
50
|
|
16
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
47
|
|
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
|
9
|
use Date::Parse; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
545
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init($$) |
22
|
0
|
|
|
0
|
0
|
|
{ my ($self, $args) = @_; |
23
|
0
|
|
|
|
|
|
$self->SUPER::init($args); |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
$self->{MBIH_c_fields} = $args->{cache_fields}; |
26
|
0
|
|
|
|
|
|
$self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub get($;$) |
31
|
0
|
|
|
0
|
1
|
|
{ my ($self, $name, $index) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
if(not $self->{MBIH_c_fields}) { ; } |
|
|
0
|
|
|
|
|
|
34
|
|
|
|
|
|
|
elsif(wantarray) |
35
|
0
|
|
|
|
|
|
{ my @values = $self->SUPER::get(@_); |
36
|
0
|
0
|
|
|
|
|
return @values if @values; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
else |
39
|
0
|
|
|
|
|
|
{ my $value = $self->SUPER::get(@_); |
40
|
0
|
0
|
|
|
|
|
return $value if defined $value; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Something here, playing with ENVELOPE, may improve the performance |
44
|
|
|
|
|
|
|
# as well. |
45
|
0
|
|
|
|
|
|
my $imap = $self->message->folder->transporter; |
46
|
0
|
|
|
|
|
|
my $uidl = $self->message->unique; |
47
|
0
|
|
|
|
|
|
my @fields = $imap->getFields($uidl, $name); |
48
|
|
|
|
|
|
|
|
49
|
0
|
0
|
0
|
|
|
|
if(@fields && $self->{MBIH_c_fields}) |
50
|
0
|
|
|
|
|
|
{ $self->addNoRealize($_) for @fields |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
|
defined $index ? $fields[$index] |
|
|
0
|
|
|
|
|
|
54
|
|
|
|
|
|
|
: wantarray ? @fields |
55
|
|
|
|
|
|
|
: $fields[0]; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub guessBodySize() {undef} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub guessTimestamp() {undef} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
#------------------------------------------ |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |