line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::ListDetector::Detector::Smartlist; |
2
|
|
|
|
|
|
|
|
3
|
39
|
|
|
39
|
|
472
|
use strict; |
|
39
|
|
|
|
|
221
|
|
|
39
|
|
|
|
|
1623
|
|
4
|
39
|
|
|
39
|
|
217
|
use warnings; |
|
39
|
|
|
|
|
66
|
|
|
39
|
|
|
|
|
1649
|
|
5
|
|
|
|
|
|
|
|
6
|
39
|
|
|
39
|
|
204
|
use base qw(Mail::ListDetector::Detector::Base); |
|
39
|
|
|
|
|
68
|
|
|
39
|
|
|
|
|
3459
|
|
7
|
39
|
|
|
39
|
|
254
|
use Mail::ListDetector::List; |
|
39
|
|
|
|
|
76
|
|
|
39
|
|
|
|
|
1038
|
|
8
|
39
|
|
|
39
|
|
238
|
use Carp; |
|
39
|
|
|
|
|
138
|
|
|
39
|
|
|
|
|
5703
|
|
9
|
|
|
|
|
|
|
|
10
|
41
|
|
|
41
|
0
|
168
|
sub DEBUG { 0 } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub match { |
13
|
41
|
|
|
41
|
1
|
96
|
my $self = shift; |
14
|
41
|
|
|
|
|
109
|
my $message = shift; |
15
|
41
|
50
|
|
|
|
189
|
print "Got message $message\n" if DEBUG; |
16
|
41
|
50
|
|
|
|
169
|
carp ("Mail::ListDetector::Detector::Smartlist - no message supplied") unless defined($message); |
17
|
39
|
|
|
39
|
|
241
|
use Email::Abstract; |
|
39
|
|
|
|
|
78
|
|
|
39
|
|
|
|
|
9734
|
|
18
|
41
|
|
|
|
|
205
|
my $mailing_list = Email::Abstract->get_header($message, 'X-Mailing-List'); |
19
|
41
|
100
|
|
|
|
3518
|
return undef unless defined $mailing_list; |
20
|
1
|
|
|
|
|
2
|
chomp $mailing_list; |
21
|
1
|
|
|
|
|
7
|
my ($posting_address) = ( $mailing_list =~ /^\<(\S+?)\> archive\/latest\/\d+/ ); |
22
|
1
|
50
|
|
|
|
5
|
return undef unless defined $posting_address; |
23
|
1
|
50
|
|
|
|
5
|
return undef unless grep(/^$posting_address\s?$/, Email::Abstract->get_header($message, 'X-Loop')); |
24
|
1
|
|
|
|
|
103
|
my $list = new Mail::ListDetector::List; |
25
|
1
|
|
|
|
|
5
|
$list->listsoftware('smartlist'); |
26
|
1
|
|
|
|
|
6
|
$list->posting_address($posting_address); |
27
|
1
|
|
|
|
|
6
|
my ($listname) = ($posting_address =~ /^([^@]+)@/); |
28
|
1
|
|
|
|
|
4
|
$list->listname($listname); |
29
|
1
|
|
|
|
|
4
|
return $list; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |