Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/postfix-logwatch/, net-mail/postfix-logwatch/files/
Date: Fri, 28 Dec 2018 15:23:25
Message-Id: 1546010554.75d9e77e4bac2a796c9faf1ba820d12a02fc6a77.mjo@gentoo
1 commit: 75d9e77e4bac2a796c9faf1ba820d12a02fc6a77
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 28 15:08:29 2018 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 28 15:22:34 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75d9e77e
7
8 net-mail/postfix-logwatch: new revision with a patch for an unmatched line.
9
10 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 .../files/all-server-ports-busy-lines.patch | 59 ++++++++++++++++++++++
14 .../postfix-logwatch-1.40.03-r3.ebuild | 44 ++++++++++++++++
15 2 files changed, 103 insertions(+)
16
17 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
18 new file mode 100644
19 index 00000000000..dd5ae5869eb
20 --- /dev/null
21 +++ b/net-mail/postfix-logwatch/files/all-server-ports-busy-lines.patch
22 @@ -0,0 +1,59 @@
23 +From 7b3930a9d44f91a63f0edbe765c75dc8f6128b7c Mon Sep 17 00:00:00 2001
24 +From: Michael Orlitzky <michael@××××××××.com>
25 +Date: Wed, 26 Dec 2018 12:54:15 -0500
26 +Subject: [PATCH 1/1] Match postscreen "all server ports busy" lines.
27 +
28 +Lines that look like
29 +
30 + NOQUEUE: reject: CONNECT from [192.168.0.1]:39410: all server ports busy
31 +
32 +were not being matched. There were two similar matches, one for a
33 +specific "too many connections" error
34 +
35 + NOQUEUE: reject: CONNECT from [192.168.0.1]:7197: too many connections
36 +
37 +and another for a more general form intended to match "all screening
38 +ports busy" errors from postscreen:
39 +
40 + reject: connect from [192.168.0.1]:21225: all screening ports busy
41 +
42 +The general form is preferable in my opinion, but the "screening
43 +ports" message is a bit of a black sheep. As a result, even the more
44 +general regular expression didn't match the other two errors due to
45 +their beginning with "NOQUEUE" and using an uppercase "CONNECT".
46 +
47 +To fix this, the general regular expression was made even more
48 +general. Now, a leading "NOQUEUE: " is optional, and the "CONNECT" can
49 +be capitalized. Thus, one regular expression now catches all three
50 +messages.
51 +---
52 + postfix-logwatch | 13 +++++--------
53 + 1 file changed, 5 insertions(+), 8 deletions(-)
54 +
55 +diff --git a/postfix-logwatch b/postfix-logwatch
56 +index 827dfe0..648ba7a 100644
57 +--- a/postfix-logwatch
58 ++++ b/postfix-logwatch
59 +@@ -4399,14 +4399,11 @@ sub postfix_postscreen {
60 + }
61 + }
62 +
63 +- elsif ($line =~ /^NOQUEUE: reject: CONNECT from \[([^]]+)\](?::\d+)?: too many connections/) {
64 +- # NOQUEUE: reject: CONNECT from [192.168.0.1]:7197: too many connections
65 +- $Counts{'postscreen'}{'reject'}{'Too many connections'}{$1}{$END_KEY}++ if $Collecting{'postscreen'};
66 +- }
67 +-
68 +- elsif ($line =~ /^reject: connect from \[([^]]+)\](?::\d+)?: (.+)$/) {
69 +- # reject: connect from [192.168.0.1]:21225: all screening ports busy
70 +- $Counts{'postscreen'}{'reject'}{"\u$2"}{$1}{$END_KEY}++ if $Collecting{'postscreen'};
71 ++ elsif ($line =~ /^(NOQUEUE: )?reject: (connect|CONNECT) from \[([^]]+)\](?::\d+)?: (.+)$/) {
72 ++ # NOQUEUE: reject: CONNECT from [192.168.0.1]:7197: too many connections
73 ++ # NOQUEUE: reject: CONNECT from [192.168.0.1]:39410: all server ports busy
74 ++ # reject: connect from [192.168.0.1]:21225: all screening ports busy
75 ++ $Counts{'postscreen'}{'reject'}{"\u$4"}{$3}{$END_KEY}++ if $Collecting{'postscreen'};
76 + }
77 +
78 + elsif ($line =~ /^(?:WHITELIST VETO) \[([^]]+)\](?::\d+)?$/) {
79 +--
80 +2.19.2
81 +
82
83 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
84 new file mode 100644
85 index 00000000000..1e6cf975500
86 --- /dev/null
87 +++ b/net-mail/postfix-logwatch/postfix-logwatch-1.40.03-r3.ebuild
88 @@ -0,0 +1,44 @@
89 +# Copyright 1999-2018 Gentoo Authors
90 +# Distributed under the terms of the GNU General Public License v2
91 +
92 +EAPI=7
93 +
94 +DESCRIPTION="A log analyzer for postfix"
95 +HOMEPAGE="http://logreporters.sourceforge.net/"
96 +SRC_URI="mirror://sourceforge/logreporters/${P}.tgz"
97 +
98 +LICENSE="MIT"
99 +SLOT="0"
100 +KEYWORDS="~amd64 ~x86"
101 +
102 +RDEPEND="dev-lang/perl"
103 +
104 +PATCHES=(
105 + "${FILESDIR}/unescaped-left-brace.patch"
106 + "${FILESDIR}/redundant-argument-to-sprintf.patch"
107 + "${FILESDIR}/multi-digit-enhanced-status.patch"
108 + "${FILESDIR}/all-server-ports-busy-lines.patch"
109 +)
110 +
111 +src_prepare() {
112 + default
113 + # Replace the default config file location with ours.
114 + local cfg_default='/usr/local/etc/${progname_prefix}-logwatch.conf'
115 + local cfg_gentoo='/etc/${progname_prefix}-logwatch.conf';
116 + sed -i "s~${cfg_default}~${cfg_gentoo}~" ${PN} \
117 + || die 'failed to update the default config location'
118 +}
119 +
120 +src_compile() {
121 + # The default make target just outputs instructions. We don't want
122 + # the user to see these, so we avoid the default emake.
123 + :
124 +}
125 +
126 +src_install() {
127 + dodoc Bugs Changes README ${PN}.conf-topn
128 + doman ${PN}.1
129 + dobin ${PN}
130 + insinto /etc
131 + doins ${PN}.conf
132 +}