| 1 | package Log::Saftpresse::Plugin::Postfix::Messages; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | # ABSTRACT: plugin to gather postfix warning|fatal|panic messages | ||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | our $VERSION = '1.5'; # VERSION | |||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Log::Saftpresse::Plugin::Postfix::Utils qw( string_trimmer ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | requires 'message_detail'; | |||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | requires 'smtpd_warn_detail'; | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | sub process_messages { | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 0 | ▶ | my ( $self, $stash ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process_messages: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | my $service = $stash->{'service'}; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | my $message_detail = $self->message_detail; | |||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | my $smtpd_warn_detail = $self->smtpd_warn_detail; | |||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | if( $service eq 'master' ) { # gather all master messages | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | $self->incr_host_one( $stash, 'master', $stash->{'message'}); | |||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | if( my ($level, $msg) = $stash->{'message'} =~ /^(warning|fatal|panic): (.*)$/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | $msg = string_trimmer($msg, 66, $message_detail); | |||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | if( $level eq 'warning' && $service eq 'smtpd' && | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$level eq "warning" and $service eq "smtpd" and $smtpd_warn_detail == 0
$level eq "warning" and $service eq "smtpd"
MC/DC0%0/3
$level eq "warning" and $service eq "smtpd" and $smtpd_warn_detail == 0
$level eq "warning"
$service eq "smtpd"
$smtpd_warn_detail == 0
Truth table0%0/4
A and B and C
A= $level eq "warning"B= $service eq "smtpd"C= $smtpd_warn_detail == 0
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | $smtpd_warn_detail == 0 ) { | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | $self->incr_host_one( $stash, $level, $service, $msg); | |||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | $stash->{'postfix_level'} = $level; | |||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | =encoding UTF-8 | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | Log::Saftpresse::Plugin::Postfix::Messages - plugin to gather postfix warning|fatal|panic messages | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | version 1.5 | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | Markus Benning <ich@markusbenning.de> | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | This software is Copyright (c) 1998 by James S. Seymour, 2015 by Markus Benning. | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | This is free software, licensed under: | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | The GNU General Public License, Version 2, June 1991 | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | =cut | ||||||||||||||||||||||||||||||||||||||||||