File Coverage

blib/lib/Log/Saftpresse/Plugin/PostfixGeoStats.pm
Criterion Covered Total %
statement 3 13 23.0
branch 0 4 0.0
condition 0 9 0.0
subroutine 1 2 50.0
pod 1 1 100.0
total 5 29 17.2


line stmt bran cond sub pod time code
1             package Log::Saftpresse::Plugin::PostfixGeoStats;
2              
3 1     1   2775 use Moose;
  1         2  
  1         8  
4              
5             # ABSTRACT: plugin to build postfix statistics from geoip info
6             our $VERSION = '1.6'; # VERSION
7              
8             extends 'Log::Saftpresse::Plugin';
9             with 'Log::Saftpresse::Plugin::Role::CounterUtils';
10              
11             sub process {
12 0     0 1   my ( $self, $stash ) = @_;
13 0           my $cc = $stash->{'geoip_cc'};;
14 0           my $service = $stash->{'service'};
15 0           my $message = $stash->{'message'};
16 0           my $program = $stash->{'program'};
17              
18 0 0 0       if( ! defined $program || $program !~ /^postfix\// ) {
19 0           return;
20             }
21 0 0 0       if( defined $cc && $stash->{'service'} eq 'smtpd' &&
      0        
22             $message =~ /client=/ ) {
23 0           $self->incr_host_one( $stash, 'client', $cc);
24             }
25              
26 0           return;
27             }
28              
29             1;
30              
31             __END__
32              
33             =pod
34              
35             =encoding UTF-8
36              
37             =head1 NAME
38              
39             Log::Saftpresse::Plugin::PostfixGeoStats - plugin to build postfix statistics from geoip info
40              
41             =head1 VERSION
42              
43             version 1.6
44              
45             =head1 AUTHOR
46              
47             Markus Benning <ich@markusbenning.de>
48              
49             =head1 COPYRIGHT AND LICENSE
50              
51             This software is Copyright (c) 1998 by James S. Seymour, 2015 by Markus Benning.
52              
53             This is free software, licensed under:
54              
55             The GNU General Public License, Version 2, June 1991
56              
57             =cut