line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::Lite::Processor::Filter; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Mail::Lite::Constants; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
106
|
|
7
|
1
|
|
|
1
|
|
6
|
use Smart::Comments -ENV; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
378
|
use Clone qw/clone/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
274
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub process { |
12
|
201
|
|
|
201
|
0
|
389
|
my $args_ref = shift; |
13
|
|
|
|
|
|
|
|
14
|
201
|
|
|
|
|
355
|
my $message = $args_ref->{input }; |
15
|
201
|
|
|
|
|
310
|
my $processor_args = $args_ref->{processor }; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#@$input == 1 or die "incorrect parameters for filter"; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#my $message = $params->[0]; |
20
|
|
|
|
|
|
|
|
21
|
201
|
50
|
|
|
|
318
|
eval { $message->can('body') } or die "incorrect message"; |
|
201
|
|
|
|
|
1056
|
|
22
|
|
|
|
|
|
|
|
23
|
201
|
|
|
|
|
13410
|
$message = clone( $message ); |
24
|
201
|
|
|
|
|
1215
|
my $mbody = $message->body; |
25
|
|
|
|
|
|
|
|
26
|
201
|
|
|
|
|
303
|
foreach my $filter ( @{ $processor_args->{filters} } ) { |
|
201
|
|
|
|
|
535
|
|
27
|
253
|
100
|
|
|
|
581
|
if ( ref $filter eq 'ARRAY' ) { |
28
|
42
|
|
|
|
|
951
|
$mbody =~ s/$filter->[0]/$filter->[1]/g; |
29
|
|
|
|
|
|
|
} else { |
30
|
211
|
|
|
|
|
135241
|
$mbody =~ s/$filter//g; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
201
|
|
|
|
|
953
|
$message->{body} = $mbody; |
35
|
|
|
|
|
|
|
|
36
|
201
|
|
|
|
|
302
|
${ $args_ref->{ output } } = $message; |
|
201
|
|
|
|
|
508
|
|
37
|
|
|
|
|
|
|
|
38
|
201
|
|
|
|
|
1702
|
return OK; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |