| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
370
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
22
|
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
37
|
|
|
3
|
|
|
|
|
|
|
package Exception::Reporter::Summarizer::Email; |
|
4
|
|
|
|
|
|
|
# ABSTRACT: a summarizer for Email::Simple objects |
|
5
|
|
|
|
|
|
|
$Exception::Reporter::Summarizer::Email::VERSION = '0.013'; |
|
6
|
1
|
|
|
1
|
|
3
|
use parent 'Exception::Reporter::Summarizer'; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
6
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#pod =head1 OVERVIEW |
|
9
|
|
|
|
|
|
|
#pod |
|
10
|
|
|
|
|
|
|
#pod This summarizer will only summarize Email::Simple (or subclass) objects. The |
|
11
|
|
|
|
|
|
|
#pod emails will be summarized as C data containing the |
|
12
|
|
|
|
|
|
|
#pod stringification of the message. |
|
13
|
|
|
|
|
|
|
#pod |
|
14
|
|
|
|
|
|
|
#pod =cut |
|
15
|
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
30
|
use Try::Tiny; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
127
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub can_summarize { |
|
19
|
14
|
|
|
14
|
0
|
13
|
my ($self, $entry) = @_; |
|
20
|
14
|
|
|
14
|
|
58
|
return try { $entry->[1]->isa('Email::Simple') }; |
|
|
14
|
|
|
|
|
203
|
|
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub summarize { |
|
24
|
2
|
|
|
2
|
0
|
3
|
my ($self, $entry) = @_; |
|
25
|
2
|
|
|
|
|
3
|
my ($name, $value, $arg) = @$entry; |
|
26
|
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
6
|
my $fn_base = $self->sanitize_filename($name); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
return { |
|
30
|
2
|
|
|
|
|
11
|
filename => "$fn_base.msg", |
|
31
|
|
|
|
|
|
|
mimetype => 'message/rfc822', |
|
32
|
|
|
|
|
|
|
ident => "email message for $fn_base", |
|
33
|
|
|
|
|
|
|
body => $value->as_string, |
|
34
|
|
|
|
|
|
|
body_is_bytes => 1, |
|
35
|
|
|
|
|
|
|
}; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |