| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# |
|
2
|
|
|
|
|
|
|
# This file is part of App-Milter-Limit |
|
3
|
|
|
|
|
|
|
# |
|
4
|
|
|
|
|
|
|
# This software is copyright (c) 2010 by Michael Schout. |
|
5
|
|
|
|
|
|
|
# |
|
6
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
|
7
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
|
8
|
|
|
|
|
|
|
# |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
package App::Milter::Limit::Plugin; |
|
11
|
|
|
|
|
|
|
$App::Milter::Limit::Plugin::VERSION = '0.53'; |
|
12
|
|
|
|
|
|
|
# ABSTRACT: Milter Limit driver plugin base class |
|
13
|
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
1978
|
use strict; |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
106
|
|
|
15
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
100
|
|
|
16
|
4
|
|
|
4
|
|
18
|
use base 'Class::Singleton'; |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
322
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
4
|
|
|
4
|
|
30
|
use App::Milter::Limit::Config; |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
46
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _new_instance { |
|
21
|
4
|
|
|
4
|
|
54
|
my $class = shift; |
|
22
|
|
|
|
|
|
|
|
|
23
|
4
|
|
|
|
|
22
|
my $self = $class->SUPER::_new_instance(@_); |
|
24
|
|
|
|
|
|
|
|
|
25
|
4
|
|
|
|
|
48
|
$self->init(@_); |
|
26
|
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
14
|
return $self; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub config_get { |
|
32
|
0
|
|
|
0
|
1
|
|
my ($self, $section, $name) = @_; |
|
33
|
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
my $conf = $section eq 'global' |
|
35
|
|
|
|
|
|
|
? App::Milter::Limit::Config->global |
|
36
|
|
|
|
|
|
|
: App::Milter::Limit::Config->section($section); |
|
37
|
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return $$conf{$name}; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub config_defaults { |
|
43
|
0
|
|
|
0
|
1
|
|
my ($self, $section, %defaults) = @_; |
|
44
|
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
App::Milter::Limit::Config->set_defaults($section, %defaults); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub init { |
|
50
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
51
|
0
|
|
|
|
|
|
die ref($self)." does not implement init()\n"; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub query { |
|
56
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
57
|
0
|
|
|
|
|
|
die ref($self)." does not implement query()\n"; |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |