line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::ListDetector::Detector::Lyris; |
2
|
|
|
|
|
|
|
|
3
|
39
|
|
|
39
|
|
225
|
use strict; |
|
39
|
|
|
|
|
82
|
|
|
39
|
|
|
|
|
1348
|
|
4
|
39
|
|
|
39
|
|
213
|
use warnings; |
|
39
|
|
|
|
|
79
|
|
|
39
|
|
|
|
|
1247
|
|
5
|
|
|
|
|
|
|
|
6
|
39
|
|
|
39
|
|
202
|
use vars qw($VERSION); |
|
39
|
|
|
|
|
88
|
|
|
39
|
|
|
|
|
1865
|
|
7
|
|
|
|
|
|
|
$VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
39
|
|
|
39
|
|
204
|
use base qw(Mail::ListDetector::Detector::Base); |
|
39
|
|
|
|
|
76
|
|
|
39
|
|
|
|
|
3071
|
|
10
|
39
|
|
|
39
|
|
239
|
use Mail::ListDetector::List; |
|
39
|
|
|
|
|
93
|
|
|
39
|
|
|
|
|
884
|
|
11
|
39
|
|
|
39
|
|
213
|
use Mail::ListDetector::Detector::RFC2369; |
|
39
|
|
|
|
|
120
|
|
|
39
|
|
|
|
|
1022
|
|
12
|
39
|
|
|
39
|
|
195
|
use Carp; |
|
39
|
|
|
|
|
79
|
|
|
39
|
|
|
|
|
13789
|
|
13
|
|
|
|
|
|
|
|
14
|
22
|
|
|
22
|
0
|
80
|
sub DEBUG { 0 } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub match { |
17
|
15
|
|
|
15
|
1
|
36
|
my $self = shift; |
18
|
15
|
|
|
|
|
34
|
my $message = shift; |
19
|
15
|
50
|
|
|
|
66
|
print "Got message $message\n" if DEBUG; |
20
|
15
|
50
|
|
|
|
59
|
carp ("Mail::ListDetector::Detector::Lyris - no message supplied") unless defined($message); |
21
|
39
|
|
|
39
|
|
279
|
use Email::Abstract; |
|
39
|
|
|
|
|
133
|
|
|
39
|
|
|
|
|
29921
|
|
22
|
|
|
|
|
|
|
|
23
|
15
|
|
|
|
|
79
|
my $x_listserver = Email::Abstract->get_header($message, 'X-Listserver'); |
24
|
15
|
|
|
|
|
1016
|
my $x_list_software = Email::Abstract->get_header($message, 'X-List-Software'); |
25
|
15
|
|
|
|
|
981
|
my $list_software = Email::Abstract->get_header($message, 'List-Software'); |
26
|
15
|
|
|
|
|
5664
|
my $x_lyris_message_id = Email::Abstract->get_header($message, 'X-Lyris-Message-Id'); |
27
|
15
|
|
|
|
|
1878
|
my $message_id = Email::Abstract->get_header($message, 'Message-Id'); |
28
|
15
|
|
|
|
|
1344
|
my $listsoftware; |
29
|
15
|
50
|
33
|
|
|
379
|
if (defined($x_listserver) && ($x_listserver =~ m/(Lyris v[\w\.]+)/)) { |
|
|
100
|
66
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
100
|
66
|
|
|
|
|
|
|
100
|
66
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
$listsoftware = $1; |
31
|
|
|
|
|
|
|
} elsif (defined($list_software) && ($list_software =~ m/Lyris Server version ([\w\.]+)/)) { |
32
|
3
|
|
|
|
|
9
|
$listsoftware = "Lyris $1"; |
33
|
|
|
|
|
|
|
} elsif (defined($x_list_software) && ($x_list_software =~ m/Lyris v([\w\.]+)/)) { |
34
|
0
|
|
|
|
|
0
|
$listsoftware = "Lyris $1"; |
35
|
|
|
|
|
|
|
} elsif (defined($x_lyris_message_id) && ($x_lyris_message_id =~ m/^
|
36
|
1
|
|
|
|
|
3
|
$listsoftware = "Lyris"; |
37
|
|
|
|
|
|
|
} elsif (defined($message_id) && ($message_id =~ m/^<(LYR|LISTMANAGER)/)) { |
38
|
3
|
|
|
|
|
8
|
$listsoftware = "Lyris"; |
39
|
|
|
|
|
|
|
} else { |
40
|
8
|
|
|
|
|
166
|
return undef; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
7
|
|
|
|
|
23
|
my ($listname, $posting_address); |
44
|
7
|
|
|
|
|
29
|
my $list_unsubscribe = Email::Abstract->get_header($message, 'List-Unsubscribe'); |
45
|
7
|
50
|
|
|
|
533
|
print $list_unsubscribe if DEBUG; |
46
|
7
|
50
|
|
|
|
39
|
if (defined($list_unsubscribe)) { |
47
|
7
|
100
|
|
|
|
91
|
if ($list_unsubscribe =~ m//) { |
|
|
50
|
|
|
|
|
|
48
|
5
|
|
|
|
|
20
|
$listname = $2; |
49
|
5
|
|
|
|
|
24
|
$posting_address = "$listname\@$3"; |
50
|
|
|
|
|
|
|
} elsif ($list_unsubscribe =~ m//) { |
51
|
2
|
|
|
|
|
6
|
$listname = $2; |
52
|
2
|
|
|
|
|
7
|
$posting_address = "$listname\@$3"; |
53
|
|
|
|
|
|
|
} else { |
54
|
0
|
|
|
|
|
0
|
return undef; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} else { |
57
|
0
|
|
|
|
|
0
|
return undef; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
7
|
|
|
|
|
65
|
my $list = new Mail::ListDetector::List; |
61
|
7
|
|
|
|
|
35
|
$list->listname($listname); |
62
|
7
|
|
|
|
|
29
|
$list->posting_address($posting_address); |
63
|
|
|
|
|
|
|
|
64
|
7
|
|
|
|
|
30
|
$list->listsoftware($listsoftware); |
65
|
7
|
|
|
|
|
34
|
return $list; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |