Saftpresse/Plugin/Postfix/Smtp.pm

filter: Statementstmt 38.4% 5 / 13 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 0.0% 0 / 1 totaltotal 27.2% 6 / 22 SCAR 23.4
CC
4
Cov
26%
process_smtp
20.0
BEGIN
1.0
CRAP 10.4
« Saftpresse/Plugin/GeoIP.pm ↑ Summary Saftpresse/Notes.pm »
1 package Log::Saftpresse::Plugin::Postfix::Smtp;
2  
3 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: plugin to gather postfix smtp client statistics
6 1 our $VERSION = '1.5'; # VERSION
7  
8 sub process_smtp {
9 0 ▶ my ( $self, $stash ) = @_;
Subroutine process_smtp: not called CC=4 SCAR=30.0
Pod undocumented
10 0 my $service = $stash->{'service'};
11 0 ▶ if( $service ne 'smtp' ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
if ($service ne "smtp") 0 0 0
12  
13 # Was an IPv6 problem here
14 0 ▶ if($stash->{'message'} =~ /^connect to (\S+?): ([^;]+); address \S+ port.*$/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($stash->{'message'} =~ /^connect to (\S+?): ([^;]+); address \S+ port.*$/) { } 0 0 0
elsif ($stash->{'message'} =~ /^connect to ([^[]+)\[\S+?\]: (.+?) \(port \d+\)$/) { } 0 0 0
15 0 $self->incr_host_one( $stash, 'messages', lc($2), $1);
16 } elsif($stash->{'message'} =~ /^connect to ([^[]+)\[\S+?\]: (.+?) \(port \d+\)$/) {
17 0 $self->incr_host_one( $stash, 'messages', lc($2), $1);
18 }
19  
20 # TODO: is it possible to count connections?
21 #$self->incr_host_one( $stash, 'connections');
22  
23 0 return;
24 }
25  
26 1 1;
27  
28 __END__
29  
30 =pod
31  
32 =encoding UTF-8
33  
34 =head1 NAME
35  
36 Log::Saftpresse::Plugin::Postfix::Smtp - plugin to gather postfix smtp client statistics
37  
38 =head1 VERSION
39  
40 version 1.5
41  
42 =head1 AUTHOR
43  
44 Markus Benning <ich@markusbenning.de>
45  
46 =head1 COPYRIGHT AND LICENSE
47  
48 This software is Copyright (c) 1998 by James S. Seymour, 2015 by Markus Benning.
49  
50 This is free software, licensed under:
51  
52 The GNU General Public License, Version 2, June 1991
53  
54 =cut
« Saftpresse/Plugin/GeoIP.pm ↑ Summary Saftpresse/Notes.pm »