Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/amavisd-new/files/, mail-filter/amavisd-new/
Date: Fri, 05 Oct 2018 04:25:02
Message-Id: 1538713412.c056ed59671c776f39ce1360a6a1b0fb0f16b900.whissi@gentoo
1 commit: c056ed59671c776f39ce1360a6a1b0fb0f16b900
2 Author: Ralph Seichter <github <AT> seichter <DOT> de>
3 AuthorDate: Fri Oct 5 04:23:32 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 5 04:23:32 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c056ed59
7
8 mail-filter/amavisd-new: DKIM signing bugfix
9
10 amavisd-new version 2.11.0 introduced a bug which breaks DKIM signing
11 for outbound mail. This ebuild adds a patch which fixes the issue.
12
13 Closes: https://bugs.gentoo.org/603582
14 Signed-off-by: Ralph Seichter <gentoo <AT> seichter.de>
15 Closes: https://github.com/gentoo/gentoo/pull/10058
16 Package-Manager: Portage-2.3.49, Repoman-2.3.10
17 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
18
19 .../amavisd-new/amavisd-new-2.11.0-r4.ebuild | 184 +++++++++++++++++++++
20 .../amavisd-new/files/amavisd-2.11.0-dkim.patch | 12 ++
21 2 files changed, 196 insertions(+)
22
23 diff --git a/mail-filter/amavisd-new/amavisd-new-2.11.0-r4.ebuild b/mail-filter/amavisd-new/amavisd-new-2.11.0-r4.ebuild
24 new file mode 100644
25 index 00000000000..0efc27e6454
26 --- /dev/null
27 +++ b/mail-filter/amavisd-new/amavisd-new-2.11.0-r4.ebuild
28 @@ -0,0 +1,184 @@
29 +# Copyright 1999-2018 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +
32 +EAPI=6
33 +inherit systemd user
34 +
35 +MY_P="${P/_/-}"
36 +DESCRIPTION="High-performance interface between the MTA and content checkers"
37 +HOMEPAGE="https://www.ijs.si/software/amavisd/"
38 +SRC_URI="https://www.ijs.si/software/amavisd/${MY_P}.tar.xz"
39 +PORTAGE_DOHTML_WARN_ON_SKIPPED_FILES=yes
40 +
41 +LICENSE="GPL-2 BSD-2"
42 +SLOT="0"
43 +KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
44 +IUSE="clamav courier dkim ldap mysql postgres qmail razor snmp spamassassin zmq"
45 +
46 +DEPEND=">=sys-apps/sed-4
47 + >=dev-lang/perl-5.10.0"
48 +
49 +RDEPEND="${DEPEND}
50 + >=sys-apps/coreutils-5.0-r3
51 + app-arch/cpio
52 + app-arch/gzip
53 + app-arch/bzip2
54 + app-arch/arc
55 + app-arch/cabextract
56 + app-arch/freeze
57 + app-arch/lha
58 + app-arch/lrzip
59 + app-arch/lzop
60 + app-arch/ncompress
61 + app-arch/p7zip
62 + app-arch/pax
63 + app-arch/unarj
64 + app-arch/unrar
65 + app-arch/xz-utils
66 + app-arch/zoo
67 + net-mail/ripole
68 + >=dev-perl/Archive-Zip-1.14
69 + >=virtual/perl-IO-Compress-1.35
70 + >=virtual/perl-Compress-Raw-Zlib-2.017
71 + net-mail/tnef
72 + virtual/perl-MIME-Base64
73 + >=dev-perl/MIME-tools-5.415
74 + >=dev-perl/MailTools-1.58
75 + >=dev-perl/Net-Server-0.91
76 + virtual/perl-Digest-MD5
77 + dev-perl/IO-stringy
78 + virtual/perl-IO-Socket-IP
79 + >=virtual/perl-Time-HiRes-1.49
80 + dev-perl/Unix-Syslog
81 + dev-perl/Net-LibIDN
82 + sys-apps/file
83 + >=sys-libs/db-4.4.20
84 + dev-perl/BerkeleyDB
85 + dev-perl/Convert-BinHex
86 + >=dev-perl/Mail-DKIM-0.31
87 + virtual/perl-File-Temp
88 + dev-perl/Net-SSLeay
89 + dev-perl/IO-Socket-SSL
90 + virtual/mta
91 + clamav? ( app-antivirus/clamav )
92 + ldap? ( >=dev-perl/perl-ldap-0.33 )
93 + mysql? ( dev-perl/DBD-mysql )
94 + postgres? ( dev-perl/DBD-Pg )
95 + razor? ( mail-filter/razor )
96 + snmp? ( net-analyzer/net-snmp[perl] )
97 + spamassassin? ( mail-filter/spamassassin dev-perl/Image-Info )
98 + zmq? ( dev-perl/ZMQ-LibZMQ3 )"
99 +
100 +AMAVIS_ROOT="/var/amavis"
101 +S="${WORKDIR}/${MY_P}"
102 +
103 +src_prepare() {
104 + # amavisd-new version 2.11.0 breaks DKIM signing of outbound mail,
105 + # see https://bugs.gentoo.org/603582
106 + eapply "${FILESDIR}/amavisd-2.11.0-dkim.patch"
107 +
108 + if use courier ; then
109 + eapply -p0 amavisd-new-courier.patch
110 + fi
111 +
112 + if use qmail ; then
113 + eapply -p0 amavisd-new-qmqpqq.patch
114 + fi
115 +
116 + sed -i \
117 + -e '/daemon/s/vscan/amavis/' \
118 + -e "s:'/var/virusmails':\"\$MYHOME/quarantine\":" \
119 + "${S}/amavisd.conf" "${S}/amavis-mc" || die "missing conf file"
120 +
121 + if ! use dkim ; then
122 + sed -i -e '/enable_dkim/s/1/0/' "${S}/amavisd.conf" \
123 + || die "missing conf file - dkim"
124 + fi
125 +
126 + if use zmq ; then
127 + sed -i -e '/enable_zmq/s/# //' "${S}/amavisd.conf" \
128 + || die "missing conf file - zmq"
129 + fi
130 +
131 + if ! use spamassassin ; then
132 + sed -i -e \
133 + "/^#[[:space:]]*@bypass_spam_checks_maps[[:space:]]*=[[:space:]]*(1)/s/^#//" \
134 + "${S}/amavisd.conf" || die "missing conf file - sa"
135 + fi
136 + eapply_user
137 +}
138 +
139 +src_install() {
140 + dosbin amavisd amavisd-agent amavisd-nanny amavisd-release \
141 + amavisd-signer amavisd-status
142 + dobin p0f-analyzer.pl amavisd-submit
143 +
144 + if use snmp ; then
145 + dosbin amavisd-snmp-subagent
146 + use zmq && dosbin amavisd-snmp-subagent-zmq
147 + dodoc AMAVIS-MIB.txt
148 + newinitd "${FILESDIR}"/amavisd-snmp.initd amavisd-snmp
149 + fi
150 +
151 + if use zmq ; then
152 + dosbin amavis-services amavis-mc
153 + newinitd "${FILESDIR}"/amavis-mc.initd amavis-mc
154 + fi
155 +
156 + insinto /etc
157 + insopts -m0640
158 + doins amavisd.conf
159 +
160 + newinitd "${FILESDIR}/amavisd.initd-r1" amavisd
161 +
162 + systemd_dounit "${FILESDIR}/amavisd.service"
163 + use clamav || sed -i -e '/Wants=clamd/d' "${ED}"/usr/lib/systemd/system/amavisd.service
164 + use spamassassin || sed -i -e '/Wants=spamassassin/d' "${ED}"/usr/lib/systemd/system/amavisd.service
165 +
166 + keepdir "${AMAVIS_ROOT}"
167 + keepdir "${AMAVIS_ROOT}/db"
168 + keepdir "${AMAVIS_ROOT}/quarantine"
169 + keepdir "${AMAVIS_ROOT}/tmp"
170 + keepdir "${AMAVIS_ROOT}/var"
171 +
172 + dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES TODO \
173 + amavisd.conf-default amavisd-custom.conf
174 +
175 + docinto README_FILES
176 + dodoc README_FILES/README*
177 + dodoc -r README_FILES/*.{html,css}
178 + docinto README_FILES/images
179 + dodoc README_FILES/images/*.png
180 + docinto README_FILES/images/callouts
181 + dodoc README_FILES/images/callouts/*.png
182 +
183 + docinto test-messages
184 + dodoc test-messages/README
185 + dodoc test-messages/sample.tar.gz.compl
186 +
187 + if use ldap ; then
188 + dodir /etc/openldap/schema
189 + insinto /etc/openldap/schema
190 + insopts -o root -g root -m 644
191 + newins LDAP.schema ${PN}.schema || die
192 + fi
193 +}
194 +
195 +pkg_preinst() {
196 + enewgroup amavis
197 + enewuser amavis -1 -1 "${AMAVIS_ROOT}" amavis
198 + if use razor ; then
199 + if [ ! -d "${ROOT}${AMAVIS_ROOT}/.razor" ] ; then
200 + elog "Setting up initial razor config files..."
201 +
202 + razor-admin -create -home="${D}/${AMAVIS_ROOT}/.razor"
203 + sed -i -e "s:debuglevel\([ ]*\)= .:debuglevel\1= 0:g" \
204 + "${D}/${AMAVIS_ROOT}/.razor/razor-agent.conf" || die
205 + fi
206 + fi
207 +}
208 +
209 +pkg_postinst() {
210 + chown root:amavis "${ROOT}/etc/amavisd.conf"
211 + chown -R amavis:amavis "${ROOT}/${AMAVIS_ROOT}"
212 +}
213
214 diff --git a/mail-filter/amavisd-new/files/amavisd-2.11.0-dkim.patch b/mail-filter/amavisd-new/files/amavisd-2.11.0-dkim.patch
215 new file mode 100644
216 index 00000000000..d9aa07d732b
217 --- /dev/null
218 +++ b/mail-filter/amavisd-new/files/amavisd-2.11.0-dkim.patch
219 @@ -0,0 +1,12 @@
220 +Origin: https://lists.amavis.org/pipermail/amavis-users/2016-July/004428.html
221 +
222 +--- a/amavisd
223 ++++ b/amavisd
224 +@@ -34338,6 +34338,7 @@
225 + $sig_ind++;
226 + }
227 + Amavis::load_policy_bank($_,$msginfo) for @bank_names;
228 ++ $msginfo->originating(c('originating'));
229 + $msginfo->dkim_signatures_valid(\@signatures_valid) if @signatures_valid;
230 + # if (ll(5) && $sig_ind > 0) {
231 + # # show which header fields are covered by which signature