line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::ListDetector::Detector::Listserv; |
2
|
|
|
|
|
|
|
|
3
|
39
|
|
|
39
|
|
541
|
use strict; |
|
39
|
|
|
|
|
83
|
|
|
39
|
|
|
|
|
1331
|
|
4
|
39
|
|
|
39
|
|
207
|
use warnings; |
|
39
|
|
|
|
|
79
|
|
|
39
|
|
|
|
|
1174
|
|
5
|
|
|
|
|
|
|
|
6
|
39
|
|
|
39
|
|
230
|
use vars qw($VERSION); |
|
39
|
|
|
|
|
69
|
|
|
39
|
|
|
|
|
2261
|
|
7
|
|
|
|
|
|
|
$VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
39
|
|
|
39
|
|
206
|
use base qw(Mail::ListDetector::Detector::Base); |
|
39
|
|
|
|
|
76
|
|
|
39
|
|
|
|
|
3315
|
|
10
|
39
|
|
|
39
|
|
225
|
use Mail::ListDetector::List; |
|
39
|
|
|
|
|
72
|
|
|
39
|
|
|
|
|
3917
|
|
11
|
|
|
|
|
|
|
|
12
|
5
|
|
|
5
|
0
|
21
|
sub DEBUG { 0 } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub match { |
15
|
5
|
|
|
5
|
1
|
12
|
my $self = shift; |
16
|
5
|
|
|
|
|
13
|
my $message = shift; |
17
|
5
|
50
|
|
|
|
39
|
print "Got message $message\n" if DEBUG; |
18
|
5
|
50
|
|
|
|
25
|
carp ("Mail::ListDetector::Detector::Listserv - no message supplied") unless defined($message); |
19
|
39
|
|
|
39
|
|
242
|
use Email::Abstract; |
|
39
|
|
|
|
|
87
|
|
|
39
|
|
|
|
|
11906
|
|
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
|
|
11
|
my ($posting_address, $list_name, $list_software); |
22
|
5
|
|
|
|
|
35
|
my @received = Email::Abstract->get_header($message, 'Received'); |
23
|
5
|
|
|
|
|
651
|
foreach my $received (@received) { |
24
|
|
|
|
|
|
|
# $received =~ s/\n/ /; |
25
|
13
|
100
|
|
|
|
67
|
if($received =~ m/\(LISTSERV-TCP\/IP\s+release\s+([^\s]+)\)/s) { |
26
|
3
|
|
|
|
|
14
|
$list_software = "LISTSERV-TCP/IP release $1"; |
27
|
3
|
|
|
|
|
16
|
my $sender = Email::Abstract->get_header($message, 'Sender'); |
28
|
3
|
50
|
|
|
|
249
|
if($sender =~ m/^(.*) <(.+)>$/) { |
29
|
3
|
|
|
|
|
9
|
$list_name = $1; |
30
|
3
|
|
|
|
|
10
|
$posting_address = $2; |
31
|
|
|
|
|
|
|
} |
32
|
3
|
|
|
|
|
9
|
last; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
5
|
100
|
|
|
|
32
|
unless (defined $list_software) { return undef; } |
|
2
|
|
|
|
|
36
|
|
37
|
|
|
|
|
|
|
|
38
|
3
|
|
|
|
|
29
|
my $list = new Mail::ListDetector::List; |
39
|
3
|
50
|
|
|
|
16
|
if(defined $list_name) { |
40
|
3
|
|
|
|
|
17
|
$list->listname($list_name); |
41
|
|
|
|
|
|
|
} else { |
42
|
0
|
|
|
|
|
0
|
$list->listname($posting_address); |
43
|
|
|
|
|
|
|
} |
44
|
3
|
|
|
|
|
15
|
$list->listsoftware($list_software); |
45
|
3
|
|
|
|
|
13
|
$list->posting_address($posting_address); |
46
|
|
|
|
|
|
|
|
47
|
3
|
|
|
|
|
19
|
return $list; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |