From d653037ca4a65c7dca3f296c8c0b8908309cbe71 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 6 Aug 2021 10:11:20 -0400 Subject: [PATCH] amavis-logwatch: support forthcoming amavis-2.12.0 "starting" format. When amavis-2.12.0 starts or reloads, it outputs its name as "amavis" instead of the "amavisd-new" that previous versions used. This commit adds support for the name "amavis". It also allows the "starting" line to contain "(warm)", with the "(warm)" being ignored so that the name of the amavis daemon is captured properly. This fixes missed lines of the form, Aug 6 00:00:54 mx1 amavis[10199]: starting. (warm) /usr/sbin/amavisd at mx1.example.com amavis-2.12.0 (20190725), Unicode aware, LANG="C.utf8" which is very likely to be the final format used by amavis-2.12.0. --- amavis-logwatch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/amavis-logwatch b/amavis-logwatch index 912839e..ca3e0aa 100644 --- a/amavis-logwatch +++ b/amavis-logwatch @@ -3194,9 +3194,10 @@ while (<>) { $StartInfo{'Code'}{'Not found'}{$code} = $location; - } elsif ( $p1 =~ /^starting\.\s+(.+) at \S+ (?:amavisd-new-|Maia Mailguard )([^,]+),/) { + } elsif ( $p1 =~ /^starting\.(?: \(warm\))?\s+(.+) at \S+ (?:amavis-|amavisd-new-|Maia Mailguard )([^,]+),/) { #TD starting. /usr/local/sbin/amavisd at mailhost.example.com amavisd-new-2.5.0 (20070423), Unicode aware, LANG="C" #TD starting. /usr/sbin/amavisd-maia at vwsw02.eon.no Maia Mailguard 1.0.2, Unicode aware, LANG=en_US.UTF-8 + #TD starting. (warm) /usr/sbin/amavisd at mx1.example.com amavis-2.12.0 (20190725), Unicode aware, LANG="C.utf8" next unless ($Opts{'startinfo'}); %StartInfo = () if !exists $StartInfo{'Logging'}; $StartInfo{'ampath'} = $1; -- 2.44.2