summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-04-07 09:38:01 +0200
committerErich Eckner <git@eckner.net>2020-04-07 09:38:01 +0200
commit62dcef14edf09feb4cd0ed0250a3855901b9f9ac (patch)
treec082bf546847f441da1df40e5b12d0e9109c23c7
parentac9a8945284f9fd4e6a721c3010eedef01fd43fc (diff)
downloadlogwatch-overrides-62dcef14edf09feb4cd0ed0250a3855901b9f9ac.tar.xz
courier: recognize more zdkim stuff
-rw-r--r--courier13
1 files changed, 12 insertions, 1 deletions
diff --git a/courier b/courier
index 4870fea..82b8138 100644
--- a/courier
+++ b/courier
@@ -377,6 +377,7 @@ my $To;
my $User;
my $service;
my %zdkimResults;
+my %zdkimErrors;
while (defined($ThisLine = <STDIN>)) {
chomp $ThisLine;
@@ -577,6 +578,10 @@ while (defined($ThisLine = <STDIN>)) {
$result .= ", dkim: ".$dkimResult;
};
$zdkimResults{$domain}{substr $result, 2}++;
+ } elsif ( (my $domain, my $result) = ($ThisLine =~ /^zdkimfilter\[[0-9]+\]:id=\S+: (\S+) (pass only because \S+)$/ ) ) {
+ $zdkimResults{$domain}{$result}++;
+ } elsif ( (my $zdkimError) = ($ThisLine =~ /^zdkimfilter\[[0-9]+\]:(Cannot sign message: no authenticated sender, empty or disabled RELAYCLIENT, and no default_domain)$/ ) ) {
+ $zdkimErrors{$zdkimError}++;
} elsif (
( $ThisLine =~ /^Initialized the \S+ python filter$/ ) or
( $ThisLine =~ /^Debugging filter invoked:$/ ) or
@@ -753,6 +758,13 @@ if ( ( $Detail >= 0 ) and (keys %Failed) and (!$Tables)) {
print "$out\n";
}
+if ( ( $Detail >= 0 ) and (keys %zdkimErrors) and (!$Tables)) {
+ print "\nzdkim errors:\n";
+ foreach my $zdkimError (sort keys %zdkimErrors) {
+ print " ".$zdkimErrors{$zdkimError}." Time(s): ".$zdkimError."\n";
+ }
+}
+
if ( ( $Detail >= 5 ) and (keys %DeSu) and (!$Tables) ) {
my ($out, $nmb, $size) = recprint1 ( \%DeSu, 2, [ "From", "To" ], [0,0], 2, undef, \%DeSuSz);
@@ -766,7 +778,6 @@ if ( ( $Detail >= 5 ) and (keys %DeSuTbl) and ($Tables)) {
print $out;
}
-
if ( ( $Detail >= 5 ) and (keys %zdkimResults)) {
print "\nzdkim results:\n";
foreach my $domain (sort keys %zdkimResults) {