| 1 | package Log::Saftpresse::Plugin::PostfixGeoStats; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | # ABSTRACT: plugin to build postfix statistics from geoip info | ||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | our $VERSION = '1.5'; # VERSION | |||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | extends 'Log::Saftpresse::Plugin'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | with 'Log::Saftpresse::Plugin::Role::CounterUtils'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | sub process { | ||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | my ( $self, $stash ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 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 | ▶ | if( ! defined $program || $program !~ /^postfix\// ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $program and $program =~ m[^postfix/]
MC/DC0%0/2
defined $program and $program =~ m[^postfix/]
defined $program
$program =~ m[^postfix/]
Truth table0%0/3
A and B
A= defined $programB= $program =~ m[^postfix/]
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if( defined $cc && $stash->{'service'} eq 'smtpd' && | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $cc and $stash->{"service"} eq "smtpd" and $message =~ /client=/
defined $cc and $stash->{"service"} eq "smtpd"
MC/DC0%0/3
defined $cc and $stash->{"service"} eq "smtpd" and $message =~ /client=/
defined $cc
$stash->{"service"} eq "smtpd"
$message =~ /client=/
Truth table0%0/4
A and B and C
A= defined $ccB= $stash->{"service"} eq "smtpd"C= $message =~ /client=/
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | $message =~ /client=/ ) { | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | $self->incr_host_one( $stash, 'client', $cc); | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | 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.5 | ||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||