line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
2245
|
use strict; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
147
|
|
2
|
|
|
|
|
|
|
package Email::Abstract::MIMEEntity; |
3
|
|
|
|
|
|
|
# ABSTRACT: Email::Abstract wrapper for MIME::Entity |
4
|
|
|
|
|
|
|
$Email::Abstract::MIMEEntity::VERSION = '3.010'; |
5
|
3
|
|
|
3
|
|
17
|
use Email::Abstract::Plugin; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
104
|
|
6
|
3
|
|
|
3
|
|
1189
|
BEGIN { @Email::Abstract::MIMEEntity::ISA = 'Email::Abstract::MailInternet' }; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $is_avail; |
9
|
|
|
|
|
|
|
sub is_available { |
10
|
4
|
100
|
|
4
|
1
|
701
|
return $is_avail if defined $is_avail; |
11
|
3
|
|
|
|
|
6
|
eval { require MIME::Entity; MIME::Entity->VERSION(5.508); 1 }; |
|
3
|
|
|
|
|
523
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
12
|
3
|
50
|
|
|
|
27
|
return $is_avail = $@ ? 0 : 1; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
0
|
|
sub target { "MIME::Entity" } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub construct { |
18
|
0
|
|
|
0
|
0
|
|
require MIME::Parser; |
19
|
0
|
|
|
|
|
|
my $parser = MIME::Parser->new; |
20
|
0
|
|
|
|
|
|
$parser->output_to_core(1); |
21
|
0
|
|
|
|
|
|
my ($class, $rfc822) = @_; |
22
|
0
|
|
|
|
|
|
$parser->parse_data($rfc822); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub get_body { |
26
|
0
|
|
|
0
|
0
|
|
my ($self, $obj) = @_; |
27
|
0
|
|
|
|
|
|
my $handle = $obj->bodyhandle; |
28
|
0
|
0
|
|
|
|
|
return $handle ? $handle->as_string : join('', @{ $obj->body }); |
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub set_body { |
32
|
0
|
|
|
0
|
0
|
|
my ($class, $obj, $body) = @_; |
33
|
0
|
|
|
|
|
|
my @lines = split /\n/, $body; |
34
|
0
|
|
|
|
|
|
my $io = $obj->bodyhandle->open("w"); |
35
|
0
|
|
|
|
|
|
foreach (@lines) { $io->print($_."\n") } |
|
0
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$io->close; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
42
|
|
|
|
|
|
|
#pod |
43
|
|
|
|
|
|
|
#pod This module wraps the MIME::Entity mail handling library with an |
44
|
|
|
|
|
|
|
#pod abstract interface, to be used with L |
45
|
|
|
|
|
|
|
#pod |
46
|
|
|
|
|
|
|
#pod =head1 SEE ALSO |
47
|
|
|
|
|
|
|
#pod |
48
|
|
|
|
|
|
|
#pod L, L. |
49
|
|
|
|
|
|
|
#pod |
50
|
|
|
|
|
|
|
#pod =cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |