diff options
5 files changed, 173 insertions, 0 deletions
diff --git a/net-mail/amavis-logwatch/amavis-logwatch-1.51.03-r4.ebuild b/net-mail/amavis-logwatch/amavis-logwatch-1.51.03-r4.ebuild new file mode 100644 index 000000000000..db425aabba89 --- /dev/null +++ b/net-mail/amavis-logwatch/amavis-logwatch-1.51.03-r4.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="A log analyzer for amavisd-new" +HOMEPAGE="http://logreporters.sourceforge.net/" +SRC_URI="mirror://sourceforge/logreporters/${P}.tgz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND="dev-lang/perl" + +PATCHES=( + "${FILESDIR}/unescaped-left-brace.patch" + "${FILESDIR}/redundant-argument-to-sprintf.patch" + "${FILESDIR}/ignore-amavis-startup-notifications.patch" + "${FILESDIR}/ignore-utf8smtp-lines.patch" + "${FILESDIR}/unchecked-encrypted.patch" + "${FILESDIR}/file-libmagic-errors.patch" + "${FILESDIR}/ignore-all-sd_notify-lines.patch" + "${FILESDIR}/no-pid_file-configured.patch" + "${FILESDIR}/will-bind-to-lines.patch" + "${FILESDIR}/SANITIZED-NULL-bytes-messages.patch" +) + +src_prepare() { + default + # Replace the default config file location with ours. + local cfg_default='/usr/local/etc/${progname_prefix}-logwatch.conf' + local cfg_gentoo='/etc/${progname_prefix}-logwatch.conf'; + sed -i "s~${cfg_default}~${cfg_gentoo}~" ${PN} \ + || die 'failed to update the default config location' +} + +src_compile() { + # The default make target just outputs instructions. We don't want + # the user to see these, so we avoid the default emake. + : +} + +src_install() { + dodoc Bugs Changes README + doman ${PN}.1 + dobin ${PN} + insinto /etc + doins ${PN}.conf +} diff --git a/net-mail/amavis-logwatch/files/SANITIZED-NULL-bytes-messages.patch b/net-mail/amavis-logwatch/files/SANITIZED-NULL-bytes-messages.patch new file mode 100644 index 000000000000..0cc27f0bd226 --- /dev/null +++ b/net-mail/amavis-logwatch/files/SANITIZED-NULL-bytes-messages.patch @@ -0,0 +1,34 @@ +From 6d985d29d8be2b70ee7e4048a7ae95e2b4013f17 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Fri, 28 Dec 2018 10:01:56 -0500 +Subject: [PATCH 4/4] Ignore "SANITIZED ... NULL byte(s)" messages. + +Newer versions of the amavisd daemon sanitize NULL bytes within the +body of a message for the benefit of Cyrus IMAP. When it does this, +the number of bytes sanitized is logged. This is an informational +message only as far as I can tell, so it's been added to the list of +messages to ignore. +--- + amavis-logwatch | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/amavis-logwatch b/amavis-logwatch +index 250a6ba..044c94d 100644 +--- a/amavis-logwatch ++++ b/amavis-logwatch +@@ -2052,6 +2052,12 @@ sub create_ignore_list() { + # describe what is being sent to the systemd notification socket, + # if one exists. + push @ignore_list_final, qr/^sd_notify( \(no socket\))?:/; ++ ++ # In amavisd-new-2.11.0-rc1 and later, amavis will replace any null ++ # bytes that it finds in the body of a message with a "modified ++ # UTF-8" encoded null. The number of times it does this is then ++ # logged with the following message. ++ push @ignore_list_final, qr/^smtp forwarding: SANITIZED (\d+) NULL byte\(s\)/; + } + + # Notes: +-- +2.19.2 + diff --git a/net-mail/amavis-logwatch/files/ignore-all-sd_notify-lines.patch b/net-mail/amavis-logwatch/files/ignore-all-sd_notify-lines.patch new file mode 100644 index 000000000000..f3ce1d1091af --- /dev/null +++ b/net-mail/amavis-logwatch/files/ignore-all-sd_notify-lines.patch @@ -0,0 +1,33 @@ +From 653f988ba163c74f3ebdb6e53f57db9d8e569b1f Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Fri, 28 Dec 2018 09:23:52 -0500 +Subject: [PATCH 1/4] Ignore all "sd_notify" lines. + +Lines beginning with either "sd_notify:" or "sd_notify (no socket):" +contain information about what is being sent to the systemd +notification socket, if one exists. One such line was already being +ignored, but we don't want any of them. So, the existing +@ignore_list_final entry was expanded to encompass all such messages. +--- + amavis-logwatch | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/amavis-logwatch b/amavis-logwatch +index ac93cbc..ffb502b 100644 +--- a/amavis-logwatch ++++ b/amavis-logwatch +@@ -2047,7 +2047,10 @@ sub create_ignore_list() { + push @ignore_list_final, qr/\bRUSAGE\b/; + push @ignore_list_final, qr/: Sending .* to UNIX socket/; + +- push @ignore_list_final, qr/sd_notify \(no socket\): STATUS=Starting child process\(es\), ready for work./ ++ # Lines beginning with "sd_notify:" or "sd_notify (no socket):" ++ # describe what is being sent to the systemd notification socket, ++ # if one exists. ++ push @ignore_list_final, qr/^sd_notify( \(no socket\))?:/; + } + + # Notes: +-- +2.19.2 + diff --git a/net-mail/amavis-logwatch/files/no-pid_file-configured.patch b/net-mail/amavis-logwatch/files/no-pid_file-configured.patch new file mode 100644 index 000000000000..5f23955366e3 --- /dev/null +++ b/net-mail/amavis-logwatch/files/no-pid_file-configured.patch @@ -0,0 +1,27 @@ +From a93ee5d433308d2cac76ac9502e34c953ff96337 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Fri, 28 Dec 2018 09:33:07 -0500 +Subject: [PATCH 2/4] Ignore "no $pid_file configured, not checking it" lines. + +When no PID file is configured (for example, when amavisd is running +in the foreground), this message is logged. We already ignore the +other types of PID file notifications, so ignore this one too. +--- + amavis-logwatch | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/amavis-logwatch b/amavis-logwatch +index ffb502b..6d06793 100644 +--- a/amavis-logwatch ++++ b/amavis-logwatch +@@ -1958,6 +1958,7 @@ sub create_ignore_list() { + push @ignore_list_final, qr/^fish_out_ip_from_received: /; + push @ignore_list_final, qr/^Waiting for the process \S+ to terminate/; + push @ignore_list_final, qr/^Valid PID file \(younger than sys uptime/; ++ push @ignore_list_final, qr/^no \$pid_file configured, not checking it/; + push @ignore_list_final, qr/^Sending SIG\S+ to amavisd/; + push @ignore_list_final, qr/^Can't send SIG\S+ to process/; + push @ignore_list_final, qr/^killing process/; +-- +2.19.2 + diff --git a/net-mail/amavis-logwatch/files/will-bind-to-lines.patch b/net-mail/amavis-logwatch/files/will-bind-to-lines.patch new file mode 100644 index 000000000000..464a85b1c56d --- /dev/null +++ b/net-mail/amavis-logwatch/files/will-bind-to-lines.patch @@ -0,0 +1,29 @@ +From e53948a6909e98b63c63c97749c7d0eb534fa274 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Fri, 28 Dec 2018 09:40:36 -0500 +Subject: [PATCH 3/4] Ignore "will bind to" lines in addition to "bind to" + lines. + +In amavisd-new-2.11.0-rc1, the informational "bind to..." messages +were changed to say "will bind to..." instead. This commit updates the +@ignore_list_final regular expression to match both forms. +--- + amavis-logwatch | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/amavis-logwatch b/amavis-logwatch +index 6d06793..250a6ba 100644 +--- a/amavis-logwatch ++++ b/amavis-logwatch +@@ -2029,7 +2029,7 @@ sub create_ignore_list() { + push @ignore_list_final, qr/^address modified \(/; + push @ignore_list_final, qr/^Request: AM\.PDP /; + push @ignore_list_final, qr/^DSPAM result: /; +- push @ignore_list_final, qr/^bind to \//; ++ push @ignore_list_final, qr/^(will )?bind to \//; + push @ignore_list_final, qr/^ZMQ enabled: /; + + push @ignore_list_final, qr/^Inserting header field: X-Amavis-Hold: /; +-- +2.19.2 + |