line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Plugin::MessageRFC822; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
26079
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
150
|
|
4
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
141
|
|
5
|
4
|
|
|
4
|
|
22
|
use vars qw($VERSION); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
253
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
945
|
use parent qw(MIME::Expander::Plugin); |
|
4
|
|
|
|
|
307
|
|
|
4
|
|
|
|
|
36
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( |
10
|
|
|
|
|
|
|
message/rfc822 |
11
|
|
|
|
|
|
|
)]); |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
339
|
use Email::MIME; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
764
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub expand { |
16
|
4
|
|
|
4
|
0
|
12
|
my $self = shift; |
17
|
4
|
|
|
|
|
9
|
my $contents = shift; |
18
|
4
|
|
|
|
|
8
|
my $callback = shift; |
19
|
4
|
|
|
|
|
9
|
my $c = 0; |
20
|
|
|
|
|
|
|
|
21
|
4
|
50
|
|
|
|
78
|
my @parts = (Email::MIME->new( |
22
|
|
|
|
|
|
|
ref $contents eq 'SCALAR' ? $contents : \$contents |
23
|
|
|
|
|
|
|
)); |
24
|
4
|
|
|
|
|
9299
|
while( my $part = shift @parts ){ |
25
|
18
|
100
|
|
|
|
10111
|
if( 1 < $part->parts ){ |
26
|
4
|
|
|
|
|
83
|
push @parts, $part->subparts; |
27
|
|
|
|
|
|
|
}else{ |
28
|
14
|
|
|
|
|
138
|
++$c; |
29
|
14
|
50
|
|
|
|
78
|
$callback->( \$part->body, { |
30
|
|
|
|
|
|
|
filename => $part->filename, |
31
|
|
|
|
|
|
|
} ) if( ref $callback eq 'CODE' ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
4
|
|
|
|
|
5322
|
return $c; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
__END__ |