From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DA7C4138334 for ; Fri, 28 Dec 2018 15:23:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8B481E09BA; Fri, 28 Dec 2018 15:23:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4D0CEE09BA for ; Fri, 28 Dec 2018 15:23:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 79915335C07 for ; Fri, 28 Dec 2018 15:23:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 50D5742F for ; Fri, 28 Dec 2018 15:23:20 +0000 (UTC) From: "Michael Orlitzky" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" Message-ID: <1546010554.75d9e77e4bac2a796c9faf1ba820d12a02fc6a77.mjo@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/postfix-logwatch/, net-mail/postfix-logwatch/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-mail/postfix-logwatch/files/all-server-ports-busy-lines.patch net-mail/postfix-logwatch/postfix-logwatch-1.40.03-r3.ebuild X-VCS-Directories: net-mail/postfix-logwatch/ net-mail/postfix-logwatch/files/ X-VCS-Committer: mjo X-VCS-Committer-Name: Michael Orlitzky X-VCS-Revision: 75d9e77e4bac2a796c9faf1ba820d12a02fc6a77 X-VCS-Branch: master Date: Fri, 28 Dec 2018 15:23:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c59b9daf-7eba-40d6-a764-a976f1dec3ee X-Archives-Hash: 938f34c2a81243a1a0fccb031ca0de85 commit: 75d9e77e4bac2a796c9faf1ba820d12a02fc6a77 Author: Michael Orlitzky gentoo org> AuthorDate: Fri Dec 28 15:08:29 2018 +0000 Commit: Michael Orlitzky gentoo org> CommitDate: Fri Dec 28 15:22:34 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75d9e77e net-mail/postfix-logwatch: new revision with a patch for an unmatched line. Signed-off-by: Michael Orlitzky gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11 .../files/all-server-ports-busy-lines.patch | 59 ++++++++++++++++++++++ .../postfix-logwatch-1.40.03-r3.ebuild | 44 ++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/net-mail/postfix-logwatch/files/all-server-ports-busy-lines.patch b/net-mail/postfix-logwatch/files/all-server-ports-busy-lines.patch new file mode 100644 index 00000000000..dd5ae5869eb --- /dev/null +++ b/net-mail/postfix-logwatch/files/all-server-ports-busy-lines.patch @@ -0,0 +1,59 @@ +From 7b3930a9d44f91a63f0edbe765c75dc8f6128b7c Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky +Date: Wed, 26 Dec 2018 12:54:15 -0500 +Subject: [PATCH 1/1] Match postscreen "all server ports busy" lines. + +Lines that look like + + NOQUEUE: reject: CONNECT from [192.168.0.1]:39410: all server ports busy + +were not being matched. There were two similar matches, one for a +specific "too many connections" error + + NOQUEUE: reject: CONNECT from [192.168.0.1]:7197: too many connections + +and another for a more general form intended to match "all screening +ports busy" errors from postscreen: + + reject: connect from [192.168.0.1]:21225: all screening ports busy + +The general form is preferable in my opinion, but the "screening +ports" message is a bit of a black sheep. As a result, even the more +general regular expression didn't match the other two errors due to +their beginning with "NOQUEUE" and using an uppercase "CONNECT". + +To fix this, the general regular expression was made even more +general. Now, a leading "NOQUEUE: " is optional, and the "CONNECT" can +be capitalized. Thus, one regular expression now catches all three +messages. +--- + postfix-logwatch | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/postfix-logwatch b/postfix-logwatch +index 827dfe0..648ba7a 100644 +--- a/postfix-logwatch ++++ b/postfix-logwatch +@@ -4399,14 +4399,11 @@ sub postfix_postscreen { + } + } + +- elsif ($line =~ /^NOQUEUE: reject: CONNECT from \[([^]]+)\](?::\d+)?: too many connections/) { +- # NOQUEUE: reject: CONNECT from [192.168.0.1]:7197: too many connections +- $Counts{'postscreen'}{'reject'}{'Too many connections'}{$1}{$END_KEY}++ if $Collecting{'postscreen'}; +- } +- +- elsif ($line =~ /^reject: connect from \[([^]]+)\](?::\d+)?: (.+)$/) { +- # reject: connect from [192.168.0.1]:21225: all screening ports busy +- $Counts{'postscreen'}{'reject'}{"\u$2"}{$1}{$END_KEY}++ if $Collecting{'postscreen'}; ++ elsif ($line =~ /^(NOQUEUE: )?reject: (connect|CONNECT) from \[([^]]+)\](?::\d+)?: (.+)$/) { ++ # NOQUEUE: reject: CONNECT from [192.168.0.1]:7197: too many connections ++ # NOQUEUE: reject: CONNECT from [192.168.0.1]:39410: all server ports busy ++ # reject: connect from [192.168.0.1]:21225: all screening ports busy ++ $Counts{'postscreen'}{'reject'}{"\u$4"}{$3}{$END_KEY}++ if $Collecting{'postscreen'}; + } + + elsif ($line =~ /^(?:WHITELIST VETO) \[([^]]+)\](?::\d+)?$/) { +-- +2.19.2 + diff --git a/net-mail/postfix-logwatch/postfix-logwatch-1.40.03-r3.ebuild b/net-mail/postfix-logwatch/postfix-logwatch-1.40.03-r3.ebuild new file mode 100644 index 00000000000..1e6cf975500 --- /dev/null +++ b/net-mail/postfix-logwatch/postfix-logwatch-1.40.03-r3.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="A log analyzer for postfix" +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}/multi-digit-enhanced-status.patch" + "${FILESDIR}/all-server-ports-busy-lines.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 ${PN}.conf-topn + doman ${PN}.1 + dobin ${PN} + insinto /etc + doins ${PN}.conf +}