line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Saftpresse::Plugin::Postfix::Messages; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
838
|
use Moose::Role; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: plugin to gather postfix warning|fatal|panic messages |
6
|
|
|
|
|
|
|
our $VERSION = '1.5'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
3303
|
use Log::Saftpresse::Plugin::Postfix::Utils qw( string_trimmer ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
200
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires 'message_detail'; |
11
|
|
|
|
|
|
|
requires 'smtpd_warn_detail'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub process_messages { |
14
|
0
|
|
|
0
|
0
|
|
my ( $self, $stash ) = @_; |
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
|
0
|
|
|
|
|
if( $service eq 'master' ) { # gather all master messages |
20
|
0
|
|
|
|
|
|
$self->incr_host_one( $stash, 'master', $stash->{'message'}); |
21
|
0
|
|
|
|
|
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
if( my ($level, $msg) = $stash->{'message'} =~ /^(warning|fatal|panic): (.*)$/ ) { |
25
|
0
|
|
|
|
|
|
$msg = string_trimmer($msg, 66, $message_detail); |
26
|
0
|
0
|
0
|
|
|
|
if( $level eq 'warning' && $service eq 'smtpd' && |
|
|
|
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; |
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 |