From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1008724-garchives=archives.gentoo.org@lists.gentoo.org>
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 97E5D1382C5
	for <garchives@archives.gentoo.org>; Sun, 11 Mar 2018 14:07:08 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id A231AE0829;
	Sun, 11 Mar 2018 14:07:07 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(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 710B2E0829
	for <gentoo-commits@lists.gentoo.org>; Sun, 11 Mar 2018 14:07:07 +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 077A8335C30
	for <gentoo-commits@lists.gentoo.org>; Sun, 11 Mar 2018 14:07:06 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 3833A232
	for <gentoo-commits@lists.gentoo.org>; Sun, 11 Mar 2018 14:07:04 +0000 (UTC)
From: "Dirkjan Ochtman" <djc@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Dirkjan Ochtman" <djc@gentoo.org>
Message-ID: <1520777213.49f2c10c2df125c6e3afa9edaf80a3d1223e943e.djc@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/, mail-filter/rspamd/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: mail-filter/rspamd/Manifest mail-filter/rspamd/files/1.6.6-dont-send-reject-message-after-set-reply.patch mail-filter/rspamd/rspamd-1.6.6.ebuild
X-VCS-Directories: mail-filter/rspamd/ mail-filter/rspamd/files/
X-VCS-Committer: djc
X-VCS-Committer-Name: Dirkjan Ochtman
X-VCS-Revision: 49f2c10c2df125c6e3afa9edaf80a3d1223e943e
X-VCS-Branch: master
Date: Sun, 11 Mar 2018 14:07:04 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 42926410-5b45-42f3-a8b5-cd92f6e4f1cd
X-Archives-Hash: 01ea7493abb99f78331bc0e5e31ea690

commit:     49f2c10c2df125c6e3afa9edaf80a3d1223e943e
Author:     Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 11 13:56:25 2018 +0000
Commit:     Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
CommitDate: Sun Mar 11 14:06:53 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49f2c10c

mail-filter/rspamd: version bump to 1.6.6 (fixes bug 647978)

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 mail-filter/rspamd/Manifest                        |   1 +
 ...-dont-send-reject-message-after-set-reply.patch | 128 +++++++++++++++++++++
 mail-filter/rspamd/rspamd-1.6.6.ebuild             |  76 ++++++++++++
 3 files changed, 205 insertions(+)

diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest
index 5eda82e2b6f..94bea3662bb 100644
--- a/mail-filter/rspamd/Manifest
+++ b/mail-filter/rspamd/Manifest
@@ -1 +1,2 @@
 DIST rspamd-1.6.5.tar.gz 2484271 BLAKE2B 880e862eecd4a082b87bee2ba8c7b17a475efbfe90dbb0cbf34c5ad6c42c80d6ea142f11c7632763d7f9e4155a4521274f2d5a26a77dfbdab9f585bb1e3fff5f SHA512 789abc994cf96a0d88662e14f0e77f95f5c7c7bd1f808ffd64af21cf73cef643b5aee4c1f066d81d04e79d6bb7f72f12095ff08d8515a40bcca23153715fc9f1
+DIST rspamd-1.6.6.tar.gz 2487482 BLAKE2B f18640f64a8c0bcf6077267a1715f0bb096ab18484c24de56a012c42666cdc9f8671237c5336dce7cd47f44f9aba7905ce3723232d53a5b8ddfe143df682bd9b SHA512 14c7144017df69600dbd09541d16dae19d87105b09f95811fc09624b60e89ca68200654e88dea242508afd3c4963ea7cac086abddec8ca1a3d8fc73d7c27e899

diff --git a/mail-filter/rspamd/files/1.6.6-dont-send-reject-message-after-set-reply.patch b/mail-filter/rspamd/files/1.6.6-dont-send-reject-message-after-set-reply.patch
new file mode 100644
index 00000000000..4238c838dfa
--- /dev/null
+++ b/mail-filter/rspamd/files/1.6.6-dont-send-reject-message-after-set-reply.patch
@@ -0,0 +1,128 @@
+From 2bda2989eee893c42ff04f48a904f00a33a7d07a Mon Sep 17 00:00:00 2001
+From: Vsevolod Stakhov <vsevolod@highsecure.ru>
+Date: Tue, 27 Feb 2018 16:37:44 +0000
+Subject: [PATCH] [CritFix] Do not send reject messages after set reply
+
+Libmilter seems to be totally brain damaged:
+https://github.com/freebsd/freebsd/blob/386ddae58459341ec567604707805814a2128a57/contrib/sendmail/libmilter/engine.c#L66
+
+---
+ src/libserver/milter.c | 22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
+
+ Back-ported for rspamd 1.5.6
+
+diff -ur rspamd-1.6.6/src/libserver/milter.c rspamd-1.6.6-badmilter/src/libserver/milter.c
+--- rspamd-1.6.6/src/libserver/milter.c	2018-02-16 13:47:47.000000000 +0000
++++ rspamd-1.6.6-badmilter/src/libserver/milter.c	2018-03-07 16:07:58.591483869 +0000
+@@ -99,6 +99,8 @@
+ 	guint i;
+ 
+ 	if (how & RSPAMD_MILTER_RESET_IO) {
++		msg_debug_milter ("cleanup IO on abort");
++
+ 		DL_FOREACH_SAFE (priv->out_chain, obuf, obuf_tmp) {
+ 			rspamd_milter_obuf_free (obuf);
+ 		}
+@@ -111,8 +113,11 @@
+ 	}
+ 
+ 	if (how & RSPAMD_MILTER_RESET_COMMON) {
++		msg_debug_milter ("cleanup common data on abort");
++
+ 		if (session->message) {
+ 			session->message->len = 0;
++			msg_debug_milter ("cleanup message on abort");
+ 		}
+ 
+ 		if (session->rcpts) {
+@@ -120,30 +125,38 @@
+ 				rspamd_email_address_unref (cur);
+ 			}
+ 
++			msg_debug_milter ("cleanup %d recipients on abort",
++					(gint)session->rcpts->len);
++
+ 			g_ptr_array_free (session->rcpts, TRUE);
+ 			session->rcpts = NULL;
+ 		}
+ 
+ 		if (session->from) {
++			msg_debug_milter ("cleanup from");
+ 			rspamd_email_address_unref (session->from);
+ 			session->from = NULL;
+ 		}
+ 
+ 		if (session->helo) {
++			msg_debug_milter ("cleanup helo");
+ 			session->helo->len = 0;
+ 		}
+ 
+ 		if (session->hostname) {
++			msg_debug_milter ("cleanup hostname");
+ 			session->hostname->len = 0;
+ 		}
+ 
+ 		if (priv->headers) {
++			msg_debug_milter ("cleanup headers");
+ 			g_hash_table_remove_all (priv->headers);
+ 		}
+ 	}
+ 
+ 	if (how & RSPAMD_MILTER_RESET_ADDR) {
+ 		if (session->addr) {
++			msg_debug_milter ("cleanup addr");
+ 			rspamd_inet_address_free (session->addr);
+ 			session->addr = NULL;
+ 		}
+@@ -151,6 +164,7 @@
+ 
+ 	if (how & RSPAMD_MILTER_RESET_MACRO) {
+ 		if (session->macros) {
++			msg_debug_milter ("cleanup macros");
+ 			g_hash_table_unref (session->macros);
+ 			session->macros = NULL;
+ 		}
+@@ -1612,7 +1626,7 @@
+ 		msg_err_milter ("cannot find scan results, tempfail");
+ 		rspamd_milter_send_action (session, RSPAMD_MILTER_TEMPFAIL);
+ 
+-		return;
++		goto cleanup;
+ 	}
+ 
+ 	elt = ucl_object_lookup (results, "action");
+@@ -1621,7 +1635,7 @@
+ 		msg_err_milter ("cannot find action in results, tempfail");
+ 		rspamd_milter_send_action (session, RSPAMD_MILTER_TEMPFAIL);
+ 
+-		return;
++		goto cleanup;
+ 	}
+ 
+ 	rspamd_action_from_str (ucl_object_tostring (elt), &action);
+@@ -1681,7 +1695,6 @@
+ 			}
+ 
+ 			rspamd_milter_set_reply (session, rcode, xcode, reply);
+-			rspamd_milter_send_action (session, RSPAMD_MILTER_REJECT);
+ 		}
+ 		break;
+ 	case METRIC_ACTION_SOFT_REJECT:
+@@ -1696,7 +1709,6 @@
+ 		}
+ 
+ 		rspamd_milter_set_reply (session, rcode, xcode, reply);
+-		rspamd_milter_send_action (session, RSPAMD_MILTER_REJECT);
+ 		break;
+ 
+ 	case METRIC_ACTION_REWRITE_SUBJECT:
+@@ -1741,6 +1753,8 @@
+ 	rspamd_fstring_free (rcode);
+ 	rspamd_fstring_free (xcode);
+ 	rspamd_fstring_free (reply);
++
++	rspamd_milter_session_reset (session, RSPAMD_MILTER_RESET_ABORT);
+ }
+ 
+ void

diff --git a/mail-filter/rspamd/rspamd-1.6.6.ebuild b/mail-filter/rspamd/rspamd-1.6.6.ebuild
new file mode 100644
index 00000000000..8ded37e068e
--- /dev/null
+++ b/mail-filter/rspamd/rspamd-1.6.6.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils pax-utils user systemd
+
+DESCRIPTION="Rapid spam filtering system"
+SRC_URI="https://github.com/vstakhov/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz"
+HOMEPAGE="https://github.com/vstakhov/rspamd"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="cpu_flags_x86_ssse3 fann gd jemalloc +jit libressl pcre2"
+
+RDEPEND="!libressl? ( dev-libs/openssl:0=[-bindist] )
+	libressl? ( dev-libs/libressl:0= )
+	fann? ( sci-mathematics/fann )
+	pcre2? ( dev-libs/libpcre2[jit=] )
+	!pcre2? ( dev-libs/libpcre[jit=] )
+	jit? ( dev-lang/luajit:2 )
+	jemalloc? ( dev-libs/jemalloc )
+	dev-libs/libevent
+	dev-db/sqlite:3
+	dev-libs/glib:2
+	<dev-util/ragel-7.0
+	sys-apps/file
+	gd? ( media-libs/gd[jpeg] )
+	dev-libs/icu
+	cpu_flags_x86_ssse3? ( dev-libs/hyperscan )"
+DEPEND="dev-util/ragel
+	${RDEPEND}"
+
+QA_MULTILIB_PATHS="usr/lib/rspamd/.*"
+PATCHES=( "${FILESDIR}/${PV}-dont-send-reject-message-after-set-reply.patch" )
+
+pkg_setup() {
+	enewgroup rspamd
+	enewuser rspamd -1 -1 /var/lib/rspamd rspamd
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DCONFDIR=/etc/rspamd
+		-DRUNDIR=/var/run/rspamd
+		-DDBDIR=/var/lib/rspamd
+		-DLOGDIR=/var/log/rspamd
+		-DENABLE_LUAJIT=$(usex jit ON OFF)
+		-DENABLE_FANN=$(usex fann ON OFF)
+		-DENABLE_PCRE2=$(usex pcre2 ON OFF)
+		-DENABLE_JEMALLOC=$(usex jemalloc ON OFF)
+		-DENABLE_HYPERSCAN=$(usex cpu_flags_x86_ssse3 ON OFF)
+	)
+	cmake-utils_src_configure
+}
+
+src_install() {
+	cmake-utils_src_install
+	newinitd "${FILESDIR}/rspamd.init-r5" rspamd
+
+	# Remove mprotect for JIT support
+	if use jit; then
+		pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-* || die
+	fi
+
+	dodir /var/lib/rspamd
+	dodir /var/log/rspamd
+
+	fowners rspamd:rspamd /var/lib/rspamd /var/log/rspamd
+
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}/rspamd.logrotate" rspamd
+
+	systemd_newunit rspamd.service rspamd.service
+}