line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::MtPolicyd::VirtualHost; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
451
|
use Moose; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
18
|
|
4
|
3
|
|
|
3
|
|
12431
|
use namespace::autoclean; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
23
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.01'; # VERSION |
7
|
|
|
|
|
|
|
# ABSTRACT: class for a VirtualHost instance |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
1207
|
use Mail::MtPolicyd::PluginChain; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
568
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has 'port' => ( is => 'ro', isa => 'Str', required => 1 ); |
12
|
|
|
|
|
|
|
has 'name' => ( is => 'ro', isa => 'Str', required => 1 ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'chain' => ( |
15
|
|
|
|
|
|
|
is => 'ro', |
16
|
|
|
|
|
|
|
isa => 'Mail::MtPolicyd::PluginChain', |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
handles => [ 'run' ], |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new_from_config { |
22
|
1
|
|
|
1
|
0
|
1387
|
my ( $class, $port, $config ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
1
|
50
|
|
|
|
5
|
if( ! defined $config->{'Plugin'} ) { |
25
|
0
|
|
|
|
|
0
|
die('no <Plugin> defined for <VirtualHost> on port '.$port.'!'); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
my $vhost = $class->new( |
28
|
|
|
|
|
|
|
'port' => $port, |
29
|
|
|
|
|
|
|
'name' => $config->{'name'}, |
30
|
|
|
|
|
|
|
'chain' => Mail::MtPolicyd::PluginChain->new_from_config( |
31
|
|
|
|
|
|
|
$config->{'name'}, |
32
|
1
|
|
|
|
|
9
|
$config->{'Plugin'} |
33
|
|
|
|
|
|
|
), |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
7
|
return $vhost; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub cron { |
40
|
2
|
|
|
2
|
0
|
3
|
my $self = shift; |
41
|
2
|
|
|
|
|
67
|
return $self->chain->cron(@_); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=encoding UTF-8 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Mail::MtPolicyd::VirtualHost - class for a VirtualHost instance |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 VERSION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
version 2.01 |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Markus Benning <ich@markusbenning.de> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This software is Copyright (c) 2014 by Markus Benning <ich@markusbenning.de>. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This is free software, licensed under: |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The GNU General Public License, Version 2, June 1991 |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |