line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Plugin::MessageRFC822; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
74923
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
138
|
|
4
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
147
|
|
5
|
4
|
|
|
4
|
|
20
|
use vars qw($VERSION); |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
203
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
19
|
use parent qw(MIME::Expander::Plugin); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
29
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( |
10
|
|
|
|
|
|
|
message/rfc822 |
11
|
|
|
|
|
|
|
multipart/mixed |
12
|
|
|
|
|
|
|
)]); |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
218
|
use Email::MIME; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
426
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub expand { |
17
|
4
|
|
|
4
|
0
|
734
|
my $self = shift; |
18
|
4
|
|
|
|
|
9
|
my $part = shift; |
19
|
4
|
|
|
|
|
20
|
my $callback = shift; |
20
|
4
|
|
|
|
|
7
|
my $c = 0; |
21
|
|
|
|
|
|
|
|
22
|
4
|
|
|
|
|
27
|
my @parts = ($part); |
23
|
4
|
|
|
|
|
24
|
while( my $part = shift @parts ){ |
24
|
21
|
100
|
|
|
|
9663
|
if( 1 < $part->parts ){ |
25
|
5
|
|
|
|
|
45
|
push @parts, $part->subparts; |
26
|
|
|
|
|
|
|
}else{ |
27
|
16
|
|
|
|
|
125
|
++$c; |
28
|
16
|
50
|
|
|
|
73
|
$callback->( \$part->body, { |
29
|
|
|
|
|
|
|
filename => $part->filename, |
30
|
|
|
|
|
|
|
} ) if( ref $callback eq 'CODE' ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
|
|
2807
|
return $c; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |