line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::ListDetector::Detector::Fml; |
2
|
|
|
|
|
|
|
|
3
|
39
|
|
|
39
|
|
216
|
use strict; |
|
39
|
|
|
|
|
75
|
|
|
39
|
|
|
|
|
1264
|
|
4
|
39
|
|
|
39
|
|
199
|
use warnings; |
|
39
|
|
|
|
|
75
|
|
|
39
|
|
|
|
|
1071
|
|
5
|
|
|
|
|
|
|
|
6
|
39
|
|
|
39
|
|
205
|
use vars qw($VERSION); |
|
39
|
|
|
|
|
78
|
|
|
39
|
|
|
|
|
1878
|
|
7
|
|
|
|
|
|
|
$VERSION = '0.04'; |
8
|
|
|
|
|
|
|
|
9
|
39
|
|
|
39
|
|
197
|
use base qw(Mail::ListDetector::Detector::Base); |
|
39
|
|
|
|
|
78
|
|
|
39
|
|
|
|
|
3383
|
|
10
|
39
|
|
|
39
|
|
234
|
use URI; |
|
39
|
|
|
|
|
90
|
|
|
39
|
|
|
|
|
860
|
|
11
|
39
|
|
|
39
|
|
216
|
use Email::Valid; |
|
39
|
|
|
|
|
85
|
|
|
39
|
|
|
|
|
1012
|
|
12
|
39
|
|
|
39
|
|
213
|
use Carp; |
|
39
|
|
|
|
|
89
|
|
|
39
|
|
|
|
|
26859
|
|
13
|
|
|
|
|
|
|
|
14
|
29
|
|
|
29
|
0
|
124
|
sub DEBUG { 0 } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub match { |
17
|
29
|
|
|
29
|
1
|
71
|
my($self, $message) = @_; |
18
|
29
|
50
|
|
|
|
115
|
print "Got message $message\n" if DEBUG; |
19
|
29
|
50
|
|
|
|
110
|
carp ("Mail::ListDetector::Detector::Fml - no message supplied") unless defined($message); |
20
|
29
|
100
|
|
|
|
140
|
my $mlserver = Email::Abstract->get_header($message, 'X-MLServer') or return; |
21
|
5
|
50
|
|
|
|
487
|
$mlserver =~ /^fml \[(fml [^\]]*)\]/ or return; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# OK, this is FML message |
24
|
5
|
|
|
|
|
30
|
my $list = Mail::ListDetector::List->new; |
25
|
5
|
|
|
|
|
22
|
$list->listsoftware($1); |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
6
|
my $post; |
28
|
5
|
100
|
|
|
|
17
|
if ($post = Email::Abstract->get_header($message, 'List-Post')) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
29
|
1
|
|
|
|
|
63
|
chomp($post); |
30
|
1
|
|
|
|
|
8
|
$post = URI->new($post)->to; |
31
|
|
|
|
|
|
|
} elsif ($post = Email::Abstract->get_header($message, 'List-Subscribe')) { |
32
|
1
|
|
|
|
|
140
|
chomp($post); |
33
|
1
|
|
|
|
|
9
|
$post = URI->new($post)->to; |
34
|
1
|
|
|
|
|
3966
|
$post =~ s/-ctl\@/\@/; |
35
|
|
|
|
|
|
|
} elsif ($post = Email::Abstract->get_header($message, 'X-ML-Info')) { |
36
|
1
|
|
|
|
|
194
|
chomp($post); |
37
|
1
|
|
|
|
|
3
|
$post =~ s/\n/ /; |
38
|
1
|
|
|
|
|
5
|
$post =~ m/(<.*>)/; |
39
|
1
|
|
|
|
|
3
|
$post = $1; |
40
|
1
|
|
|
|
|
7
|
$post = URI->new($post)->to; |
41
|
1
|
|
|
|
|
166
|
$post =~ s/-admin\@/\@/; |
42
|
|
|
|
|
|
|
} elsif ($post = Email::Abstract->get_header($message, 'Resent-To')) { |
43
|
2
|
|
|
|
|
488
|
chomp($post); |
44
|
2
|
|
|
|
|
12
|
$post =~ m/([\w\d\+\.\-]+@[\w\d\.\-]+)/; |
45
|
2
|
|
|
|
|
7
|
$post = $1; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
5
|
50
|
33
|
|
|
3918
|
if ($post && Email::Valid->address($post)) { |
49
|
5
|
|
|
|
|
5486
|
$list->posting_address($post); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
5
|
|
|
|
|
7
|
my $mlname; |
53
|
5
|
100
|
|
|
|
32
|
if ($mlname = Email::Abstract->get_header($message, 'X-ML-Name')) { |
|
|
50
|
|
|
|
|
|
54
|
4
|
|
|
|
|
423
|
chomp($mlname); |
55
|
4
|
|
|
|
|
15
|
$list->listname($mlname); |
56
|
|
|
|
|
|
|
} elsif ($mlname = $list->posting_address) { |
57
|
1
|
|
|
|
|
7
|
$mlname =~ s/\@.*$//; |
58
|
1
|
|
|
|
|
4
|
$list->listname($mlname); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
5
|
|
|
|
|
30
|
$list; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
__END__ |