public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2015-11-24 15:50 Eray Aslan
  0 siblings, 0 replies; 10+ messages in thread
From: Eray Aslan @ 2015-11-24 15:50 UTC (permalink / raw
  To: gentoo-commits

commit:     c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 24 15:49:00 2015 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Tue Nov 24 15:49:00 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8abcbe8

net-mail/dovecot: remove old

Package-Manager: portage-2.2.25

 net-mail/dovecot/Manifest                  |   4 -
 net-mail/dovecot/dovecot-2.2.16-r1.ebuild  | 297 ----------------------------
 net-mail/dovecot/dovecot-2.2.18-r1.ebuild  | 306 -----------------------------
 net-mail/dovecot/dovecot-2.2.18.ebuild     | 303 ----------------------------
 net-mail/dovecot/files/CVE-2015-3420.patch |  52 -----
 5 files changed, 962 deletions(-)

diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
index d61599c..b2b6f52 100644
--- a/net-mail/dovecot/Manifest
+++ b/net-mail/dovecot/Manifest
@@ -1,6 +1,2 @@
-DIST dovecot-2.2-pigeonhole-0.4.7.tar.gz 1271959 SHA256 04a13ec11652cbff812519eacf4db7dda648ab5c4c5f63b43a437d1fb0cc8d2a SHA512 df1b4c5591ce36dc99a9e5fb0281d1d11e95b7bf37594910c5730ac611dafb744f057dc87416ff638d582191376d210bca63cc548bf34612144cae2ac6e9448d WHIRLPOOL 76b500f935ae2133e70affaf12a3fd3c158b60bd5903b160f7f3a63478b092b57cee6046d0b9afb10bf83ec4b869592ea632031cca75c4bff00f5c58b7fe23f6
-DIST dovecot-2.2-pigeonhole-0.4.8.tar.gz 1567528 SHA256 d73c1c5a11cdfdcb58304a1c1272cce6c8e1868e3f61d393b3b8a725f3bf665b SHA512 34b0bbe2015f8a9558daa9ae8feebfb42437f99578b551cc15d0d5ac04cafc15bf9c5a8395d6903a013639936a5868e39bbebe6432a989da1411b3dfab351c32 WHIRLPOOL a6ba9fdf03c6c80e3e03c79475a283d4c99011c9763869894e53e84d4f556f1484d6eac9d6482f31972f12b7261afa89e21ea432bf01f9407fa50cf0f7543b4c
 DIST dovecot-2.2-pigeonhole-0.4.9.tar.gz 1577127 SHA256 82892f876d26008a076973dfddf1cffaf5a0451825fd44e06287e94b89078649 SHA512 9e7a18b43d59ed955b142d16696ca221822a547ea59ac70c1bb374eedb28b6ed99ea49f34ead1f9a16ded4573605e410a5cc8e038e1bdf5f943a65588b5d3af2 WHIRLPOOL be309436b43af82a7cb8eff205e1638b2c59751927fdab187e6fde72330e4abd99878cbfa94ca50440ec8de1f9b569bf334d426891ddc73d5f647ee2040c193f
-DIST dovecot-2.2.16.tar.gz 4830169 SHA256 56ce1287a17fa88a2083116db00200deff1a5390af5eac1c8ae3f59a2079cff0 SHA512 7e910a58cae6d215169a815423bffd1677663ccb1eb400f7f1e733167c29989f3c6786a2d6cea0ef07e64cb08aa1402adb451e0adbbb999f57b3754c0962dbf8 WHIRLPOOL 22b3911e7efa336da792c2af0dde4e556d6c398d9b9f8127e53b13081777b40846a0324b92bc0b41bfd66b6957c6baaeb4e79bd39bf9ba6e91f9e2726a9575a4
-DIST dovecot-2.2.18.tar.gz 5100040 SHA256 b6d8468cea47f1227f47b80618f7fb872e2b2e9d3302adc107a005dd083865bb SHA512 227fa9c55070ce305d41faebb0fe15df86cb70427dd4043a01837095228b5504121fccaecfbf47fab3426334449b637bffdfe9a93ee2322bb8ff8d69de4967c7 WHIRLPOOL 117116bd436690613adaf51031fb371a82c55818a9d32f58d098c9d53fe52d27ecfe7466a3ce51ab8cd29c952b72b55586f3cd41e13784a7d614a23eabecab9c
 DIST dovecot-2.2.19.tar.gz 5256627 SHA256 759e1e3f9d907cdaabad1f5fbacc793ca191d234c084bec3bba42966952a4e9f SHA512 1b9d605a6a5862ade9d1ca634a9e0171b7c212ab025fc2059051c3795470685b66516fa9fbe5ad91d84388268ea15795f2dcd70ffdf81736ce4d80fd284835e9 WHIRLPOOL 30dbe70bfeef10dbe414ebf3f091041ad66926a8748cd401ecaf9ed5c7602939e86943d98bfb839f32c0aa1d0081ab71adacf23bb4adba34e828ee296e9a7278

diff --git a/net-mail/dovecot/dovecot-2.2.16-r1.ebuild b/net-mail/dovecot/dovecot-2.2.16-r1.ebuild
deleted file mode 100644
index f8811a9..0000000
--- a/net-mail/dovecot/dovecot-2.2.16-r1.ebuild
+++ /dev/null
@@ -1,297 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit eutils multilib ssl-cert systemd user versionator
-
-MY_P="${P/_/.}"
-major_minor="$(get_version_component_range 1-2)"
-sieve_version="0.4.7"
-if [[ ${PV} == *_rc* ]] ; then
-	rc_dir="rc/"
-else
-	rc_dir=""
-fi
-SRC_URI="http://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
-	sieve? (
-	http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	)
-	managesieve? (
-	http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	) "
-DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
-HOMEPAGE="http://www.dovecot.org/"
-
-SLOT="0"
-LICENSE="LGPL-2.1 MIT"
-KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 x86"
-
-IUSE_DOVECOT_AUTH="kerberos ldap mysql pam postgres sqlite vpopmail"
-IUSE_DOVECOT_STORAGE="cydir imapc +maildir mbox mdbox pop3c sdbox"
-IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
-IUSE_DOVECOT_OTHER="caps doc ipv6 lucene managesieve selinux sieve solr +ssl static-libs suid tcpd"
-
-IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
-
-DEPEND="bzip2? ( app-arch/bzip2 )
-	caps? ( sys-libs/libcap )
-	kerberos? ( virtual/krb5 )
-	ldap? ( net-nds/openldap )
-	lucene? ( >=dev-cpp/clucene-2.3 )
-	lzma? ( app-arch/xz-utils )
-	lz4? ( app-arch/lz4 )
-	mysql? ( virtual/mysql )
-	pam? ( virtual/pam )
-	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
-	selinux? ( sec-policy/selinux-dovecot )
-	solr? ( net-misc/curl dev-libs/expat )
-	sqlite? ( dev-db/sqlite:* )
-	ssl? ( dev-libs/openssl:* )
-	tcpd? ( sys-apps/tcp-wrappers )
-	vpopmail? ( net-mail/vpopmail )
-	zlib? ( sys-libs/zlib )
-	virtual/libiconv"
-
-RDEPEND="${DEPEND}
-	net-mail/mailbase"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if use managesieve && ! use sieve; then
-		ewarn "managesieve USE flag selected but sieve USE flag unselected"
-		ewarn "sieve USE flag will be turned on"
-	fi
-	# default internal user
-	enewgroup dovecot 97
-	enewuser dovecot 97 -1 /dev/null dovecot
-	# default login user
-	enewuser dovenull -1 -1 /dev/null
-	# add "mail" group for suid'ing. Better security isolation.
-	if use suid; then
-		enewgroup mail
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}/CVE-2015-3420.patch"
-	epatch "${FILESDIR}/${PN}-10-ssl.patch"
-
-	epatch_user
-}
-
-src_configure() {
-	local conf=""
-
-	if use postgres || use mysql || use sqlite; then
-		conf="${conf} --with-sql"
-	fi
-
-	local storages=""
-	for storage in ${IUSE_DOVECOT_STORAGE//+/}; do
-		use ${storage} && storages="${storage} ${storages}"
-	done
-	[ "${storages}" ] || storages="maildir"
-
-	# turn valgrind tests off. Bug #340791
-	VALGRIND=no econf \
-		--localstatedir="${EPREFIX}/var" \
-		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
-		--without-stemmer \
-		--with-storages="${storages}" \
-		--disable-rpath \
-		$( systemd_with_unitdir ) \
-		$( use_with bzip2 bzlib ) \
-		$( use_with caps libcap ) \
-		$( use_with kerberos gssapi ) \
-		$( use_with ldap ) \
-		$( use_with lucene ) \
-		$( use_with lz4 ) \
-		$( use_with lzma ) \
-		$( use_with mysql ) \
-		$( use_with pam ) \
-		$( use_with postgres pgsql ) \
-		$( use_with sqlite ) \
-		$( use_with solr ) \
-		$( use_with ssl ) \
-		$( use_with tcpd libwrap ) \
-		$( use_with vpopmail ) \
-		$( use_with zlib ) \
-		$( use_enable static-libs static ) \
-		${conf}
-
-	if use sieve || use managesieve ; then
-		# The sieve plugin needs this file to be build to determine the plugin
-		# directory and the list of libraries to link to.
-		emake dovecot-config
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		econf \
-			$( use_enable static-libs static ) \
-			--localstatedir="${EPREFIX}/var" \
-			--enable-shared \
-			--with-dovecot="../${MY_P}" \
-			$( use_with managesieve )
-	fi
-}
-
-src_compile() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
-	fi
-}
-
-src_test() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		default
-	fi
-}
-
-src_install () {
-	default
-
-	# insecure:
-	# use suid && fperms u+s /usr/libexec/dovecot/deliver
-	# better:
-	if use suid;then
-		einfo "Changing perms to allow deliver to be suided"
-		fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-		fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-	fi
-
-	newinitd "${FILESDIR}"/dovecot.init-r4 dovecot
-
-	rm -rf "${ED}"/usr/share/doc/dovecot
-
-	dodoc AUTHORS NEWS README TODO
-	dodoc doc/*.{txt,cnf,xml,sh}
-	docinto example-config
-	dodoc doc/example-config/*.{conf,ext}
-	docinto example-config/conf.d
-	dodoc doc/example-config/conf.d/*.{conf,ext}
-	docinto wiki
-	dodoc doc/wiki/*
-	doman doc/man/*.{1,7}
-
-	# Create the dovecot.conf file from the dovecot-example.conf file that
-	# the dovecot folks nicely left for us....
-	local conf="${ED}/etc/dovecot/dovecot.conf"
-	local confd="${ED}/etc/dovecot/conf.d"
-
-	insinto /etc/dovecot
-	doins doc/example-config/*.{conf,ext}
-	insinto /etc/dovecot/conf.d
-	doins doc/example-config/conf.d/*.{conf,ext}
-	fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
-	rm -f "${confd}/../README"
-
-	# .maildir is the Gentoo default
-	local mail_location="maildir:~/.maildir"
-	if ! use maildir; then
-		if use mbox; then
-			mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u"
-			keepdir /var/dovecot
-			sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' \
-			"${confd}/10-mail.conf" || die "sed failed"
-		elif use mdbox ; then
-			mail_location="mdbox:~/.mdbox"
-		elif use sdbox ; then
-			mail_location="sdbox:~/.sdbox"
-		fi
-	fi
-	sed -i -e \
-		"s|#mail_location =|mail_location = ${mail_location}|" \
-		"${confd}/10-mail.conf" \
-		|| die "failed to update mail location settings in 10-mail.conf"
-
-	# We're using pam files (imap and pop3) provided by mailbase
-	if use pam; then
-		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
-			"${confd}/auth-system.conf.ext" \
-			|| die "failed to update PAM settings in auth-system.conf.ext"
-		# mailbase does not provide a sieve pam file
-		use managesieve && dosym imap /etc/pam.d/sieve
-		sed -i -e \
-			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update PAM settings in 10-auth.conf"
-	fi
-
-	# Disable ipv6 if necessary
-	if ! use ipv6; then
-		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
-			|| die "failed to update listen settings in dovecot.conf"
-	fi
-
-	# Update ssl cert locations
-	if use ssl; then
-		sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
-		|| die "ssl conf failed"
-		sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
-			-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
-			"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
-	fi
-
-	# Install SQL configuration
-	if use mysql || use postgres; then
-		sed -i -e \
-			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
-			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
-			10-auth.conf"
-	fi
-
-	# Install LDAP configuration
-	if use ldap; then
-		sed -i -e \
-			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update ldap settings in 10-auth.conf"
-	fi
-
-	if use vpopmail; then
-		sed -i -e \
-			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update vpopmail settings in 10-auth.conf"
-	fi
-
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake DESTDIR="${ED}" install
-		sed -i -e \
-			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
-			|| die "failed to update sieve settings in 15-lda.conf"
-		rm -rf "${ED}"/usr/share/doc/dovecot
-		dodoc doc/*.txt
-		docinto example-config/conf.d
-		dodoc doc/example-config/conf.d/*.conf
-		insinto /etc/dovecot/conf.d
-		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
-		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
-		docinto sieve/rfc
-		dodoc doc/rfc/*.txt
-		docinto sieve/devel
-		dodoc doc/devel/DESIGN
-		doman doc/man/*.{1,7}
-	fi
-
-	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
-}
-
-pkg_postinst() {
-	if use ssl; then
-	# Let's not make a new certificate if we already have one
-		if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
-		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
-			einfo "Creating SSL	certificate"
-			SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
-			install_cert /etc/ssl/dovecot/server
-		fi
-	fi
-
-	elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
-}

diff --git a/net-mail/dovecot/dovecot-2.2.18-r1.ebuild b/net-mail/dovecot/dovecot-2.2.18-r1.ebuild
deleted file mode 100644
index 5b195cb..0000000
--- a/net-mail/dovecot/dovecot-2.2.18-r1.ebuild
+++ /dev/null
@@ -1,306 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit eutils multilib ssl-cert systemd user versionator
-
-MY_P="${P/_/.}"
-major_minor="$(get_version_component_range 1-2)"
-sieve_version="0.4.8"
-if [[ ${PV} == *_rc* ]] ; then
-	rc_dir="rc/"
-else
-	rc_dir=""
-fi
-SRC_URI="http://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
-	sieve? (
-	http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	)
-	managesieve? (
-	http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	) "
-DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
-HOMEPAGE="http://www.dovecot.org/"
-
-SLOT="0"
-LICENSE="LGPL-2.1 MIT"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86"
-
-IUSE_DOVECOT_AUTH="kerberos ldap mysql pam postgres sqlite vpopmail"
-IUSE_DOVECOT_STORAGE="cydir imapc +maildir mbox mdbox pop3c sdbox"
-IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
-IUSE_DOVECOT_OTHER="caps doc ipv6 libressl lucene managesieve selinux sieve solr +ssl static-libs suid tcpd"
-
-IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
-
-DEPEND="bzip2? ( app-arch/bzip2 )
-	caps? ( sys-libs/libcap )
-	kerberos? ( virtual/krb5 )
-	ldap? ( net-nds/openldap )
-	lucene? ( >=dev-cpp/clucene-2.3 )
-	lzma? ( app-arch/xz-utils )
-	lz4? ( app-arch/lz4 )
-	mysql? ( virtual/mysql )
-	pam? ( virtual/pam )
-	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
-	selinux? ( sec-policy/selinux-dovecot )
-	solr? ( net-misc/curl dev-libs/expat )
-	sqlite? ( dev-db/sqlite:* )
-	ssl? (
-		!libressl? ( dev-libs/openssl:0 )
-		libressl? ( dev-libs/libressl )
-	)
-	tcpd? ( sys-apps/tcp-wrappers )
-	vpopmail? ( net-mail/vpopmail )
-	zlib? ( sys-libs/zlib )
-	virtual/libiconv
-	dev-libs/icu:="
-
-RDEPEND="${DEPEND}
-	net-mail/mailbase"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if use managesieve && ! use sieve; then
-		ewarn "managesieve USE flag selected but sieve USE flag unselected"
-		ewarn "sieve USE flag will be turned on"
-	fi
-	# default internal user
-	enewgroup dovecot 97
-	enewuser dovecot 97 -1 /dev/null dovecot
-	# default login user
-	enewuser dovenull -1 -1 /dev/null
-	# add "mail" group for suid'ing. Better security isolation.
-	if use suid; then
-		enewgroup mail
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}/${PN}-10-ssl.patch"
-
-	epatch_user
-}
-
-src_configure() {
-	local conf=""
-
-	if use postgres || use mysql || use sqlite; then
-		conf="${conf} --with-sql"
-	fi
-
-	local storages=""
-	for storage in ${IUSE_DOVECOT_STORAGE//+/}; do
-		use ${storage} && storages="${storage} ${storages}"
-	done
-	[ "${storages}" ] || storages="maildir"
-
-	# turn valgrind tests off. Bug #340791
-	VALGRIND=no econf \
-		--localstatedir="${EPREFIX}/var" \
-		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
-		--without-stemmer \
-		--with-storages="${storages}" \
-		--disable-rpath \
-		--with-icu \
-		$( systemd_with_unitdir ) \
-		$( use_with bzip2 bzlib ) \
-		$( use_with caps libcap ) \
-		$( use_with kerberos gssapi ) \
-		$( use_with ldap ) \
-		$( use_with lucene ) \
-		$( use_with lz4 ) \
-		$( use_with lzma ) \
-		$( use_with mysql ) \
-		$( use_with pam ) \
-		$( use_with postgres pgsql ) \
-		$( use_with sqlite ) \
-		$( use_with solr ) \
-		$( use_with ssl ) \
-		$( use_with tcpd libwrap ) \
-		$( use_with vpopmail ) \
-		$( use_with zlib ) \
-		$( use_enable static-libs static ) \
-		${conf}
-
-	if use sieve || use managesieve ; then
-		# The sieve plugin needs this file to be build to determine the plugin
-		# directory and the list of libraries to link to.
-		emake dovecot-config
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		econf \
-			$( use_enable static-libs static ) \
-			--localstatedir="${EPREFIX}/var" \
-			--enable-shared \
-			--with-dovecot="../${MY_P}" \
-			$( use_with managesieve )
-	fi
-}
-
-src_compile() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
-	fi
-}
-
-src_test() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		default
-	fi
-}
-
-src_install () {
-	default
-
-	# insecure:
-	# use suid && fperms u+s /usr/libexec/dovecot/deliver
-	# better:
-	if use suid;then
-		einfo "Changing perms to allow deliver to be suided"
-		fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-		fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-	fi
-
-	newinitd "${FILESDIR}"/dovecot.init-r4 dovecot
-
-	rm -rf "${ED}"/usr/share/doc/dovecot
-
-	dodoc AUTHORS NEWS README TODO
-	dodoc doc/*.{txt,cnf,xml,sh}
-	docinto example-config
-	dodoc doc/example-config/*.{conf,ext}
-	docinto example-config/conf.d
-	dodoc doc/example-config/conf.d/*.{conf,ext}
-	docinto wiki
-	dodoc doc/wiki/*
-	doman doc/man/*.{1,7}
-
-	# Create the dovecot.conf file from the dovecot-example.conf file that
-	# the dovecot folks nicely left for us....
-	local conf="${ED}/etc/dovecot/dovecot.conf"
-	local confd="${ED}/etc/dovecot/conf.d"
-
-	insinto /etc/dovecot
-	doins doc/example-config/*.{conf,ext}
-	insinto /etc/dovecot/conf.d
-	doins doc/example-config/conf.d/*.{conf,ext}
-	fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
-	rm -f "${confd}/../README"
-
-	# .maildir is the Gentoo default
-	local mail_location="maildir:~/.maildir"
-	if ! use maildir; then
-		if use mbox; then
-			mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u"
-			keepdir /var/dovecot
-			sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' \
-			"${confd}/10-mail.conf" || die "sed failed"
-		elif use mdbox ; then
-			mail_location="mdbox:~/.mdbox"
-		elif use sdbox ; then
-			mail_location="sdbox:~/.sdbox"
-		fi
-	fi
-	sed -i -e \
-		"s|#mail_location =|mail_location = ${mail_location}|" \
-		"${confd}/10-mail.conf" \
-		|| die "failed to update mail location settings in 10-mail.conf"
-
-	# We're using pam files (imap and pop3) provided by mailbase
-	if use pam; then
-		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
-			"${confd}/auth-system.conf.ext" \
-			|| die "failed to update PAM settings in auth-system.conf.ext"
-		# mailbase does not provide a sieve pam file
-		use managesieve && dosym imap /etc/pam.d/sieve
-		sed -i -e \
-			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update PAM settings in 10-auth.conf"
-	fi
-
-	# Disable ipv6 if necessary
-	if ! use ipv6; then
-		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
-			|| die "failed to update listen settings in dovecot.conf"
-	fi
-
-	# Update ssl cert locations
-	if use ssl; then
-		sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
-		|| die "ssl conf failed"
-		sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
-			-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
-			"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
-	fi
-
-	# Install SQL configuration
-	if use mysql || use postgres; then
-		sed -i -e \
-			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
-			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
-			10-auth.conf"
-	fi
-
-	# Install LDAP configuration
-	if use ldap; then
-		sed -i -e \
-			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update ldap settings in 10-auth.conf"
-	fi
-
-	if use vpopmail; then
-		sed -i -e \
-			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update vpopmail settings in 10-auth.conf"
-	fi
-
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake DESTDIR="${ED}" install
-		sed -i -e \
-			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
-			|| die "failed to update sieve settings in 15-lda.conf"
-		rm -rf "${ED}"/usr/share/doc/dovecot
-		docinto example-config/conf.d
-		dodoc doc/example-config/conf.d/*.conf
-		insinto /etc/dovecot/conf.d
-		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
-		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
-		docinto sieve/rfc
-		dodoc doc/rfc/*.txt
-		docinto sieve/devel
-		dodoc doc/devel/DESIGN
-		docinto plugins
-		dodoc doc/plugins/*.txt
-		docinto extensions
-		dodoc doc/extensions/*.txt
-		docinto locations
-		dodoc doc/locations/*.txt
-		doman doc/man/*.{1,7}
-	fi
-
-	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
-}
-
-pkg_postinst() {
-	if use ssl; then
-	# Let's not make a new certificate if we already have one
-		if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
-		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
-			einfo "Creating SSL	certificate"
-			SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
-			install_cert /etc/ssl/dovecot/server
-		fi
-	fi
-
-	elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
-}

diff --git a/net-mail/dovecot/dovecot-2.2.18.ebuild b/net-mail/dovecot/dovecot-2.2.18.ebuild
deleted file mode 100644
index 90bfebf..0000000
--- a/net-mail/dovecot/dovecot-2.2.18.ebuild
+++ /dev/null
@@ -1,303 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit eutils multilib ssl-cert systemd user versionator
-
-MY_P="${P/_/.}"
-major_minor="$(get_version_component_range 1-2)"
-sieve_version="0.4.8"
-if [[ ${PV} == *_rc* ]] ; then
-	rc_dir="rc/"
-else
-	rc_dir=""
-fi
-SRC_URI="http://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
-	sieve? (
-	http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	)
-	managesieve? (
-	http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	) "
-DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
-HOMEPAGE="http://www.dovecot.org/"
-
-SLOT="0"
-LICENSE="LGPL-2.1 MIT"
-KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 x86"
-
-IUSE_DOVECOT_AUTH="kerberos ldap mysql pam postgres sqlite vpopmail"
-IUSE_DOVECOT_STORAGE="cydir imapc +maildir mbox mdbox pop3c sdbox"
-IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
-IUSE_DOVECOT_OTHER="caps doc ipv6 lucene managesieve selinux sieve solr +ssl static-libs suid tcpd"
-
-IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
-
-DEPEND="bzip2? ( app-arch/bzip2 )
-	caps? ( sys-libs/libcap )
-	kerberos? ( virtual/krb5 )
-	ldap? ( net-nds/openldap )
-	lucene? ( >=dev-cpp/clucene-2.3 )
-	lzma? ( app-arch/xz-utils )
-	lz4? ( app-arch/lz4 )
-	mysql? ( virtual/mysql )
-	pam? ( virtual/pam )
-	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
-	selinux? ( sec-policy/selinux-dovecot )
-	solr? ( net-misc/curl dev-libs/expat )
-	sqlite? ( dev-db/sqlite:* )
-	ssl? ( dev-libs/openssl:* )
-	tcpd? ( sys-apps/tcp-wrappers )
-	vpopmail? ( net-mail/vpopmail )
-	zlib? ( sys-libs/zlib )
-	virtual/libiconv
-	dev-libs/icu:="
-
-RDEPEND="${DEPEND}
-	net-mail/mailbase"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if use managesieve && ! use sieve; then
-		ewarn "managesieve USE flag selected but sieve USE flag unselected"
-		ewarn "sieve USE flag will be turned on"
-	fi
-	# default internal user
-	enewgroup dovecot 97
-	enewuser dovecot 97 -1 /dev/null dovecot
-	# default login user
-	enewuser dovenull -1 -1 /dev/null
-	# add "mail" group for suid'ing. Better security isolation.
-	if use suid; then
-		enewgroup mail
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}/${PN}-10-ssl.patch"
-
-	epatch_user
-}
-
-src_configure() {
-	local conf=""
-
-	if use postgres || use mysql || use sqlite; then
-		conf="${conf} --with-sql"
-	fi
-
-	local storages=""
-	for storage in ${IUSE_DOVECOT_STORAGE//+/}; do
-		use ${storage} && storages="${storage} ${storages}"
-	done
-	[ "${storages}" ] || storages="maildir"
-
-	# turn valgrind tests off. Bug #340791
-	VALGRIND=no econf \
-		--localstatedir="${EPREFIX}/var" \
-		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
-		--without-stemmer \
-		--with-storages="${storages}" \
-		--disable-rpath \
-		--with-icu \
-		$( systemd_with_unitdir ) \
-		$( use_with bzip2 bzlib ) \
-		$( use_with caps libcap ) \
-		$( use_with kerberos gssapi ) \
-		$( use_with ldap ) \
-		$( use_with lucene ) \
-		$( use_with lz4 ) \
-		$( use_with lzma ) \
-		$( use_with mysql ) \
-		$( use_with pam ) \
-		$( use_with postgres pgsql ) \
-		$( use_with sqlite ) \
-		$( use_with solr ) \
-		$( use_with ssl ) \
-		$( use_with tcpd libwrap ) \
-		$( use_with vpopmail ) \
-		$( use_with zlib ) \
-		$( use_enable static-libs static ) \
-		${conf}
-
-	if use sieve || use managesieve ; then
-		# The sieve plugin needs this file to be build to determine the plugin
-		# directory and the list of libraries to link to.
-		emake dovecot-config
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		econf \
-			$( use_enable static-libs static ) \
-			--localstatedir="${EPREFIX}/var" \
-			--enable-shared \
-			--with-dovecot="../${MY_P}" \
-			$( use_with managesieve )
-	fi
-}
-
-src_compile() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
-	fi
-}
-
-src_test() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		default
-	fi
-}
-
-src_install () {
-	default
-
-	# insecure:
-	# use suid && fperms u+s /usr/libexec/dovecot/deliver
-	# better:
-	if use suid;then
-		einfo "Changing perms to allow deliver to be suided"
-		fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-		fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-	fi
-
-	newinitd "${FILESDIR}"/dovecot.init-r4 dovecot
-
-	rm -rf "${ED}"/usr/share/doc/dovecot
-
-	dodoc AUTHORS NEWS README TODO
-	dodoc doc/*.{txt,cnf,xml,sh}
-	docinto example-config
-	dodoc doc/example-config/*.{conf,ext}
-	docinto example-config/conf.d
-	dodoc doc/example-config/conf.d/*.{conf,ext}
-	docinto wiki
-	dodoc doc/wiki/*
-	doman doc/man/*.{1,7}
-
-	# Create the dovecot.conf file from the dovecot-example.conf file that
-	# the dovecot folks nicely left for us....
-	local conf="${ED}/etc/dovecot/dovecot.conf"
-	local confd="${ED}/etc/dovecot/conf.d"
-
-	insinto /etc/dovecot
-	doins doc/example-config/*.{conf,ext}
-	insinto /etc/dovecot/conf.d
-	doins doc/example-config/conf.d/*.{conf,ext}
-	fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
-	rm -f "${confd}/../README"
-
-	# .maildir is the Gentoo default
-	local mail_location="maildir:~/.maildir"
-	if ! use maildir; then
-		if use mbox; then
-			mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u"
-			keepdir /var/dovecot
-			sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' \
-			"${confd}/10-mail.conf" || die "sed failed"
-		elif use mdbox ; then
-			mail_location="mdbox:~/.mdbox"
-		elif use sdbox ; then
-			mail_location="sdbox:~/.sdbox"
-		fi
-	fi
-	sed -i -e \
-		"s|#mail_location =|mail_location = ${mail_location}|" \
-		"${confd}/10-mail.conf" \
-		|| die "failed to update mail location settings in 10-mail.conf"
-
-	# We're using pam files (imap and pop3) provided by mailbase
-	if use pam; then
-		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
-			"${confd}/auth-system.conf.ext" \
-			|| die "failed to update PAM settings in auth-system.conf.ext"
-		# mailbase does not provide a sieve pam file
-		use managesieve && dosym imap /etc/pam.d/sieve
-		sed -i -e \
-			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update PAM settings in 10-auth.conf"
-	fi
-
-	# Disable ipv6 if necessary
-	if ! use ipv6; then
-		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
-			|| die "failed to update listen settings in dovecot.conf"
-	fi
-
-	# Update ssl cert locations
-	if use ssl; then
-		sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
-		|| die "ssl conf failed"
-		sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
-			-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
-			"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
-	fi
-
-	# Install SQL configuration
-	if use mysql || use postgres; then
-		sed -i -e \
-			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
-			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
-			10-auth.conf"
-	fi
-
-	# Install LDAP configuration
-	if use ldap; then
-		sed -i -e \
-			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update ldap settings in 10-auth.conf"
-	fi
-
-	if use vpopmail; then
-		sed -i -e \
-			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update vpopmail settings in 10-auth.conf"
-	fi
-
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake DESTDIR="${ED}" install
-		sed -i -e \
-			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
-			|| die "failed to update sieve settings in 15-lda.conf"
-		rm -rf "${ED}"/usr/share/doc/dovecot
-		docinto example-config/conf.d
-		dodoc doc/example-config/conf.d/*.conf
-		insinto /etc/dovecot/conf.d
-		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
-		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
-		docinto sieve/rfc
-		dodoc doc/rfc/*.txt
-		docinto sieve/devel
-		dodoc doc/devel/DESIGN
-		docinto plugins
-		dodoc doc/plugins/*.txt
-		docinto extensions
-		dodoc doc/extensions/*.txt
-		docinto locations
-		dodoc doc/locations/*.txt
-		doman doc/man/*.{1,7}
-	fi
-
-	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
-}
-
-pkg_postinst() {
-	if use ssl; then
-	# Let's not make a new certificate if we already have one
-		if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
-		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
-			einfo "Creating SSL	certificate"
-			SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
-			install_cert /etc/ssl/dovecot/server
-		fi
-	fi
-
-	elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
-}

diff --git a/net-mail/dovecot/files/CVE-2015-3420.patch b/net-mail/dovecot/files/CVE-2015-3420.patch
deleted file mode 100644
index 9bf389c..0000000
--- a/net-mail/dovecot/files/CVE-2015-3420.patch
+++ /dev/null
@@ -1,52 +0,0 @@
---- a/src/login-common/ssl-proxy-openssl.c	Sat Apr 25 12:16:07 2015 +0300
-+++ b/src/login-common/ssl-proxy-openssl.c	Tue Apr 28 11:27:04 2015 +0200
-@@ -80,6 +80,7 @@
- 	unsigned int cert_broken:1;
- 	unsigned int client_proxy:1;
- 	unsigned int flushing:1;
-+	unsigned int failed:1;
- };
- 
- struct ssl_parameters {
-@@ -131,6 +132,12 @@
- static int ssl_proxy_ctx_get_pkey_ec_curve_name(const struct master_service_ssl_settings *set);
- #endif
- 
-+static void ssl_proxy_destroy_failed(struct ssl_proxy *proxy)
-+{
-+	proxy->failed = TRUE;
-+	ssl_proxy_destroy(proxy);
-+}
-+
- static unsigned int ssl_server_context_hash(const struct ssl_server_context *ctx)
- {
- 	unsigned int i, g, h = 0;
-@@ -462,7 +469,7 @@
- 
- 	if (errstr != NULL) {
- 		proxy->last_error = i_strdup(errstr);
--		ssl_proxy_destroy(proxy);
-+		ssl_proxy_destroy_failed(proxy);
- 	}
- 	ssl_proxy_unref(proxy);
- }
-@@ -492,7 +499,7 @@
- 
- 	if (proxy->handshake_callback != NULL) {
- 		if (proxy->handshake_callback(proxy->handshake_context) < 0)
--			ssl_proxy_destroy(proxy);
-+			ssl_proxy_destroy_failed(proxy);
- 	}
- }
- 
-@@ -822,7 +829,8 @@
- 	if (proxy->destroyed || proxy->flushing)
- 		return;
- 	proxy->flushing = TRUE;
--	ssl_proxy_flush(proxy);
-+	if (!proxy->failed && proxy->handshaked)
-+		ssl_proxy_flush(proxy);
- 	proxy->destroyed = TRUE;
- 
- 	ssl_proxy_count--;
-


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2018-02-01  1:18 Thomas Deutschmann
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Deutschmann @ 2018-02-01  1:18 UTC (permalink / raw
  To: gentoo-commits

commit:     e3acd4d22b48eca30b27ce4694e4ae1de51fba40
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  1 01:18:17 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Feb  1 01:18:17 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3acd4d2

net-mail/dovecot: bump, fixup for problem caused by patch for CVE-2017-15132

Dovecot login process would crash after few minutes of idle after
consecutive aborted logins when patch for CVE-2017-15132 was applied.

Bug: https://bugs.gentoo.org/644214
Package-Manager: Portage-2.3.21, Repoman-2.3.6

 net-mail/dovecot/dovecot-2.2.33.2-r2.ebuild        | 292 +++++++++++++++++++++
 net-mail/dovecot/dovecot-2.3.0-r3.ebuild           | 289 ++++++++++++++++++++
 .../dovecot-2.2.33.2-CVE-2017-15132-fixup.patch    |  37 +++
 3 files changed, 618 insertions(+)

diff --git a/net-mail/dovecot/dovecot-2.2.33.2-r2.ebuild b/net-mail/dovecot/dovecot-2.2.33.2-r2.ebuild
new file mode 100644
index 00000000000..3ff57c442d7
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.2.33.2-r2.ebuild
@@ -0,0 +1,292 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit ssl-cert systemd user versionator
+
+MY_P="${P/_/.}"
+major_minor="$(get_version_component_range 1-2)"
+sieve_version="0.4.21"
+if [[ ${PV} == *_rc* ]] ; then
+	rc_dir="rc/"
+else
+	rc_dir=""
+fi
+SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
+	sieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	)
+	managesieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	) "
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
+HOMEPAGE="http://www.dovecot.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+IUSE_DOVECOT_AUTH="kerberos ldap mysql pam postgres sqlite vpopmail"
+IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
+IUSE_DOVECOT_OTHER="caps doc ipv6 libressl lucene managesieve selinux sieve solr +ssl static-libs suid tcpd textcat"
+
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
+
+DEPEND="bzip2? ( app-arch/bzip2 )
+	caps? ( sys-libs/libcap )
+	kerberos? ( virtual/krb5 )
+	ldap? ( net-nds/openldap )
+	lucene? ( >=dev-cpp/clucene-2.3 )
+	lzma? ( app-arch/xz-utils )
+	lz4? ( app-arch/lz4 )
+	mysql? ( virtual/mysql )
+	pam? ( virtual/pam )
+	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
+	selinux? ( sec-policy/selinux-dovecot )
+	solr? ( net-misc/curl dev-libs/expat )
+	sqlite? ( dev-db/sqlite:* )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0 )
+		libressl? ( dev-libs/libressl )
+	)
+	tcpd? ( sys-apps/tcp-wrappers )
+	textcat? ( app-text/libexttextcat )
+	vpopmail? ( net-mail/vpopmail )
+	zlib? ( sys-libs/zlib )
+	virtual/libiconv
+	dev-libs/icu:="
+
+RDEPEND="${DEPEND}
+	net-mail/mailbase"
+
+# Dovecot does not support building without ssl.  Force it for now
+REQUIRED_USE="ssl"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+	if use managesieve && ! use sieve; then
+		ewarn "managesieve USE flag selected but sieve USE flag unselected"
+		ewarn "sieve USE flag will be turned on"
+	fi
+	# default internal user
+	enewgroup dovecot 97
+	enewuser dovecot 97 -1 /dev/null dovecot
+	# default login user
+	enewuser dovenull -1 -1 /dev/null
+	# add "mail" group for suid'ing. Better security isolation.
+	if use suid; then
+		enewgroup mail
+	fi
+}
+
+src_prepare() {
+	eapply -p0 "${FILESDIR}/${PN}-10-ssl.patch"
+	eapply "${FILESDIR}/${PN}-2.2.33.2-CVE-2017-15132.patch"
+	eapply "${FILESDIR}/${PN}-2.2.33.2-CVE-2017-15132-fixup.patch"
+	eapply_user
+}
+
+src_configure() {
+	local conf=""
+
+	if use postgres || use mysql || use sqlite; then
+		conf="${conf} --with-sql"
+	fi
+
+	# turn valgrind tests off. Bug #340791
+	VALGRIND=no econf \
+		--localstatedir="${EPREFIX}/var" \
+		--runstatedir="${EPREFIX}/run" \
+		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
+		--without-stemmer \
+		--disable-rpath \
+		--with-icu \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		$( use_with bzip2 bzlib ) \
+		$( use_with caps libcap ) \
+		$( use_with kerberos gssapi ) \
+		$( use_with ldap ) \
+		$( use_with lucene ) \
+		$( use_with lz4 ) \
+		$( use_with lzma ) \
+		$( use_with mysql ) \
+		$( use_with pam ) \
+		$( use_with postgres pgsql ) \
+		$( use_with sqlite ) \
+		$( use_with solr ) \
+		$( use_with ssl ) \
+		$( use_with tcpd libwrap ) \
+		$( use_with textcat ) \
+		$( use_with vpopmail ) \
+		$( use_with zlib ) \
+		$( use_enable static-libs static ) \
+		${conf}
+
+	if use sieve || use managesieve ; then
+		# The sieve plugin needs this file to be build to determine the plugin
+		# directory and the list of libraries to link to.
+		emake dovecot-config
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		econf \
+			$( use_enable static-libs static ) \
+			--localstatedir="${EPREFIX}/var" \
+			--enable-shared \
+			--with-dovecot="../${MY_P}" \
+			$( use_with managesieve )
+	fi
+}
+
+src_compile() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+	fi
+}
+
+src_test() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		default
+	fi
+}
+
+src_install () {
+	default
+
+	# insecure:
+	# use suid && fperms u+s /usr/libexec/dovecot/deliver
+	# better:
+	if use suid;then
+		einfo "Changing perms to allow deliver to be suided"
+		fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
+		fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
+	fi
+
+	newinitd "${FILESDIR}"/dovecot.init-r4 dovecot
+
+	rm -rf "${ED}"/usr/share/doc/dovecot
+
+	dodoc AUTHORS NEWS README TODO
+	dodoc doc/*.{txt,cnf,xml,sh}
+	docinto example-config
+	dodoc doc/example-config/*.{conf,ext}
+	docinto example-config/conf.d
+	dodoc doc/example-config/conf.d/*.{conf,ext}
+	docinto wiki
+	dodoc doc/wiki/*
+	doman doc/man/*.{1,7}
+
+	# Create the dovecot.conf file from the dovecot-example.conf file that
+	# the dovecot folks nicely left for us....
+	local conf="${ED}/etc/dovecot/dovecot.conf"
+	local confd="${ED}/etc/dovecot/conf.d"
+
+	insinto /etc/dovecot
+	doins doc/example-config/*.{conf,ext}
+	insinto /etc/dovecot/conf.d
+	doins doc/example-config/conf.d/*.{conf,ext}
+	fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
+	rm -f "${confd}/../README"
+
+	# .maildir is the Gentoo default
+	local mail_location="maildir:~/.maildir"
+	sed -i -e \
+		"s|#mail_location =|mail_location = ${mail_location}|" \
+		"${confd}/10-mail.conf" \
+		|| die "failed to update mail location settings in 10-mail.conf"
+
+	# We're using pam files (imap and pop3) provided by mailbase
+	if use pam; then
+		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
+			"${confd}/auth-system.conf.ext" \
+			|| die "failed to update PAM settings in auth-system.conf.ext"
+		# mailbase does not provide a sieve pam file
+		use managesieve && dosym imap /etc/pam.d/sieve
+		sed -i -e \
+			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update PAM settings in 10-auth.conf"
+	fi
+
+	# Disable ipv6 if necessary
+	if ! use ipv6; then
+		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
+			|| die "failed to update listen settings in dovecot.conf"
+	fi
+
+	# Update ssl cert locations
+	if use ssl; then
+		sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
+		|| die "ssl conf failed"
+		sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
+			-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
+			"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
+	fi
+
+	# Install SQL configuration
+	if use mysql || use postgres; then
+		sed -i -e \
+			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
+			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
+			10-auth.conf"
+	fi
+
+	# Install LDAP configuration
+	if use ldap; then
+		sed -i -e \
+			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update ldap settings in 10-auth.conf"
+	fi
+
+	if use vpopmail; then
+		sed -i -e \
+			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update vpopmail settings in 10-auth.conf"
+	fi
+
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake DESTDIR="${ED}" install
+		sed -i -e \
+			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
+			|| die "failed to update sieve settings in 15-lda.conf"
+		rm -rf "${ED}"/usr/share/doc/dovecot
+		docinto example-config/conf.d
+		dodoc doc/example-config/conf.d/*.conf
+		insinto /etc/dovecot/conf.d
+		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
+		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
+		docinto sieve/rfc
+		dodoc doc/rfc/*.txt
+		docinto sieve/devel
+		dodoc doc/devel/DESIGN
+		docinto plugins
+		dodoc doc/plugins/*.txt
+		docinto extensions
+		dodoc doc/extensions/*.txt
+		docinto locations
+		dodoc doc/locations/*.txt
+		doman doc/man/*.{1,7}
+	fi
+
+	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
+}
+
+pkg_postinst() {
+	if use ssl; then
+	# Let's not make a new certificate if we already have one
+		if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
+		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
+			einfo "Creating SSL	certificate"
+			SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
+			install_cert /etc/ssl/dovecot/server
+		fi
+	fi
+
+	elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
+}

diff --git a/net-mail/dovecot/dovecot-2.3.0-r3.ebuild b/net-mail/dovecot/dovecot-2.3.0-r3.ebuild
new file mode 100644
index 00000000000..df9749698c3
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.3.0-r3.ebuild
@@ -0,0 +1,289 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+# do not add a ssl USE flag.  ssl is mandatory
+SSL_DEPS_SKIP=1
+inherit ssl-cert systemd user versionator
+
+MY_P="${P/_/.}"
+MY_S="${PN}-ce-${PV}"
+major_minor="$(get_version_component_range 1-2)"
+sieve_version="0.5.0.1"
+if [[ ${PV} == *_rc* ]] ; then
+	rc_dir="rc/"
+else
+	rc_dir=""
+fi
+SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
+	sieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	)
+	managesieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	) "
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
+HOMEPAGE="http://www.dovecot.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite vpopmail"
+IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
+IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 libressl lucene managesieve selinux sieve solr static-libs suid tcpd textcat"
+
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
+
+DEPEND="argon2? ( dev-libs/libsodium )
+	bzip2? ( app-arch/bzip2 )
+	caps? ( sys-libs/libcap )
+	kerberos? ( virtual/krb5 )
+	ldap? ( net-nds/openldap )
+	lua? ( dev-lang/lua:* )
+	lucene? ( >=dev-cpp/clucene-2.3 )
+	lzma? ( app-arch/xz-utils )
+	lz4? ( app-arch/lz4 )
+	mysql? ( virtual/mysql )
+	pam? ( virtual/pam )
+	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
+	selinux? ( sec-policy/selinux-dovecot )
+	solr? ( net-misc/curl dev-libs/expat )
+	sqlite? ( dev-db/sqlite:* )
+	!libressl? ( dev-libs/openssl:0 )
+	libressl? ( dev-libs/libressl )
+	tcpd? ( sys-apps/tcp-wrappers )
+	textcat? ( app-text/libexttextcat )
+	vpopmail? ( net-mail/vpopmail )
+	zlib? ( sys-libs/zlib )
+	virtual/libiconv
+	dev-libs/icu:="
+
+RDEPEND="${DEPEND}
+	net-mail/mailbase"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.2.33.2-CVE-2017-15132.patch
+	"${FILESDIR}"/${PN}-2.2.33.2-CVE-2017-15132-fixup.patch
+)
+
+S=${WORKDIR}/${MY_S}
+
+pkg_setup() {
+	if use managesieve && ! use sieve; then
+		ewarn "managesieve USE flag selected but sieve USE flag unselected"
+		ewarn "sieve USE flag will be turned on"
+	fi
+	# default internal user
+	enewgroup dovecot 97
+	enewuser dovecot 97 -1 /dev/null dovecot
+	# default login user
+	enewuser dovenull -1 -1 /dev/null
+	# add "mail" group for suid'ing. Better security isolation.
+	if use suid; then
+		enewgroup mail
+	fi
+}
+
+src_configure() {
+	local conf=""
+
+	if use postgres || use mysql || use sqlite; then
+		conf="${conf} --with-sql"
+	fi
+
+	# turn valgrind tests off. Bug #340791
+	VALGRIND=no econf \
+		--with-rundir="${EPREFIX}/run/dovecot" \
+		--with-statedir="${EPREFIX}/var/lib/dovecot" \
+		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
+		--without-stemmer \
+		--disable-rpath \
+		--without-libbsd \
+		--with-icu \
+		--with-ssl \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		$( use_with argon2 sodium ) \
+		$( use_with bzip2 bzlib ) \
+		$( use_with caps libcap ) \
+		$( use_with kerberos gssapi ) \
+		$( use_with lua ) \
+		$( use_with ldap ) \
+		$( use_with lucene ) \
+		$( use_with lz4 ) \
+		$( use_with lzma ) \
+		$( use_with mysql ) \
+		$( use_with pam ) \
+		$( use_with postgres pgsql ) \
+		$( use_with sqlite ) \
+		$( use_with solr ) \
+		$( use_with tcpd libwrap ) \
+		$( use_with textcat ) \
+		$( use_with vpopmail ) \
+		$( use_with zlib ) \
+		$( use_enable static-libs static ) \
+		${conf}
+
+	if use sieve || use managesieve ; then
+		# The sieve plugin needs this file to be build to determine the plugin
+		# directory and the list of libraries to link to.
+		emake dovecot-config
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		econf \
+			$( use_enable static-libs static ) \
+			--localstatedir="${EPREFIX}/var" \
+			--enable-shared \
+			--with-dovecot="../${MY_S}" \
+			$( use_with managesieve )
+	fi
+}
+
+src_compile() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+	fi
+}
+
+src_test() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		default
+	fi
+}
+
+src_install () {
+	default
+
+	# insecure:
+	# use suid && fperms u+s /usr/libexec/dovecot/deliver
+	# better:
+	if use suid;then
+		einfo "Changing perms to allow deliver to be suided"
+		fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
+		fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
+	fi
+
+	newinitd "${FILESDIR}"/dovecot.init-r4 dovecot
+
+	rm -rf "${ED}"/usr/share/doc/dovecot
+
+	dodoc AUTHORS NEWS README TODO
+	dodoc doc/*.{txt,cnf,xml,sh}
+	docinto example-config
+	dodoc doc/example-config/*.{conf,ext}
+	docinto example-config/conf.d
+	dodoc doc/example-config/conf.d/*.{conf,ext}
+	docinto wiki
+	dodoc doc/wiki/*
+	doman doc/man/*.{1,7}
+
+	# Create the dovecot.conf file from the dovecot-example.conf file that
+	# the dovecot folks nicely left for us....
+	local conf="${ED}/etc/dovecot/dovecot.conf"
+	local confd="${ED}/etc/dovecot/conf.d"
+
+	insinto /etc/dovecot
+	doins doc/example-config/*.{conf,ext}
+	insinto /etc/dovecot/conf.d
+	doins doc/example-config/conf.d/*.{conf,ext}
+	fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
+	rm -f "${confd}/../README"
+
+	# .maildir is the Gentoo default
+	local mail_location="maildir:~/.maildir"
+	sed -i -e \
+		"s|#mail_location =|mail_location = ${mail_location}|" \
+		"${confd}/10-mail.conf" \
+		|| die "failed to update mail location settings in 10-mail.conf"
+
+	# We're using pam files (imap and pop3) provided by mailbase
+	if use pam; then
+		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
+			"${confd}/auth-system.conf.ext" \
+			|| die "failed to update PAM settings in auth-system.conf.ext"
+		# mailbase does not provide a sieve pam file
+		use managesieve && dosym imap /etc/pam.d/sieve
+		sed -i -e \
+			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update PAM settings in 10-auth.conf"
+	fi
+
+	# Disable ipv6 if necessary
+	if ! use ipv6; then
+		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
+			|| die "failed to update listen settings in dovecot.conf"
+	fi
+
+	# Update ssl cert locations
+	sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
+		|| die "ssl conf failed"
+	sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
+		-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
+		"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
+
+	# Install SQL configuration
+	if use mysql || use postgres; then
+		sed -i -e \
+			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
+			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
+			10-auth.conf"
+	fi
+
+	# Install LDAP configuration
+	if use ldap; then
+		sed -i -e \
+			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update ldap settings in 10-auth.conf"
+	fi
+
+	if use vpopmail; then
+		sed -i -e \
+			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update vpopmail settings in 10-auth.conf"
+	fi
+
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake DESTDIR="${ED}" install
+		sed -i -e \
+			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
+			|| die "failed to update sieve settings in 15-lda.conf"
+		rm -rf "${ED}"/usr/share/doc/dovecot
+		docinto example-config/conf.d
+		dodoc doc/example-config/conf.d/*.conf
+		insinto /etc/dovecot/conf.d
+		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
+		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
+		docinto sieve/rfc
+		dodoc doc/rfc/*.txt
+		docinto sieve/devel
+		dodoc doc/devel/DESIGN
+		docinto plugins
+		dodoc doc/plugins/*.txt
+		docinto extensions
+		dodoc doc/extensions/*.txt
+		docinto locations
+		dodoc doc/locations/*.txt
+		doman doc/man/*.{1,7}
+	fi
+
+	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
+}
+
+pkg_postinst() {
+	# Let's not make a new certificate if we already have one
+	if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
+		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
+		einfo "Creating SSL	certificate"
+		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
+		install_cert /etc/ssl/dovecot/server
+	fi
+
+	elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
+}

diff --git a/net-mail/dovecot/files/dovecot-2.2.33.2-CVE-2017-15132-fixup.patch b/net-mail/dovecot/files/dovecot-2.2.33.2-CVE-2017-15132-fixup.patch
new file mode 100644
index 00000000000..c30acf1fd6e
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-2.2.33.2-CVE-2017-15132-fixup.patch
@@ -0,0 +1,37 @@
+Upstream: https://github.com/dovecot/core/commit/a9b135760aea6d1790d447d351c56b78889dac22
+
+Link: http://seclists.org/oss-sec/2018/q1/119
+
+--- a/src/lib-auth/auth-client-request.c
++++ b/src/lib-auth/auth-client-request.c
+@@ -186,6 +186,8 @@ void auth_client_request_abort(struct auth_client_request **_request)
+ 
+ 	auth_client_send_cancel(request->conn->client, request->id);
+ 	call_callback(request, AUTH_REQUEST_STATUS_ABORT, NULL, NULL);
++	/* remove the request */
++	auth_server_connection_remove_request(request->conn, request->id);
+ 	pool_unref(&request->pool);
+ }
+ 
+--- a/src/lib-auth/auth-server-connection.c
++++ b/src/lib-auth/auth-server-connection.c
+@@ -483,3 +483,10 @@ auth_server_connection_add_request(struct auth_server_connection *conn,
+ 	hash_table_insert(conn->requests, POINTER_CAST(id), request);
+ 	return id;
+ }
++
++void auth_server_connection_remove_request(struct auth_server_connection *conn,
++					   unsigned int id)
++{
++	i_assert(conn->handshake_received);
++	hash_table_remove(conn->requests, POINTER_CAST(id));
++}
+--- a/src/lib-auth/auth-server-connection.h
++++ b/src/lib-auth/auth-server-connection.h
+@@ -40,4 +40,6 @@ void auth_server_connection_disconnect(struct auth_server_connection *conn,
+ unsigned int
+ auth_server_connection_add_request(struct auth_server_connection *conn,
+ 				   struct auth_client_request *request);
++void auth_server_connection_remove_request(struct auth_server_connection *conn,
++					   unsigned int id);
+ #endif


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2018-10-05 11:08 Eray Aslan
  0 siblings, 0 replies; 10+ messages in thread
From: Eray Aslan @ 2018-10-05 11:08 UTC (permalink / raw
  To: gentoo-commits

commit:     38b1b5ecb1cc03000e3e9db61cb6537a7b252106
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  5 11:03:52 2018 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Fri Oct  5 11:03:52 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38b1b5ec

net-mail/dovecot: bump to 2.3.3

Closes: https://bugs.gentoo.org/666202
Closes: https://bugs.gentoo.org/667118
Closes: https://bugs.gentoo.org/664988
Signed-off-by: Eray Aslan <eras <AT> gentoo.org>
Package-Manager: Portage-2.3.50, Repoman-2.3.11

 net-mail/dovecot/Manifest                     |   2 +
 net-mail/dovecot/dovecot-2.3.3.ebuild         | 291 ++++++++++++++++++++++++++
 net-mail/dovecot/files/dovecot-glibc228.patch |  44 ++++
 net-mail/dovecot/files/dovecot.init-r5        |  57 +++++
 4 files changed, 394 insertions(+)

diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
index bf8481d15dc..1a99069f813 100644
--- a/net-mail/dovecot/Manifest
+++ b/net-mail/dovecot/Manifest
@@ -5,4 +5,6 @@ DIST dovecot-2.2.19.tar.gz 5256627 BLAKE2B 0b7fe57ced1b1f7eb5e29e8d6723d237cc107
 DIST dovecot-2.2.34.tar.gz 6181270 BLAKE2B dfdb1e6812574e79595202e830167400569adf61155aa5ddaae443e798c4a05ccec2acd2975e00e9e7ffc63ee1dcf7e4e2a9288b1e6e1e1427d1e89790a8fa13 SHA512 9f08a7116a08a08495aa0e7b4cb6b11a924ea61006970487946e338bc79bba7fd7619c345cbf278a74de285d548af04fc66eaaee508185b8b9d7335cf5612055
 DIST dovecot-2.2.36.tar.gz 6239707 BLAKE2B 702bb24265b5fefec9c484b3cca890fb1536ff94d1f2d6c99ee8c294ee4e38091eef5a727f0d4bd03700263286361f55747a22fa74def350710f9e49a4b10580 SHA512 327c50971e276f6013ca7f7bb59498ee88d76c9f8419bd18ee531cf10142214350fb81c6d64eaef73ee01765dd0fcf4142ab146ed67d9d7d86d5a58d41cf8db5
 DIST dovecot-2.3-pigeonhole-0.5.2.tar.gz 1814618 BLAKE2B b1187021673429bee1b45a1f657bea995e9881257919ff55bac63106d65963294ee2b3829167c6d50e351c4bc3c7e88a5ccfb757308d2500c5d4146246145074 SHA512 6bc24d9241f94db795a012346d9bc94b5cc7d7ce0175c03213c2b5d179d80dec95e9bdbd50bed628c8f9f7c51639e692ba5e429212a3b4a654c1e4764ac4f11c
+DIST dovecot-2.3-pigeonhole-0.5.3.tar.gz 1827329 BLAKE2B 0d484906022217b1082233e6a3a20c17bafc68b90ce1c5c956c714d111ffb9ab49a3794e199695bb61a1f3ad6bd46e56e63ee3c140cb01eaa7589ef7bd754b19 SHA512 8403b1976a915836ba875b96825446d46e0d8c7ff245ed1f2b014347fdc78a81f9ed6dbd05bd3b4f1f7072edc5e9a302201cdb375de44436adcbb83919f203f5
 DIST dovecot-2.3.2.1.tar.gz 6797491 BLAKE2B 92b88fd0f0cb8ed6c418bf27c2e1fc4efe13f1ccfb4948ce5eed1a4e76a4e96f0d6770d9841026ec5a515310ebaa4b335063e3516de454db8ba06cc4ee5a00ec SHA512 c085a0d04925485423086736a3c7d919ad0ca9efeff005890382da5333edb68c7d23ccb89fbe2ac44f8f016fc993bf2c669e450794c3ab13463676cbb47c7bf7
+DIST dovecot-2.3.3.tar.gz 6851107 BLAKE2B 87d6e11c8ff59cfe0b49d3561c307535efb09296af617530a4d5a89b4fc12055d006d1b283a4de076f27d59deb64324b96f28620958ad85c38197710c5decdf7 SHA512 8666c4f92f7df883067540f85be9d03dbe6815b58a7f5de55b4292e986e9a2a1ef52c7e0c72dde2bc781fe40d57488b78a99b6b813745b8e4683f1a2fdc1f2ff

diff --git a/net-mail/dovecot/dovecot-2.3.3.ebuild b/net-mail/dovecot/dovecot-2.3.3.ebuild
new file mode 100644
index 00000000000..9d28a2916e9
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.3.3.ebuild
@@ -0,0 +1,291 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+# do not add a ssl USE flag.  ssl is mandatory
+SSL_DEPS_SKIP=1
+inherit autotools ssl-cert systemd user versionator
+
+MY_P="${P/_/.}"
+#MY_S="${PN}-ce-${PV}"
+major_minor="$(get_version_component_range 1-2)"
+sieve_version="0.5.3"
+if [[ ${PV} == *_rc* ]] ; then
+	rc_dir="rc/"
+else
+	rc_dir=""
+fi
+SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
+	sieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	)
+	managesieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	) "
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
+HOMEPAGE="https://www.dovecot.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite vpopmail"
+IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
+IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 libressl lucene managesieve selinux sieve solr static-libs suid tcpd textcat"
+
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
+
+DEPEND="argon2? ( dev-libs/libsodium )
+	bzip2? ( app-arch/bzip2 )
+	caps? ( sys-libs/libcap )
+	kerberos? ( virtual/krb5 )
+	ldap? ( net-nds/openldap )
+	lua? ( dev-lang/lua:* )
+	lucene? ( >=dev-cpp/clucene-2.3 )
+	lzma? ( app-arch/xz-utils )
+	lz4? ( app-arch/lz4 )
+	mysql? ( virtual/mysql )
+	pam? ( virtual/pam )
+	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
+	selinux? ( sec-policy/selinux-dovecot )
+	solr? ( net-misc/curl dev-libs/expat )
+	sqlite? ( dev-db/sqlite:* )
+	!libressl? ( dev-libs/openssl:0 )
+	libressl? ( dev-libs/libressl )
+	tcpd? ( sys-apps/tcp-wrappers )
+	textcat? ( app-text/libexttextcat )
+	vpopmail? ( net-mail/vpopmail )
+	zlib? ( sys-libs/zlib )
+	virtual/libiconv
+	dev-libs/icu:="
+
+RDEPEND="${DEPEND}
+	net-mail/mailbase"
+
+PATCHES=( "${FILESDIR}/${PN}-glibc228.patch" )
+
+pkg_setup() {
+	if use managesieve && ! use sieve; then
+		ewarn "managesieve USE flag selected but sieve USE flag unselected"
+		ewarn "sieve USE flag will be turned on"
+	fi
+	# default internal user
+	enewgroup dovecot 97
+	enewuser dovecot 97 -1 /dev/null dovecot
+	# default login user
+	enewuser dovenull -1 -1 /dev/null
+	# add "mail" group for suid'ing. Better security isolation.
+	if use suid; then
+		enewgroup mail
+	fi
+}
+
+src_prepare() {
+	default
+	# bug 657108
+	# elibtoolize
+	eautoreconf
+}
+
+src_configure() {
+	local conf=""
+
+	if use postgres || use mysql || use sqlite; then
+		conf="${conf} --with-sql"
+	fi
+
+	# turn valgrind tests off. Bug #340791
+	VALGRIND=no econf \
+		--with-rundir="${EPREFIX}/run/dovecot" \
+		--with-statedir="${EPREFIX}/var/lib/dovecot" \
+		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
+		--without-stemmer \
+		--disable-rpath \
+		--without-libbsd \
+		--with-icu \
+		--with-ssl \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		$( use_with argon2 sodium ) \
+		$( use_with bzip2 bzlib ) \
+		$( use_with caps libcap ) \
+		$( use_with kerberos gssapi ) \
+		$( use_with lua ) \
+		$( use_with ldap ) \
+		$( use_with lucene ) \
+		$( use_with lz4 ) \
+		$( use_with lzma ) \
+		$( use_with mysql ) \
+		$( use_with pam ) \
+		$( use_with postgres pgsql ) \
+		$( use_with sqlite ) \
+		$( use_with solr ) \
+		$( use_with tcpd libwrap ) \
+		$( use_with textcat ) \
+		$( use_with vpopmail ) \
+		$( use_with zlib ) \
+		$( use_enable static-libs static ) \
+		${conf}
+
+	if use sieve || use managesieve ; then
+		# The sieve plugin needs this file to be build to determine the plugin
+		# directory and the list of libraries to link to.
+		emake dovecot-config
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		econf \
+			$( use_enable static-libs static ) \
+			--localstatedir="${EPREFIX%/}/var" \
+			--enable-shared \
+			--with-dovecot="${S}" \
+			$( use_with managesieve )
+	fi
+}
+
+src_compile() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+	fi
+}
+
+src_test() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		default
+	fi
+}
+
+src_install () {
+	default
+
+	# insecure:
+	# use suid && fperms u+s /usr/libexec/dovecot/deliver
+	# better:
+	if use suid;then
+		einfo "Changing perms to allow deliver to be suided"
+		fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
+		fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
+	fi
+
+	newinitd "${FILESDIR}"/dovecot.init-r5 dovecot
+
+	rm -rf "${ED}"/usr/share/doc/dovecot
+
+	dodoc AUTHORS NEWS README TODO
+	dodoc doc/*.{txt,cnf,xml,sh}
+	docinto example-config
+	dodoc doc/example-config/*.{conf,ext}
+	docinto example-config/conf.d
+	dodoc doc/example-config/conf.d/*.{conf,ext}
+	docinto wiki
+	dodoc doc/wiki/*
+	doman doc/man/*.{1,7}
+
+	# Create the dovecot.conf file from the dovecot-example.conf file that
+	# the dovecot folks nicely left for us....
+	local conf="${ED}/etc/dovecot/dovecot.conf"
+	local confd="${ED}/etc/dovecot/conf.d"
+
+	insinto /etc/dovecot
+	doins doc/example-config/*.{conf,ext}
+	insinto /etc/dovecot/conf.d
+	doins doc/example-config/conf.d/*.{conf,ext}
+	fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
+	rm -f "${confd}/../README"
+
+	# .maildir is the Gentoo default
+	local mail_location="maildir:~/.maildir"
+	sed -i -e \
+		"s|#mail_location =|mail_location = ${mail_location}|" \
+		"${confd}/10-mail.conf" \
+		|| die "failed to update mail location settings in 10-mail.conf"
+
+	# We're using pam files (imap and pop3) provided by mailbase
+	if use pam; then
+		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
+			"${confd}/auth-system.conf.ext" \
+			|| die "failed to update PAM settings in auth-system.conf.ext"
+		# mailbase does not provide a sieve pam file
+		use managesieve && dosym imap /etc/pam.d/sieve
+		sed -i -e \
+			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update PAM settings in 10-auth.conf"
+	fi
+
+	# Disable ipv6 if necessary
+	if ! use ipv6; then
+		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
+			|| die "failed to update listen settings in dovecot.conf"
+	fi
+
+	# Update ssl cert locations
+	sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
+		|| die "ssl conf failed"
+	sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
+		-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
+		"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
+
+	# Install SQL configuration
+	if use mysql || use postgres; then
+		sed -i -e \
+			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
+			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
+			10-auth.conf"
+	fi
+
+	# Install LDAP configuration
+	if use ldap; then
+		sed -i -e \
+			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update ldap settings in 10-auth.conf"
+	fi
+
+	if use vpopmail; then
+		sed -i -e \
+			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update vpopmail settings in 10-auth.conf"
+	fi
+
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake DESTDIR="${ED}" install
+		sed -i -e \
+			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
+			|| die "failed to update sieve settings in 15-lda.conf"
+		rm -rf "${ED}"/usr/share/doc/dovecot
+		docinto example-config/conf.d
+		dodoc doc/example-config/conf.d/*.conf
+		insinto /etc/dovecot/conf.d
+		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
+		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
+		docinto sieve/rfc
+		dodoc doc/rfc/*.txt
+		docinto sieve/devel
+		dodoc doc/devel/DESIGN
+		docinto plugins
+		dodoc doc/plugins/*.txt
+		docinto extensions
+		dodoc doc/extensions/*.txt
+		docinto locations
+		dodoc doc/locations/*.txt
+		doman doc/man/*.{1,7}
+	fi
+
+	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
+}
+
+pkg_postinst() {
+	# Let's not make a new certificate if we already have one
+	if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
+		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
+		einfo "Creating SSL	certificate"
+		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
+		install_cert /etc/ssl/dovecot/server
+	fi
+
+	elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
+}

diff --git a/net-mail/dovecot/files/dovecot-glibc228.patch b/net-mail/dovecot/files/dovecot-glibc228.patch
new file mode 100644
index 00000000000..9549c12f6e8
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-glibc228.patch
@@ -0,0 +1,44 @@
+From 63a74b9e8e0604486a15a879e7f1a27257322400 Mon Sep 17 00:00:00 2001
+From: Aki Tuomi <aki.tuomi@dovecot.fi>
+Date: Wed, 8 Aug 2018 12:33:20 +0300
+Subject: [PATCH] auth: mycrypt - include crypt.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes crypt usage on glibc-2.28
+
+Reported by Reuben Farrelly
+Patch provided by Thore Bödecker
+---
+ configure.ac       | 2 +-
+ src/auth/mycrypt.c | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index dd545ebfdc..c5d8fae666 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -315,7 +315,7 @@ AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h \
+   quota.h sys/fs/quota_common.h \
+   mntent.h sys/mnttab.h sys/event.h sys/time.h sys/mkdev.h linux/dqblk_xfs.h \
+   xfs/xqm.h execinfo.h ucontext.h malloc_np.h sys/utsname.h sys/vmount.h \
+-  sys/utsname.h glob.h linux/falloc.h ucred.h sys/ucred.h)
++  sys/utsname.h glob.h linux/falloc.h ucred.h sys/ucred.h crypt.h)
+ 
+ CC_CLANG
+ AC_CC_PIE
+diff --git a/src/auth/mycrypt.c b/src/auth/mycrypt.c
+index c49fcf842e..0bd00bc238 100644
+--- a/src/auth/mycrypt.c
++++ b/src/auth/mycrypt.c
+@@ -14,6 +14,9 @@
+ #  define _XPG6 /* Some Solaris versions require this, some break with this */
+ #endif
+ #include <unistd.h>
++#ifdef HAVE_CRYPT_H
++# include <crypt.h>
++#endif
+ 
+ #include "mycrypt.h"
+ 

diff --git a/net-mail/dovecot/files/dovecot.init-r5 b/net-mail/dovecot/files/dovecot.init-r5
new file mode 100644
index 00000000000..8a98603d4b4
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot.init-r5
@@ -0,0 +1,57 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_started_commands="reload"
+
+depend() {
+	need localmount
+	before postfix
+	after bootmisc ldap mysql ntp-client ntpd postgresql saslauthd slapd 
+	use logger net
+}
+
+checkconfig() {
+	DOVECOT_INSTANCE=${SVCNAME##*.}
+	if [ -n "${DOVECOT_INSTANCE}" -a "${SVCNAME}" != "dovecot" ]; then
+		DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf
+	else
+		DOVECOT_CONF=/etc/dovecot/dovecot.conf
+	fi
+	if [ ! -e ${DOVECOT_CONF} ]; then
+		eerror "You will need an ${DOVECOT_CONF} first"
+		return 1
+	fi
+	if [ -x /usr/sbin/dovecot ]; then
+		DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} config -h base_dir)
+	else
+		eerror "dovecot not executable"
+		return 1
+	fi
+	DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/run/dovecot}
+	DOVECOT_PIDFILE=${DOVECOT_BASEDIR}/master.pid
+}
+
+start() {
+	checkconfig || return 1
+	ebegin "Starting ${SVCNAME}"
+	start-stop-daemon --start --exec /usr/sbin/dovecot \
+		--pidfile "${DOVECOT_PIDFILE}" -- -c "${DOVECOT_CONF}"
+	eend $?
+}
+
+stop() {
+	checkconfig || return 1
+	ebegin "Stopping ${SVCNAME}"
+	start-stop-daemon --stop --exec /usr/sbin/dovecot \
+		--pidfile "${DOVECOT_PIDFILE}"
+	eend $?
+}
+
+reload() {
+	checkconfig || return 1
+	ebegin "Reloading ${SVCNAME} configs and restarting auth/login processes"
+	start-stop-daemon --signal HUP --exec /usr/sbin/dovecot \
+		--pidfile "${DOVECOT_PIDFILE}"
+	eend $?
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2019-08-29  5:39 Eray Aslan
  0 siblings, 0 replies; 10+ messages in thread
From: Eray Aslan @ 2019-08-29  5:39 UTC (permalink / raw
  To: gentoo-commits

commit:     d60cbaaa0a76ce52ffb67ee816a831e17bdc108e
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 29 05:39:11 2019 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Thu Aug 29 05:39:29 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d60cbaaa

net-mail/dovecot: cleanup

Package-Manager: Portage-2.3.73, Repoman-2.3.17
Signed-off-by: Eray Aslan <eras <AT> gentoo.org>

 net-mail/dovecot/Manifest                          |   2 -
 net-mail/dovecot/dovecot-2.2.36.3.ebuild           | 287 --------------------
 net-mail/dovecot/dovecot-2.3.6-r1.ebuild           | 291 ---------------------
 .../files/dovecot-no-log-error-tcp_nodelay.patch   |  31 ---
 4 files changed, 611 deletions(-)

diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
index 0a46bd2e538..0c8c6cbed5c 100644
--- a/net-mail/dovecot/Manifest
+++ b/net-mail/dovecot/Manifest
@@ -1,6 +1,4 @@
-DIST dovecot-2.2-pigeonhole-0.4.24.1.tar.gz 1810959 BLAKE2B f24b28dc7422ea4f379e372adf33ebbf7cbb146d55b01dbf40580767a14adf695b0a2726f591c0c34436bd93a8b48ee8a8c4307fffc6b082d9c028ce93e29a0a SHA512 99af8a1f4588d821c7000133c5c173ab05640d3411b826a0978db2d60c9a59d5b330ca2d38aa25aa1163f6d1b669dc97b8303e2bceda554f67d0029d5d0b34fd
 DIST dovecot-2.2-pigeonhole-0.4.24.2.tar.gz 1833284 BLAKE2B bee45fd129aee3d5126bd48b27829e7e266a5c1043411b6b23655bbf32e2f684763b82bff476a954bf7f0c7aae4e038c0892be70776726c7b324e409a8f89d78 SHA512 a51de88bcbac83ced7d314a560bd44f119dd80bf58f350da522501f072c0a4c02ff8c11152e2b858f14bb8ca9a9b665960cbe37a0c8ef4600b430e65ddbf3bf4
-DIST dovecot-2.2.36.3.tar.gz 6270735 BLAKE2B 90bd6f7cd3769040215f574bb368c1ad835041fff54273e2477be2d2e057c1700472b08a24ed3a7cad469bd39449d94986bc6801373bb97a63975ddbb54cefa5 SHA512 47611dbde7ee854ad323dcdb726757c7172376761fa774f28fce3f9d74ed590319d812f0555abed5f8178c326c3cb7661ac0b708ca5982914e255cec60f72e35
 DIST dovecot-2.2.36.4.tar.gz 6257899 BLAKE2B 3260e96f369e85f2dfd5ece0d9b12902c7192d057369e8a151cc6ab7b4f2033d4e1029fb862d412f2837fd384d7fe729cf1ab15cac9ac335e943bb1fdb532b51 SHA512 e33ab2f6c5f7b4ffca3d57580329f1df8e1655c755a1a6b575a4e49d57ea94d1ab67df2419033c9d68acf5959c6edfa596815dc2bc43798e9aef3d17d271cc4d
 DIST dovecot-2.3-pigeonhole-0.5.6.tar.gz 1854287 BLAKE2B a26edf2a298d8c3de0d9977d56583bd2e0933495c5f554871a38d7b9e31701ebf3587d221c5ec398721a9c34816918c41b069de39c13f879334f9776fede1a17 SHA512 998a046d2eb5ff7bba615fd1a3efdfb1e7e1dabf191257f7fa2882074acc1735a0a4c11c5f31bab1e964b0118f1a8e9e51b3d5529b8fff6d1312c9a8257d9c20
 DIST dovecot-2.3-pigeonhole-0.5.7.1.tar.gz 1857291 BLAKE2B 09763c87099ac50fbe86870855b100379a9b2a72d6077438bbf1f76ff3aed162ad781be27e6587a9742819137f6636f142a220f3b46d3c46115b10cbf4cb2efc SHA512 121eac4ad8bc1ddc55c554d00338bb553590b6aedffcb11e34f6cba102d59bd34580cb7218bd5fe820038c004d12db73f7a27ca135c3d4a12c4449bae3216355

diff --git a/net-mail/dovecot/dovecot-2.2.36.3.ebuild b/net-mail/dovecot/dovecot-2.2.36.3.ebuild
deleted file mode 100644
index 9e06b4534ad..00000000000
--- a/net-mail/dovecot/dovecot-2.2.36.3.ebuild
+++ /dev/null
@@ -1,287 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# do not add a ssl USE flag.  ssl is mandatory
-SSL_DEPS_SKIP=1
-inherit autotools eapi7-ver ssl-cert systemd user versionator
-
-MY_P="${P/_/.}"
-major_minor="$(ver_cut 1-2)"
-sieve_version="0.4.24.1"
-if [[ ${PV} == *_rc* ]] ; then
-	rc_dir="rc/"
-else
-	rc_dir=""
-fi
-SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
-	sieve? (
-	https://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	)
-	managesieve? (
-	https://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	) "
-DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
-HOMEPAGE="https://www.dovecot.org/"
-
-SLOT="0"
-LICENSE="LGPL-2.1 MIT"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
-
-IUSE_DOVECOT_AUTH="kerberos ldap mysql pam postgres sqlite vpopmail"
-IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
-IUSE_DOVECOT_OTHER="caps doc ipv6 libressl lucene managesieve selinux sieve solr static-libs suid tcpd textcat"
-
-IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
-
-DEPEND="bzip2? ( app-arch/bzip2 )
-	caps? ( sys-libs/libcap )
-	kerberos? ( virtual/krb5 )
-	ldap? ( net-nds/openldap )
-	lucene? ( >=dev-cpp/clucene-2.3 )
-	lzma? ( app-arch/xz-utils )
-	lz4? ( app-arch/lz4 )
-	mysql? ( dev-db/mysql-connector-c:0= )
-	pam? ( virtual/pam )
-	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
-	selinux? ( sec-policy/selinux-dovecot )
-	solr? ( net-misc/curl dev-libs/expat )
-	sqlite? ( dev-db/sqlite:* )
-	!libressl? ( dev-libs/openssl:0 )
-	libressl? ( dev-libs/libressl )
-	tcpd? ( sys-apps/tcp-wrappers )
-	textcat? ( app-text/libexttextcat )
-	vpopmail? ( net-mail/vpopmail )
-	zlib? ( sys-libs/zlib )
-	virtual/libiconv
-	dev-libs/icu:="
-
-RDEPEND="${DEPEND}
-	net-mail/mailbase"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-userdb-passwd-fix.patch"
-)
-
-pkg_setup() {
-	if use managesieve && ! use sieve; then
-		ewarn "managesieve USE flag selected but sieve USE flag unselected"
-		ewarn "sieve USE flag will be turned on"
-	fi
-	# default internal user
-	enewgroup dovecot 97
-	enewuser dovecot 97 -1 /dev/null dovecot
-	# default login user
-	enewuser dovenull -1 -1 /dev/null
-	# add "mail" group for suid'ing. Better security isolation.
-	if use suid; then
-		enewgroup mail
-	fi
-}
-
-src_prepare() {
-	default
-	# bug 657108
-	elibtoolize
-}
-
-src_configure() {
-	local conf=""
-
-	if use postgres || use mysql || use sqlite; then
-		conf="${conf} --with-sql"
-	fi
-
-	# turn valgrind tests off. Bug #340791
-	VALGRIND=no econf \
-		--with-statedir="${EPREFIX}/var/lib/dovecot" \
-		--with-rundir="${EPREFIX}/run/dovecot" \
-		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
-		--without-stemmer \
-		--disable-rpath \
-		--with-icu \
-		--with-ssl \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		$( use_with bzip2 bzlib ) \
-		$( use_with caps libcap ) \
-		$( use_with kerberos gssapi ) \
-		$( use_with ldap ) \
-		$( use_with lucene ) \
-		$( use_with lz4 ) \
-		$( use_with lzma ) \
-		$( use_with mysql ) \
-		$( use_with pam ) \
-		$( use_with postgres pgsql ) \
-		$( use_with sqlite ) \
-		$( use_with solr ) \
-		$( use_with tcpd libwrap ) \
-		$( use_with textcat ) \
-		$( use_with vpopmail ) \
-		$( use_with zlib ) \
-		$( use_enable static-libs static ) \
-		${conf}
-
-	if use sieve || use managesieve ; then
-		# The sieve plugin needs this file to be build to determine the plugin
-		# directory and the list of libraries to link to.
-		emake dovecot-config
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		econf \
-			$( use_enable static-libs static ) \
-			--localstatedir="${EPREFIX}/var" \
-			--enable-shared \
-			--with-dovecot="${S}" \
-			$( use_with managesieve )
-	fi
-}
-
-src_compile() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
-	fi
-}
-
-src_test() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		default
-	fi
-}
-
-src_install () {
-	default
-
-	# insecure:
-	# use suid && fperms u+s /usr/libexec/dovecot/deliver
-	# better:
-	if use suid;then
-		einfo "Changing perms to allow deliver to be suided"
-		fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-		fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-	fi
-
-	newinitd "${FILESDIR}"/dovecot.init-r6 dovecot
-
-	rm -rf "${ED}"/usr/share/doc/dovecot
-
-	dodoc AUTHORS NEWS README TODO
-	dodoc doc/*.{txt,cnf,xml,sh}
-	docinto example-config
-	dodoc doc/example-config/*.{conf,ext}
-	docinto example-config/conf.d
-	dodoc doc/example-config/conf.d/*.{conf,ext}
-	docinto wiki
-	dodoc doc/wiki/*
-	doman doc/man/*.{1,7}
-
-	# Create the dovecot.conf file from the dovecot-example.conf file that
-	# the dovecot folks nicely left for us....
-	local conf="${ED}/etc/dovecot/dovecot.conf"
-	local confd="${ED}/etc/dovecot/conf.d"
-
-	insinto /etc/dovecot
-	doins doc/example-config/*.{conf,ext}
-	insinto /etc/dovecot/conf.d
-	doins doc/example-config/conf.d/*.{conf,ext}
-	fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
-	rm -f "${confd}/../README"
-
-	# .maildir is the Gentoo default
-	local mail_location="maildir:~/.maildir"
-	sed -i -e \
-		"s|#mail_location =|mail_location = ${mail_location}|" \
-		"${confd}/10-mail.conf" \
-		|| die "failed to update mail location settings in 10-mail.conf"
-
-	# We're using pam files (imap and pop3) provided by mailbase
-	if use pam; then
-		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
-			"${confd}/auth-system.conf.ext" \
-			|| die "failed to update PAM settings in auth-system.conf.ext"
-		# mailbase does not provide a sieve pam file
-		use managesieve && dosym imap /etc/pam.d/sieve
-		sed -i -e \
-			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update PAM settings in 10-auth.conf"
-	fi
-
-	# Disable ipv6 if necessary
-	if ! use ipv6; then
-		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
-			|| die "failed to update listen settings in dovecot.conf"
-	fi
-
-	# Update ssl cert locations
-	sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
-		|| die "ssl conf failed"
-	sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
-		-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
-		"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
-
-	# Install SQL configuration
-	if use mysql || use postgres; then
-		sed -i -e \
-			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
-			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
-			10-auth.conf"
-	fi
-
-	# Install LDAP configuration
-	if use ldap; then
-		sed -i -e \
-			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update ldap settings in 10-auth.conf"
-	fi
-
-	if use vpopmail; then
-		sed -i -e \
-			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update vpopmail settings in 10-auth.conf"
-	fi
-
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake DESTDIR="${ED}" install
-		sed -i -e \
-			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
-			|| die "failed to update sieve settings in 15-lda.conf"
-		rm -rf "${ED}"/usr/share/doc/dovecot
-		docinto example-config/conf.d
-		dodoc doc/example-config/conf.d/*.conf
-		insinto /etc/dovecot/conf.d
-		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
-		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
-		docinto sieve/rfc
-		dodoc doc/rfc/*.txt
-		docinto sieve/devel
-		dodoc doc/devel/DESIGN
-		docinto plugins
-		dodoc doc/plugins/*.txt
-		docinto extensions
-		dodoc doc/extensions/*.txt
-		docinto locations
-		dodoc doc/locations/*.txt
-		doman doc/man/*.{1,7}
-	fi
-
-	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
-}
-
-pkg_postinst() {
-	# Let's not make a new certificate if we already have one
-	if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
-	-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
-		einfo "Creating SSL	certificate"
-		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
-		install_cert /etc/ssl/dovecot/server
-	fi
-
-	elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
-}

diff --git a/net-mail/dovecot/dovecot-2.3.6-r1.ebuild b/net-mail/dovecot/dovecot-2.3.6-r1.ebuild
deleted file mode 100644
index 20f2b5332e0..00000000000
--- a/net-mail/dovecot/dovecot-2.3.6-r1.ebuild
+++ /dev/null
@@ -1,291 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# do not add a ssl USE flag.  ssl is mandatory
-SSL_DEPS_SKIP=1
-inherit autotools eapi7-ver ssl-cert systemd user
-
-MY_P="${P/_/.}"
-#MY_S="${PN}-ce-${PV}"
-major_minor="$(ver_cut 1-2)"
-sieve_version="0.5.6"
-if [[ ${PV} == *_rc* ]] ; then
-	rc_dir="rc/"
-else
-	rc_dir=""
-fi
-SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
-	sieve? (
-	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	)
-	managesieve? (
-	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
-	) "
-DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
-HOMEPAGE="https://www.dovecot.org/"
-
-SLOT="0"
-LICENSE="LGPL-2.1 MIT"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
-
-IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite vpopmail"
-IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
-IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 libressl lucene managesieve selinux sieve solr static-libs suid tcpd textcat"
-
-IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
-
-DEPEND="argon2? ( dev-libs/libsodium )
-	bzip2? ( app-arch/bzip2 )
-	caps? ( sys-libs/libcap )
-	kerberos? ( virtual/krb5 )
-	ldap? ( net-nds/openldap )
-	lua? ( dev-lang/lua:* )
-	lucene? ( >=dev-cpp/clucene-2.3 )
-	lzma? ( app-arch/xz-utils )
-	lz4? ( app-arch/lz4 )
-	mysql? ( dev-db/mysql-connector-c:0= )
-	pam? ( virtual/pam )
-	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
-	selinux? ( sec-policy/selinux-dovecot )
-	solr? ( net-misc/curl dev-libs/expat )
-	sqlite? ( dev-db/sqlite:* )
-	!libressl? ( dev-libs/openssl:0 )
-	libressl? ( dev-libs/libressl )
-	suid? ( acct-group/mail )
-	tcpd? ( sys-apps/tcp-wrappers )
-	textcat? ( app-text/libexttextcat )
-	vpopmail? ( net-mail/vpopmail )
-	zlib? ( sys-libs/zlib )
-	virtual/libiconv
-	dev-libs/icu:="
-
-RDEPEND="${DEPEND}
-	net-mail/mailbase"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-userdb-passwd-fix.patch"
-)
-
-pkg_setup() {
-	if use managesieve && ! use sieve; then
-		ewarn "managesieve USE flag selected but sieve USE flag unselected"
-		ewarn "sieve USE flag will be turned on"
-	fi
-	# default internal user
-	enewgroup dovecot 97
-	enewuser dovecot 97 -1 /dev/null dovecot
-	# default login user
-	enewuser dovenull -1 -1 /dev/null
-}
-
-src_prepare() {
-	default
-	# bug 657108
-	elibtoolize
-	#eautoreconf
-}
-
-src_configure() {
-	local conf=""
-
-	if use postgres || use mysql || use sqlite; then
-		conf="${conf} --with-sql"
-	fi
-
-	# turn valgrind tests off. Bug #340791
-	VALGRIND=no econf \
-		--with-rundir="${EPREFIX}/run/dovecot" \
-		--with-statedir="${EPREFIX}/var/lib/dovecot" \
-		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
-		--without-stemmer \
-		--disable-rpath \
-		--without-libbsd \
-		--with-icu \
-		--with-ssl \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		$( use_with argon2 sodium ) \
-		$( use_with bzip2 bzlib ) \
-		$( use_with caps libcap ) \
-		$( use_with kerberos gssapi ) \
-		$( use_with lua ) \
-		$( use_with ldap ) \
-		$( use_with lucene ) \
-		$( use_with lz4 ) \
-		$( use_with lzma ) \
-		$( use_with mysql ) \
-		$( use_with pam ) \
-		$( use_with postgres pgsql ) \
-		$( use_with sqlite ) \
-		$( use_with solr ) \
-		$( use_with tcpd libwrap ) \
-		$( use_with textcat ) \
-		$( use_with vpopmail ) \
-		$( use_with zlib ) \
-		$( use_enable static-libs static ) \
-		${conf}
-
-	if use sieve || use managesieve ; then
-		# The sieve plugin needs this file to be build to determine the plugin
-		# directory and the list of libraries to link to.
-		emake dovecot-config
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		econf \
-			$( use_enable static-libs static ) \
-			--localstatedir="${EPREFIX%/}/var" \
-			--enable-shared \
-			--with-dovecot="${S}" \
-			$( use_with managesieve )
-	fi
-}
-
-src_compile() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
-	fi
-}
-
-src_test() {
-	default
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		default
-	fi
-}
-
-src_install () {
-	default
-
-	# insecure:
-	# use suid && fperms u+s /usr/libexec/dovecot/deliver
-	# better:
-	if use suid;then
-		einfo "Changing perms to allow deliver to be suided"
-		fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-		fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
-	fi
-
-	newinitd "${FILESDIR}"/dovecot.init-r6 dovecot
-
-	rm -rf "${ED}"/usr/share/doc/dovecot
-
-	dodoc AUTHORS NEWS README TODO
-	dodoc doc/*.{txt,cnf,xml,sh}
-	docinto example-config
-	dodoc doc/example-config/*.{conf,ext}
-	docinto example-config/conf.d
-	dodoc doc/example-config/conf.d/*.{conf,ext}
-	docinto wiki
-	dodoc doc/wiki/*
-	doman doc/man/*.{1,7}
-
-	# Create the dovecot.conf file from the dovecot-example.conf file that
-	# the dovecot folks nicely left for us....
-	local conf="${ED}/etc/dovecot/dovecot.conf"
-	local confd="${ED}/etc/dovecot/conf.d"
-
-	insinto /etc/dovecot
-	doins doc/example-config/*.{conf,ext}
-	insinto /etc/dovecot/conf.d
-	doins doc/example-config/conf.d/*.{conf,ext}
-	fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
-	rm -f "${confd}/../README"
-
-	# .maildir is the Gentoo default
-	local mail_location="maildir:~/.maildir"
-	sed -i -e \
-		"s|#mail_location =|mail_location = ${mail_location}|" \
-		"${confd}/10-mail.conf" \
-		|| die "failed to update mail location settings in 10-mail.conf"
-
-	# We're using pam files (imap and pop3) provided by mailbase
-	if use pam; then
-		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
-			"${confd}/auth-system.conf.ext" \
-			|| die "failed to update PAM settings in auth-system.conf.ext"
-		# mailbase does not provide a sieve pam file
-		use managesieve && dosym imap /etc/pam.d/sieve
-		sed -i -e \
-			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update PAM settings in 10-auth.conf"
-	fi
-
-	# Disable ipv6 if necessary
-	if ! use ipv6; then
-		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
-			|| die "failed to update listen settings in dovecot.conf"
-	fi
-
-	# Update ssl cert locations
-	sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
-		|| die "ssl conf failed"
-	sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
-		-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
-		"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
-
-	# Install SQL configuration
-	if use mysql || use postgres; then
-		sed -i -e \
-			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
-			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
-			10-auth.conf"
-	fi
-
-	# Install LDAP configuration
-	if use ldap; then
-		sed -i -e \
-			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update ldap settings in 10-auth.conf"
-	fi
-
-	if use vpopmail; then
-		sed -i -e \
-			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
-			"${confd}/10-auth.conf" \
-			|| die "failed to update vpopmail settings in 10-auth.conf"
-	fi
-
-	if use sieve || use managesieve ; then
-		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
-		emake DESTDIR="${ED}" install
-		sed -i -e \
-			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
-			|| die "failed to update sieve settings in 15-lda.conf"
-		rm -rf "${ED}"/usr/share/doc/dovecot
-		docinto example-config/conf.d
-		dodoc doc/example-config/conf.d/*.conf
-		insinto /etc/dovecot/conf.d
-		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
-		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
-		docinto sieve/rfc
-		dodoc doc/rfc/*.txt
-		docinto sieve/devel
-		dodoc doc/devel/DESIGN
-		docinto plugins
-		dodoc doc/plugins/*.txt
-		docinto extensions
-		dodoc doc/extensions/*.txt
-		docinto locations
-		dodoc doc/locations/*.txt
-		doman doc/man/*.{1,7}
-	fi
-
-	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
-}
-
-pkg_postinst() {
-	# Let's not make a new certificate if we already have one
-	if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
-		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
-		einfo "Creating SSL	certificate"
-		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
-		install_cert /etc/ssl/dovecot/server
-	fi
-
-	elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
-}

diff --git a/net-mail/dovecot/files/dovecot-no-log-error-tcp_nodelay.patch b/net-mail/dovecot/files/dovecot-no-log-error-tcp_nodelay.patch
deleted file mode 100644
index 3a2acd74fb6..00000000000
--- a/net-mail/dovecot/files/dovecot-no-log-error-tcp_nodelay.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff --git a/src/lib/ostream-file.c b/src/lib/ostream-file.c
-index e7e6f62d12..82bf729ac0 100644
---- a/src/lib/ostream-file.c
-+++ b/src/lib/ostream-file.c
-@@ -333,17 +333,17 @@ static int buffer_flush(struct file_ostream *fstream)
- static void o_stream_tcp_flush_via_nodelay(struct file_ostream *fstream)
- {
- 	if (net_set_tcp_nodelay(fstream->fd, TRUE) < 0) {
--		if (errno != ENOTSUP && errno != ENOTSOCK &&
--		    errno != ENOPROTOOPT) {
--			i_error("file_ostream.net_set_tcp_nodelay(%s, TRUE) failed: %m",
--				o_stream_get_name(&fstream->ostream.ostream));
--		}
-+		/* Don't bother logging errors. There are quite a lot of
-+		   different errors that need to be ignored, and it differs
-+		   between OSes. At least:
-+		   Linux: ENOTSUP, ENOTSOCK, ENOPROTOOPT
-+		   FreeBSD: EINVAL, ECONNRESET */
- 		fstream->no_socket_nodelay = TRUE;
- 	} else if (net_set_tcp_nodelay(fstream->fd, FALSE) < 0) {
--		/* We already successfully enabled TCP_NODELAY, so we're really
--		   not expecting any errors here. */
--		i_error("file_ostream.net_set_tcp_nodelay(%s, FALSE) failed: %m",
--			o_stream_get_name(&fstream->ostream.ostream));
-+		/* We already successfully enabled TCP_NODELAY, so there
-+		   shouldn't really be errors. Except ECONNRESET can possibly
-+		   still happen between these two calls, so again don't log
-+		   errors. */
- 		fstream->no_socket_nodelay = TRUE;
- 	}
- }


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2020-09-05 23:45 Thomas Deutschmann
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Deutschmann @ 2020-09-05 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     2fd41b355486a055f724150695e1cca74d0fdade
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  5 23:19:23 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 23:45:17 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fd41b35

net-mail/dovecot: fix auth mech APOP

Closes: https://bugs.gentoo.org/739504
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 net-mail/dovecot/dovecot-2.3.11.3.ebuild           |  2 +
 .../dovecot/files/dovecot-2.3.11.3-apop-fix.patch  | 60 ++++++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git a/net-mail/dovecot/dovecot-2.3.11.3.ebuild b/net-mail/dovecot/dovecot-2.3.11.3.ebuild
index 28775017b56..386cbfb5c53 100644
--- a/net-mail/dovecot/dovecot-2.3.11.3.ebuild
+++ b/net-mail/dovecot/dovecot-2.3.11.3.ebuild
@@ -69,6 +69,8 @@ RDEPEND="${DEPEND}
 	acct-user/dovenull
 	net-mail/mailbase"
 
+PATCHES=( "${FILESDIR}"/${P}-apop-fix.patch )
+
 pkg_setup() {
 	if use managesieve && ! use sieve; then
 		ewarn "managesieve USE flag selected but sieve USE flag unselected"

diff --git a/net-mail/dovecot/files/dovecot-2.3.11.3-apop-fix.patch b/net-mail/dovecot/files/dovecot-2.3.11.3-apop-fix.patch
new file mode 100644
index 00000000000..667b4829f1c
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-2.3.11.3-apop-fix.patch
@@ -0,0 +1,60 @@
+From 3c5917d1abee8f4af43b5016ddb897154912eb8d Mon Sep 17 00:00:00 2001
+From: Aki Tuomi <aki.tu...@open-xchange.com>
+Date: Thu, 13 Aug 2020 19:13:49 +0300
+Subject: [PATCH 2/2] auth: test-mech - Fix type mismatch
+
+---
+ src/auth/test-mech.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/auth/test-mech.c b/src/auth/test-mech.c
+index 0a030a2be0..0a22ff46d0 100644
+--- a/src/auth/test-mech.c
++++ b/src/auth/test-mech.c
+@@ -192,7 +192,7 @@ static void test_mech_handle_challenge(struct auth_request *request,
+ }
+ 
+ static inline const unsigned char *
+-test_mech_construct_apop_challenge(unsigned int connect_uid, unsigned long *len_r)
++test_mech_construct_apop_challenge(unsigned int connect_uid, size_t *len_r)
+ {
+ 	string_t *apop_challenge = t_str_new(128);
+ 
+@@ -323,7 +323,7 @@ static void test_mechs(void)
+ 		struct test_case *test_case = &tests[running_test];
+ 		const struct mech_module *mech = test_case->mech;
+ 		struct auth_request *request;
+-		const char *testname = t_strdup_printf("auth mech %s %d/%lu",
++		const char *testname = t_strdup_printf("auth mech %s %d/%zu",
+ 						       mech->mech_name,
+ 						       running_test+1,
+ 						       N_ELEMENTS(tests));
+-- 
+2.11.0
+
+From 47ebfeef07d0908ba6b66344b0f630a21b81bcab Mon Sep 17 00:00:00 2001
+From: Aki Tuomi <aki.tu...@open-xchange.com>
+Date: Thu, 13 Aug 2020 19:13:04 +0300
+Subject: [PATCH 1/2] auth: test-mech - Fix APOP challenge format
+
+---
+ src/auth/test-mech.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/auth/test-mech.c b/src/auth/test-mech.c
+index cf05370035..0a030a2be0 100644
+--- a/src/auth/test-mech.c
++++ b/src/auth/test-mech.c
+@@ -196,8 +196,8 @@ test_mech_construct_apop_challenge(unsigned int connect_uid, unsigned long *len_
+ {
+ 	string_t *apop_challenge = t_str_new(128);
+ 
+-	str_printfa(apop_challenge,"<%lx.%u.%"PRIdTIME_T"", (unsigned long) getpid(),
+-		    connect_uid, process_start_time+10);
++	str_printfa(apop_challenge,"<%lx.%lx.%"PRIxTIME_T".", (unsigned long)getpid(),
++		    (unsigned long)connect_uid, process_start_time+10);
+ 	str_append_data(apop_challenge, "\0testuser\0responseoflen16-", 26);
+ 	*len_r = apop_challenge->used;
+ 	return apop_challenge->data;
+-- 
+2.11.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2020-11-23 11:41 Eray Aslan
  0 siblings, 0 replies; 10+ messages in thread
From: Eray Aslan @ 2020-11-23 11:41 UTC (permalink / raw
  To: gentoo-commits

commit:     f5f547e8cd9631d22431480e0ffdb307539b2915
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 23 11:39:42 2020 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Mon Nov 23 11:41:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5f547e8

net-mail/dovecot: fix assert crash when searching

thanks to Alexander Brüning
Closes: https://bugs.gentoo.org/756094
Package-Manager: Portage-3.0.10, Repoman-3.0.2
Signed-off-by: Eray Aslan <eras <AT> gentoo.org>

 net-mail/dovecot/dovecot-2.3.11.3-r2.ebuild        | 297 +++++++++++++++++++++
 .../dovecot/files/dovecot-fix-search-crash.patch   |  91 +++++++
 2 files changed, 388 insertions(+)

diff --git a/net-mail/dovecot/dovecot-2.3.11.3-r2.ebuild b/net-mail/dovecot/dovecot-2.3.11.3-r2.ebuild
new file mode 100644
index 00000000000..2b42893baff
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.3.11.3-r2.ebuild
@@ -0,0 +1,297 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# do not add a ssl USE flag.  ssl is mandatory
+SSL_DEPS_SKIP=1
+inherit autotools ssl-cert systemd toolchain-funcs
+
+MY_P="${P/_/.}"
+#MY_S="${PN}-ce-${PV}"
+major_minor="$(ver_cut 1-2)"
+sieve_version="0.5.11"
+if [[ ${PV} == *_rc* ]] ; then
+	rc_dir="rc/"
+else
+	rc_dir=""
+fi
+SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
+	sieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	)
+	managesieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	) "
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
+HOMEPAGE="https://www.dovecot.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite vpopmail"
+IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib zstd"
+IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 libressl lucene managesieve rpc selinux sieve solr static-libs suid tcpd textcat unwind"
+
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
+
+DEPEND="argon2? ( dev-libs/libsodium )
+	bzip2? ( app-arch/bzip2 )
+	caps? ( sys-libs/libcap )
+	kerberos? ( virtual/krb5 )
+	ldap? ( net-nds/openldap )
+	lua? ( dev-lang/lua:* )
+	lucene? ( >=dev-cpp/clucene-2.3 )
+	lzma? ( app-arch/xz-utils )
+	lz4? ( app-arch/lz4 )
+	mysql? ( dev-db/mysql-connector-c:0= )
+	pam? ( sys-libs/pam )
+	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
+	rpc? ( net-libs/libtirpc net-libs/rpcsvc-proto )
+	selinux? ( sec-policy/selinux-dovecot )
+	solr? ( net-misc/curl dev-libs/expat )
+	sqlite? ( dev-db/sqlite:* )
+	!libressl? ( dev-libs/openssl:0= )
+	libressl? ( dev-libs/libressl:0= )
+	suid? ( acct-group/mail )
+	tcpd? ( sys-apps/tcp-wrappers )
+	textcat? ( app-text/libexttextcat )
+	unwind? ( sys-libs/libunwind )
+	vpopmail? ( net-mail/vpopmail )
+	zlib? ( sys-libs/zlib )
+	zstd? ( app-arch/zstd )
+	virtual/libiconv
+	dev-libs/icu:="
+
+RDEPEND="${DEPEND}
+	acct-group/dovecot
+	acct-group/dovenull
+	acct-user/dovecot
+	acct-user/dovenull
+	net-mail/mailbase"
+
+PATCHES=(
+	"${FILESDIR}/${P}"-apop-fix.patch
+	"${FILESDIR}/${PN}"-unwind-generic.patch
+	"${FILESDIR}/${PN}"-fix-search-crash.patch
+	)
+
+pkg_setup() {
+	if use managesieve && ! use sieve; then
+		ewarn "managesieve USE flag selected but sieve USE flag unselected"
+		ewarn "sieve USE flag will be turned on"
+	fi
+}
+
+src_prepare() {
+	default
+	# bug 657108
+	#elibtoolize
+	eautoreconf
+}
+
+src_configure() {
+	local conf=""
+
+	if use postgres || use mysql || use sqlite; then
+		conf="${conf} --with-sql"
+	fi
+
+	# turn valgrind tests off. Bug #340791
+	VALGRIND=no econf \
+		--with-rundir="${EPREFIX}/run/dovecot" \
+		--with-statedir="${EPREFIX}/var/lib/dovecot" \
+		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
+		--without-stemmer \
+		--disable-rpath \
+		--without-libbsd \
+		--with-icu \
+		--with-ssl \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		$( use_with argon2 sodium ) \
+		$( use_with bzip2 bzlib ) \
+		$( use_with caps libcap ) \
+		$( use_with kerberos gssapi ) \
+		$( use_with lua ) \
+		$( use_with ldap ) \
+		$( use_with lucene ) \
+		$( use_with lz4 ) \
+		$( use_with lzma ) \
+		$( use_with mysql ) \
+		$( use_with pam ) \
+		$( use_with postgres pgsql ) \
+		$( use_with sqlite ) \
+		$( use_with solr ) \
+		$( use_with tcpd libwrap ) \
+		$( use_with textcat ) \
+		$( use_with unwind libunwind ) \
+		$( use_with vpopmail ) \
+		$( use_with zlib ) \
+		$( use_with zstd ) \
+		$( use_enable static-libs static ) \
+		${conf}
+
+	if use sieve || use managesieve ; then
+		# The sieve plugin needs this file to be build to determine the plugin
+		# directory and the list of libraries to link to.
+		emake dovecot-config
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		econf \
+			$( use_enable static-libs static ) \
+			--localstatedir="${EPREFIX}/var" \
+			--enable-shared \
+			--with-dovecot="${S}" \
+			$( use_with managesieve )
+	fi
+}
+
+src_compile() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+	fi
+}
+
+src_test() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		default
+	fi
+}
+
+src_install() {
+	default
+
+	# insecure:
+	# use suid && fperms u+s /usr/libexec/dovecot/deliver
+	# better:
+	if use suid;then
+		einfo "Changing perms to allow deliver to be suided"
+		fowners root:mail "/usr/libexec/dovecot/dovecot-lda"
+		fperms 4750 "/usr/libexec/dovecot/dovecot-lda"
+	fi
+
+	newinitd "${FILESDIR}"/dovecot.init-r6 dovecot
+
+	rm -rf "${ED}"/usr/share/doc/dovecot
+
+	dodoc AUTHORS NEWS README TODO
+	dodoc doc/*.{txt,cnf,xml,sh}
+	docinto example-config
+	dodoc doc/example-config/*.{conf,ext}
+	docinto example-config/conf.d
+	dodoc doc/example-config/conf.d/*.{conf,ext}
+	docinto wiki
+	dodoc doc/wiki/*
+	doman doc/man/*.{1,7}
+
+	# Create the dovecot.conf file from the dovecot-example.conf file that
+	# the dovecot folks nicely left for us....
+	local conf="${ED}/etc/dovecot/dovecot.conf"
+	local confd="${ED}/etc/dovecot/conf.d"
+
+	insinto /etc/dovecot
+	doins doc/example-config/*.{conf,ext}
+	insinto /etc/dovecot/conf.d
+	doins doc/example-config/conf.d/*.{conf,ext}
+	fperms 0600 /etc/dovecot/dovecot-{ldap,sql}.conf.ext
+	rm -f "${confd}/../README"
+
+	# .maildir is the Gentoo default
+	local mail_location="maildir:~/.maildir"
+	sed -i -e \
+		"s|#mail_location =|mail_location = ${mail_location}|" \
+		"${confd}/10-mail.conf" \
+		|| die "failed to update mail location settings in 10-mail.conf"
+
+	# We're using pam files (imap and pop3) provided by mailbase
+	if use pam; then
+		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
+			"${confd}/auth-system.conf.ext" \
+			|| die "failed to update PAM settings in auth-system.conf.ext"
+		# mailbase does not provide a sieve pam file
+		use managesieve && dosym imap /etc/pam.d/sieve
+		sed -i -e \
+			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update PAM settings in 10-auth.conf"
+	fi
+
+	# Disable ipv6 if necessary
+	if ! use ipv6; then
+		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
+			|| die "failed to update listen settings in dovecot.conf"
+	fi
+
+	# Update ssl cert locations
+	sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
+		|| die "ssl conf failed"
+	sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
+		-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
+		"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
+
+	# Install SQL configuration
+	if use mysql || use postgres; then
+		sed -i -e \
+			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
+			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
+			10-auth.conf"
+	fi
+
+	# Install LDAP configuration
+	if use ldap; then
+		sed -i -e \
+			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update ldap settings in 10-auth.conf"
+	fi
+
+	if use vpopmail; then
+		sed -i -e \
+			's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update vpopmail settings in 10-auth.conf"
+	fi
+
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake DESTDIR="${ED}" install
+		sed -i -e \
+			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
+			|| die "failed to update sieve settings in 15-lda.conf"
+		rm -rf "${ED}"/usr/share/doc/dovecot
+		docinto example-config/conf.d
+		dodoc doc/example-config/conf.d/*.conf
+		insinto /etc/dovecot/conf.d
+		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
+		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
+		docinto sieve/rfc
+		dodoc doc/rfc/*.txt
+		docinto sieve/devel
+		dodoc doc/devel/DESIGN
+		docinto plugins
+		dodoc doc/plugins/*.txt
+		docinto extensions
+		dodoc doc/extensions/*.txt
+		docinto locations
+		dodoc doc/locations/*.txt
+		doman doc/man/*.{1,7}
+	fi
+
+	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
+}
+
+pkg_postinst() {
+	# Let's not make a new certificate if we already have one
+	if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
+		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
+		einfo "Creating SSL	certificate"
+		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
+		install_cert /etc/ssl/dovecot/server
+	fi
+
+	elog "Please read https://doc.dovecot.org/installation_guide/upgrading/ for upgrade notes."
+}

diff --git a/net-mail/dovecot/files/dovecot-fix-search-crash.patch b/net-mail/dovecot/files/dovecot-fix-search-crash.patch
new file mode 100644
index 00000000000..860c070a433
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-fix-search-crash.patch
@@ -0,0 +1,91 @@
+gentoo bug #756094
+
+From a668d767a710ca18ab6e7177d8e8be22a6b024fb Mon Sep 17 00:00:00 2001
+From: Timo Sirainen <timo.sirainen@open-xchange.com>
+Date: Mon, 31 Aug 2020 20:38:42 +0300
+Subject: [PATCH] lib-mail: message_parser_init_from_parts() - Fix crash if
+ MIME boundaries don't end
+
+If the last "boundary--" doens't exist, the parsing assert-crashed at
+deinit. This mainly happened when searching mails.
+
+Fixes:
+Panic: file message-parser.c: line 175 (message_part_finish): assertion failed: (ctx->nested_parts_count > 0)
+---
+ src/lib-mail/message-parser.c      | 13 ++++++++-----
+ src/lib-mail/test-message-parser.c | 21 ++++++++++++++++++++-
+ 2 files changed, 28 insertions(+), 6 deletions(-)
+
+diff --git a/src/lib-mail/message-parser.c b/src/lib-mail/message-parser.c
+index 011dea9050..8baf622e59 100644
+--- a/src/lib-mail/message-parser.c
++++ b/src/lib-mail/message-parser.c
+@@ -138,6 +138,7 @@ message_part_append(struct message_parser_ctx *ctx)
+ 	struct message_part *parent = ctx->part;
+ 	struct message_part *part;
+ 
++	i_assert(!ctx->preparsed);
+ 	i_assert(parent != NULL);
+ 	i_assert((parent->flags & (MESSAGE_PART_FLAG_MULTIPART |
+ 				   MESSAGE_PART_FLAG_MESSAGE_RFC822)) != 0);
+@@ -171,12 +172,14 @@ static void message_part_finish(struct message_parser_ctx *ctx)
+ {
+ 	struct message_part **const *parent_next_partp;
+ 
+-	i_assert(ctx->nested_parts_count > 0);
+-	ctx->nested_parts_count--;
++	if (!ctx->preparsed) {
++		i_assert(ctx->nested_parts_count > 0);
++		ctx->nested_parts_count--;
+ 
+-	parent_next_partp = array_back(&ctx->next_part_stack);
+-	array_pop_back(&ctx->next_part_stack);
+-	ctx->next_part = *parent_next_partp;
++		parent_next_partp = array_back(&ctx->next_part_stack);
++		array_pop_back(&ctx->next_part_stack);
++		ctx->next_part = *parent_next_partp;
++	}
+ 
+ 	message_size_add(&ctx->part->parent->body_size, &ctx->part->body_size);
+ 	message_size_add(&ctx->part->parent->body_size, &ctx->part->header_size);
+diff --git a/src/lib-mail/test-message-parser.c b/src/lib-mail/test-message-parser.c
+index 13984f939e..a00f0d6200 100644
+--- a/src/lib-mail/test-message-parser.c
++++ b/src/lib-mail/test-message-parser.c
+@@ -178,9 +178,10 @@ static void test_message_parser_small_blocks(void)
+ static void test_message_parser_stop_early(void)
+ {
+ 	struct message_parser_ctx *parser;
+-	struct istream *input;
++	struct istream *input, *input2;
+ 	struct message_part *parts;
+ 	struct message_block block;
++	const char *error;
+ 	unsigned int i;
+ 	pool_t pool;
+ 	int ret;
+@@ -198,6 +199,24 @@ static void test_message_parser_stop_early(void)
+ 							      &block)) > 0) ;
+ 		test_assert(ret == 0);
+ 		message_parser_deinit(&parser, &parts);
++
++		/* test preparsed - first re-parse everything with a stream
++		   that sees EOF at this position */
++		input2 = i_stream_create_from_data(test_msg, i);
++		parser = message_parser_init(pool, input2, &set_empty);
++		while ((ret = message_parser_parse_next_block(parser,
++							      &block)) > 0) ;
++		test_assert(ret == -1);
++		message_parser_deinit(&parser, &parts);
++
++		/* now parse from the parts */
++		i_stream_seek(input2, 0);
++		parser = message_parser_init_from_parts(parts, input2, &set_empty);
++		while ((ret = message_parser_parse_next_block(parser,
++							      &block)) > 0) ;
++		test_assert(ret == -1);
++		test_assert(message_parser_deinit_from_parts(&parser, &parts, &error) == 0);
++		i_stream_unref(&input2);
+ 	}
+ 
+ 	i_stream_unref(&input);


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2021-01-05  9:35 Eray Aslan
  0 siblings, 0 replies; 10+ messages in thread
From: Eray Aslan @ 2021-01-05  9:35 UTC (permalink / raw
  To: gentoo-commits

commit:     1ddd164e2402c15e598eb8ae615dfaa7a52b08a9
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  5 09:35:39 2021 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Tue Jan  5 09:35:39 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ddd164e

net-mail/dovecot: security bump to 2.3.13

Bug: https://bugs.gentoo.org/763525
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Eray Aslan <eras <AT> gentoo.org>

 net-mail/dovecot/Manifest                          |   2 +
 net-mail/dovecot/dovecot-2.3.13.ebuild             | 293 +++++++++++++++++++++
 .../files/dovecot-autoconf-lua-version.patch       |  17 ++
 .../files/dovecot-socket-name-too-long.patch       |  11 +
 4 files changed, 323 insertions(+)

diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
index 3c542b8815d..73dcc900692 100644
--- a/net-mail/dovecot/Manifest
+++ b/net-mail/dovecot/Manifest
@@ -1,4 +1,6 @@
 DIST dovecot-2.2-pigeonhole-0.4.24.2.tar.gz 1833284 BLAKE2B bee45fd129aee3d5126bd48b27829e7e266a5c1043411b6b23655bbf32e2f684763b82bff476a954bf7f0c7aae4e038c0892be70776726c7b324e409a8f89d78 SHA512 a51de88bcbac83ced7d314a560bd44f119dd80bf58f350da522501f072c0a4c02ff8c11152e2b858f14bb8ca9a9b665960cbe37a0c8ef4600b430e65ddbf3bf4
 DIST dovecot-2.2.36.4.tar.gz 6257899 BLAKE2B 3260e96f369e85f2dfd5ece0d9b12902c7192d057369e8a151cc6ab7b4f2033d4e1029fb862d412f2837fd384d7fe729cf1ab15cac9ac335e943bb1fdb532b51 SHA512 e33ab2f6c5f7b4ffca3d57580329f1df8e1655c755a1a6b575a4e49d57ea94d1ab67df2419033c9d68acf5959c6edfa596815dc2bc43798e9aef3d17d271cc4d
 DIST dovecot-2.3-pigeonhole-0.5.11.tar.gz 1912411 BLAKE2B ed35cbae5ea2c1da24a1a255c1fc943b9a8c35280840ea42c1b5f83ea327872bb83ae8901696abfe3b0d27dfd6c11d3fb1661614fad54eeab9d700b5f0b7b13a SHA512 793d93edc50192c52654e2f7244d3e01aaa4e69f786e3ecfcd658a4ab26a5099cc5319cb93221150db4ce94bc4515ffb38115b1d0eeb6e052b956efec680b33d
+DIST dovecot-2.3-pigeonhole-0.5.13.tar.gz 1908839 BLAKE2B 37fbd9d9b41ca1893c19ac546dd9b272b361752c70eed0596bbb743cd8c30d942427d5814ab551bb39eb844c7bd05074bb49b11a6b81747e2fc535b0f9993f14 SHA512 fcbc13d71af4e6dd4e34192484e203d755e5015da76a4774b11a79182b2baad36cab5a471346093111ace36a7775dfe8294555f8b777786dde386820b3ec5cd3
 DIST dovecot-2.3.11.3.tar.gz 7353412 BLAKE2B 0067989b35fe29c0d23f6ca25712a87fa69608cc4ee6081d9eb929d63e7a586ccc0d86fcdbe1aac67aea9f2678ab0e150f053667817b08f4a7246947bb812fdb SHA512 d83e52a7faab918a8e6f6257acc5936b81733c10489affd042c3a043cb842db060286cba9978be378e4958e9ac2e60b55ce289d7f3a88df08e7637e4785e23bb
+DIST dovecot-2.3.13.tar.gz 7456073 BLAKE2B 6cf3e7d9c6cf90279e0d72782cca88a11617f3f08e3c27da7948f46b8796575e42c776323cd56bc4208474831d4480afcac35ebe0b74d99db40acd4cda2279be SHA512 758a169fba8925637ed18fa7522a6f06c9fe01a1707b1ca0d0a4d8757c578a8e117c91733e8314403839f9a484bbcac71ce3532c82379eb583b480756d556a95

diff --git a/net-mail/dovecot/dovecot-2.3.13.ebuild b/net-mail/dovecot/dovecot-2.3.13.ebuild
new file mode 100644
index 00000000000..cfaa9df4477
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.3.13.ebuild
@@ -0,0 +1,293 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( lua5-{1..3} )
+
+# do not add a ssl USE flag.  ssl is mandatory
+SSL_DEPS_SKIP=1
+inherit autotools lua-single ssl-cert systemd toolchain-funcs
+
+MY_P="${P/_/.}"
+#MY_S="${PN}-ce-${PV}"
+major_minor="$(ver_cut 1-2)"
+sieve_version="0.5.13"
+if [[ ${PV} == *_rc* ]] ; then
+	rc_dir="rc/"
+else
+	rc_dir=""
+fi
+SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
+	sieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	)
+	managesieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	) "
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
+HOMEPAGE="https://www.dovecot.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite"
+IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib zstd"
+IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 libressl lucene managesieve rpc selinux sieve solr static-libs suid tcpd textcat unwind"
+
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
+
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
+
+DEPEND="argon2? ( dev-libs/libsodium )
+	bzip2? ( app-arch/bzip2 )
+	caps? ( sys-libs/libcap )
+	kerberos? ( virtual/krb5 )
+	ldap? ( net-nds/openldap )
+	lua? ( ${LUA_DEPS} )
+	lucene? ( >=dev-cpp/clucene-2.3 )
+	lzma? ( app-arch/xz-utils )
+	lz4? ( app-arch/lz4 )
+	mysql? ( dev-db/mysql-connector-c:0= )
+	pam? ( sys-libs/pam )
+	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
+	rpc? ( net-libs/libtirpc net-libs/rpcsvc-proto )
+	selinux? ( sec-policy/selinux-dovecot )
+	solr? ( net-misc/curl dev-libs/expat )
+	sqlite? ( dev-db/sqlite:* )
+	!libressl? ( dev-libs/openssl:0= )
+	libressl? ( dev-libs/libressl:0= )
+	suid? ( acct-group/mail )
+	tcpd? ( sys-apps/tcp-wrappers )
+	textcat? ( app-text/libexttextcat )
+	unwind? ( sys-libs/libunwind )
+	zlib? ( sys-libs/zlib )
+	zstd? ( app-arch/zstd )
+	virtual/libiconv
+	dev-libs/icu:="
+
+RDEPEND="${DEPEND}
+	acct-group/dovecot
+	acct-group/dovenull
+	acct-user/dovecot
+	acct-user/dovenull
+	net-mail/mailbase"
+
+PATCHES=(
+	"${FILESDIR}/${PN}"-autoconf-lua-version.patch
+	"${FILESDIR}/${PN}"-unwind-generic.patch
+	"${FILESDIR}/${PN}"-socket-name-too-long.patch
+	)
+
+pkg_setup() {
+	use lua && lua-single_pkg_setup
+	if use managesieve && ! use sieve; then
+		ewarn "managesieve USE flag selected but sieve USE flag unselected"
+		ewarn "sieve USE flag will be turned on"
+	fi
+}
+
+src_prepare() {
+	default
+	# bug 657108
+	#elibtoolize
+	eautoreconf
+}
+
+src_configure() {
+	local conf=""
+
+	if use postgres || use mysql || use sqlite; then
+		conf="${conf} --with-sql"
+	fi
+
+	# turn valgrind tests off. Bug #340791
+	VALGRIND=no LUAPC="${ELUA}" econf \
+		--with-rundir="${EPREFIX}/run/dovecot" \
+		--with-statedir="${EPREFIX}/var/lib/dovecot" \
+		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
+		--without-stemmer \
+		--disable-rpath \
+		--without-libbsd \
+		--with-icu \
+		--with-ssl \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		$( use_with argon2 sodium ) \
+		$( use_with bzip2 bzlib ) \
+		$( use_with caps libcap ) \
+		$( use_with kerberos gssapi ) \
+		$( use_with lua ) \
+		$( use_with ldap ) \
+		$( use_with lucene ) \
+		$( use_with lz4 ) \
+		$( use_with lzma ) \
+		$( use_with mysql ) \
+		$( use_with pam ) \
+		$( use_with postgres pgsql ) \
+		$( use_with sqlite ) \
+		$( use_with solr ) \
+		$( use_with tcpd libwrap ) \
+		$( use_with textcat ) \
+		$( use_with unwind libunwind ) \
+		$( use_with zlib ) \
+		$( use_with zstd ) \
+		$( use_enable static-libs static ) \
+		${conf}
+
+	if use sieve || use managesieve ; then
+		# The sieve plugin needs this file to be build to determine the plugin
+		# directory and the list of libraries to link to.
+		emake dovecot-config
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		econf \
+			$( use_enable static-libs static ) \
+			--localstatedir="${EPREFIX}/var" \
+			--enable-shared \
+			--with-dovecot="${S}" \
+			$( use_with managesieve )
+	fi
+}
+
+src_compile() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+	fi
+}
+
+src_test() {
+	default
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		default
+	fi
+}
+
+src_install() {
+	default
+
+	# insecure:
+	# use suid && fperms u+s /usr/libexec/dovecot/deliver
+	# better:
+	if use suid;then
+		einfo "Changing perms to allow deliver to be suided"
+		fowners root:mail "/usr/libexec/dovecot/dovecot-lda"
+		fperms 4750 "/usr/libexec/dovecot/dovecot-lda"
+	fi
+
+	newinitd "${FILESDIR}"/dovecot.init-r6 dovecot
+
+	rm -rf "${ED}"/usr/share/doc/dovecot
+
+	dodoc AUTHORS NEWS README TODO
+	dodoc doc/*.{txt,cnf,xml,sh}
+	docinto example-config
+	dodoc doc/example-config/*.{conf,ext}
+	docinto example-config/conf.d
+	dodoc doc/example-config/conf.d/*.{conf,ext}
+	docinto wiki
+	dodoc doc/wiki/*
+	doman doc/man/*.{1,7}
+
+	# Create the dovecot.conf file from the dovecot-example.conf file that
+	# the dovecot folks nicely left for us....
+	local conf="${ED}/etc/dovecot/dovecot.conf"
+	local confd="${ED}/etc/dovecot/conf.d"
+
+	insinto /etc/dovecot
+	doins doc/example-config/*.{conf,ext}
+	insinto /etc/dovecot/conf.d
+	doins doc/example-config/conf.d/*.{conf,ext}
+	fperms 0600 /etc/dovecot/dovecot-{ldap,sql}.conf.ext
+	rm -f "${confd}/../README"
+
+	# .maildir is the Gentoo default
+	local mail_location="maildir:~/.maildir"
+	sed -i -e \
+		"s|#mail_location =|mail_location = ${mail_location}|" \
+		"${confd}/10-mail.conf" \
+		|| die "failed to update mail location settings in 10-mail.conf"
+
+	# We're using pam files (imap and pop3) provided by mailbase
+	if use pam; then
+		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
+			"${confd}/auth-system.conf.ext" \
+			|| die "failed to update PAM settings in auth-system.conf.ext"
+		# mailbase does not provide a sieve pam file
+		use managesieve && dosym imap /etc/pam.d/sieve
+		sed -i -e \
+			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update PAM settings in 10-auth.conf"
+	fi
+
+	# Disable ipv6 if necessary
+	if ! use ipv6; then
+		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
+			|| die "failed to update listen settings in dovecot.conf"
+	fi
+
+	# Update ssl cert locations
+	sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
+		|| die "ssl conf failed"
+	sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
+		-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
+		"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
+
+	# Install SQL configuration
+	if use mysql || use postgres; then
+		sed -i -e \
+			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
+			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
+			10-auth.conf"
+	fi
+
+	# Install LDAP configuration
+	if use ldap; then
+		sed -i -e \
+			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update ldap settings in 10-auth.conf"
+	fi
+
+	if use sieve || use managesieve ; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake DESTDIR="${ED}" install
+		sed -i -e \
+			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
+			|| die "failed to update sieve settings in 15-lda.conf"
+		rm -rf "${ED}"/usr/share/doc/dovecot
+		docinto example-config/conf.d
+		dodoc doc/example-config/conf.d/*.conf
+		insinto /etc/dovecot/conf.d
+		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
+		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
+		docinto sieve/rfc
+		dodoc doc/rfc/*.txt
+		docinto sieve/devel
+		dodoc doc/devel/DESIGN
+		docinto plugins
+		dodoc doc/plugins/*.txt
+		docinto extensions
+		dodoc doc/extensions/*.txt
+		docinto locations
+		dodoc doc/locations/*.txt
+		doman doc/man/*.{1,7}
+	fi
+
+	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
+}
+
+pkg_postinst() {
+	# Let's not make a new certificate if we already have one
+	if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
+		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
+		einfo "Creating SSL	certificate"
+		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
+		install_cert /etc/ssl/dovecot/server
+	fi
+
+	elog "Please read https://doc.dovecot.org/installation_guide/upgrading/ for upgrade notes."
+}

diff --git a/net-mail/dovecot/files/dovecot-autoconf-lua-version.patch b/net-mail/dovecot/files/dovecot-autoconf-lua-version.patch
new file mode 100644
index 00000000000..5572271929e
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-autoconf-lua-version.patch
@@ -0,0 +1,17 @@
+--- a/m4/want_lua.m4
++++ b/m4/want_lua.m4
+@@ -13,13 +13,12 @@
+   AC_MSG_RESULT([$with_lua])
+ 
+   AS_IF([test "x$with_lua" != "xno"],
+-    [for LUAPC in lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua; do
++    [
+        PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [
+          AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have lua])
+          with_lua=yes
+        ], [LUAPC=""]) # otherwise pkg_check will fail
+        if test "x$LUA_LIBS" != "x"; then break; fi
+-     done
+   ])
+ 
+   AS_IF([test "x$with_lua" = "xyes"], [

diff --git a/net-mail/dovecot/files/dovecot-socket-name-too-long.patch b/net-mail/dovecot/files/dovecot-socket-name-too-long.patch
new file mode 100644
index 00000000000..64c17f367b9
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-socket-name-too-long.patch
@@ -0,0 +1,11 @@
+--- a/src/imap/test-imap-client-hibernate.c	2021-01-05 11:42:53.073912808 +0300
++++ b/src/imap/test-imap-client-hibernate.c	2021-01-05 11:43:49.790616213 +0300
+@@ -19,7 +19,7 @@
+ 
+ #include <sys/stat.h>
+ 
+-#define TEMP_DIRNAME ".test-imap-client-hibernate"
++#define TEMP_DIRNAME ".t-ic-h" /* test-imap-client-hibernate */
+ 
+ #define EVILSTR "\t\r\n\001"
+ 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2021-02-05 21:09 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2021-02-05 21:09 UTC (permalink / raw
  To: gentoo-commits

commit:     bcd40797c9334adc5e7475dff86714c351b7bbfa
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  5 21:09:46 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb  5 21:09:52 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bcd40797

net-mail/dovecot: fix test failures on 32-bit systems

Closes: https://bugs.gentoo.org/764713
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-mail/dovecot/dovecot-2.3.13-r100.ebuild        |  4 +-
 .../files/dovecot-2.3.13-32-bit-tests-1.patch      | 52 ++++++++++++++++++++++
 .../files/dovecot-2.3.13-32-bit-tests-2.patch      | 27 +++++++++++
 3 files changed, 82 insertions(+), 1 deletion(-)

diff --git a/net-mail/dovecot/dovecot-2.3.13-r100.ebuild b/net-mail/dovecot/dovecot-2.3.13-r100.ebuild
index ff93adddf94..15bc481ff78 100644
--- a/net-mail/dovecot/dovecot-2.3.13-r100.ebuild
+++ b/net-mail/dovecot/dovecot-2.3.13-r100.ebuild
@@ -78,7 +78,9 @@ PATCHES=(
 	"${FILESDIR}/${PN}"-autoconf-lua-version.patch
 	"${FILESDIR}/${PN}"-unwind-generic.patch
 	"${FILESDIR}/${PN}"-socket-name-too-long.patch
-	)
+	"${FILESDIR}/${P}"-32-bit-tests-1.patch
+	"${FILESDIR}/${P}"-32-bit-tests-2.patch
+)
 
 pkg_setup() {
 	use lua && lua-single_pkg_setup

diff --git a/net-mail/dovecot/files/dovecot-2.3.13-32-bit-tests-1.patch b/net-mail/dovecot/files/dovecot-2.3.13-32-bit-tests-1.patch
new file mode 100644
index 00000000000..204424c5ebb
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-2.3.13-32-bit-tests-1.patch
@@ -0,0 +1,52 @@
+https://bugs.gentoo.org/764713
+https://github.com/dovecot/core/commit/2cc1feca9087651902a5ea3cda021c8a0b3217ce.patch
+
+From 2cc1feca9087651902a5ea3cda021c8a0b3217ce Mon Sep 17 00:00:00 2001
+From: Paul Howarth <paul@city-fan.org>
+Date: Mon, 4 Jan 2021 16:31:03 +0000
+Subject: [PATCH] lib: Fix timeval_cmp_margin for 32-bit systems
+
+The test suite compares times with seconds values of -INT_MAX and
+INT_MAX. The result of this comparison does not fit in a value of
+type int and so the test suite fails on 32-bit systems where time_t
+is an int. To fix this, calculations on seconds values are done
+using long long integers.
+
+Broken by 16ab5542
+---
+ src/lib/time-util.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/lib/time-util.c b/src/lib/time-util.c
+index 294bb02310..3f4cd01c9e 100644
+--- a/src/lib/time-util.c
++++ b/src/lib/time-util.c
+@@ -38,21 +38,23 @@ int timeval_cmp(const struct timeval *tv1, const struct timeval *tv2)
+ int timeval_cmp_margin(const struct timeval *tv1, const struct timeval *tv2,
+ 	unsigned int usec_margin)
+ {
+-	long long usecs_diff;
++	long long secs_diff, usecs_diff;
+ 	int sec_margin, ret;
+ 
+ 	if (tv1->tv_sec < tv2->tv_sec) {
+ 		sec_margin = ((int)usec_margin / 1000000) + 1;
+-		if ((tv2->tv_sec - tv1->tv_sec) > sec_margin)
++		secs_diff = (long long)tv2->tv_sec - (long long)tv1->tv_sec;
++		if (secs_diff > sec_margin)
+ 			return -1;
+-		usecs_diff = (tv2->tv_sec - tv1->tv_sec) * 1000000LL +
++		usecs_diff = secs_diff * 1000000LL +
+ 			(tv2->tv_usec - tv1->tv_usec);
+ 		ret = -1;
+ 	} else if (tv1->tv_sec > tv2->tv_sec) {
+ 		sec_margin = ((int)usec_margin / 1000000) + 1;
+-		if ((tv1->tv_sec - tv2->tv_sec) > sec_margin)
++		secs_diff = (long long)tv1->tv_sec - (long long)tv2->tv_sec;
++		if (secs_diff > sec_margin)
+ 			return 1;
+-		usecs_diff = (tv1->tv_sec - tv2->tv_sec) * 1000000LL +
++		usecs_diff = secs_diff * 1000000LL +
+ 			(tv1->tv_usec - tv2->tv_usec);
+ 		ret = 1;
+ 	} else if (tv1->tv_usec < tv2->tv_usec) {

diff --git a/net-mail/dovecot/files/dovecot-2.3.13-32-bit-tests-2.patch b/net-mail/dovecot/files/dovecot-2.3.13-32-bit-tests-2.patch
new file mode 100644
index 00000000000..8956773b43e
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-2.3.13-32-bit-tests-2.patch
@@ -0,0 +1,27 @@
+https://bugs.gentoo.org/764713
+https://github.com/dovecot/core/commit/01366bd18ea98bf6979328ff8580488920a33f0c
+
+From 01366bd18ea98bf6979328ff8580488920a33f0c Mon Sep 17 00:00:00 2001
+From: Aki Tuomi <aki.tuomi@open-xchange.com>
+Date: Thu, 4 Feb 2021 08:44:46 +0200
+Subject: [PATCH] lib: test-time-util - Use correct types for test case
+
+Fixes type mismatch on 32-bit systems.
+---
+ src/lib/test-time-util.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/test-time-util.c b/src/lib/test-time-util.c
+index cfa322048e..139db0ec5d 100644
+--- a/src/lib/test-time-util.c
++++ b/src/lib/test-time-util.c
+@@ -358,7 +358,8 @@ static void test_str_to_timeval(void)
+ {
+ 	struct {
+ 		const char *str;
+-		unsigned int tv_sec, tv_usec;
++		time_t tv_sec;
++		suseconds_t tv_usec;
+ 	} tests[] = {
+ 		{ "0", 0, 0 },
+ 		{ "0.0", 0, 0 },


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2021-06-22 11:46 Eray Aslan
  0 siblings, 0 replies; 10+ messages in thread
From: Eray Aslan @ 2021-06-22 11:46 UTC (permalink / raw
  To: gentoo-commits

commit:     9c780f4dbf6b8decf88015c43fbcd5ccd4fedc04
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 22 11:46:25 2021 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Tue Jun 22 11:46:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c780f4d

net-mail/dovecot: bump to 2.3.15

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Eray Aslan <eras <AT> gentoo.org>

 net-mail/dovecot/Manifest                          |   2 +
 net-mail/dovecot/dovecot-2.3.15.ebuild             | 301 +++++++++++++++++++++
 .../files/dovecot-autoconf-lua-version-v2.patch    |  15 +
 3 files changed, 318 insertions(+)

diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
index 0005fd74913..1a54583afcc 100644
--- a/net-mail/dovecot/Manifest
+++ b/net-mail/dovecot/Manifest
@@ -1,5 +1,7 @@
 DIST dovecot-2.3-pigeonhole-0.5.13.tar.gz 1908839 BLAKE2B 37fbd9d9b41ca1893c19ac546dd9b272b361752c70eed0596bbb743cd8c30d942427d5814ab551bb39eb844c7bd05074bb49b11a6b81747e2fc535b0f9993f14 SHA512 fcbc13d71af4e6dd4e34192484e203d755e5015da76a4774b11a79182b2baad36cab5a471346093111ace36a7775dfe8294555f8b777786dde386820b3ec5cd3
 DIST dovecot-2.3-pigeonhole-0.5.14.tar.gz 1910607 BLAKE2B 5c08214535d298ce2b8defd8c945e96597a98bda6493a3e27481fdadc0e149e6dd01c6ececaa583dd331614669bd8e033cd1b91d64d03a9e0cdcef67fa9c27b8 SHA512 c5d5d309769eabe2c0971646d0c14d166b6b524acf59e1069eca803f764544fa2535c09c9a630ca706aa70442b688ee26af831d29e674823bac7ea7c0e1f33cc
+DIST dovecot-2.3-pigeonhole-0.5.15.tar.gz 1935601 BLAKE2B e26405cc9a93681206e27c2b548e3409ae4444c1c011127b27eda364fec27d572dc01c7ea63688693bde10a8b4086bf67e14bb67e917d62db426d8871d6af0ec SHA512 521070080802bf2a50cd0ff0af5dc991c04d70b807abc2cd9aa567444a4869f5f42800f19d9b740a519bd4069437139e70ca6ae4b905479fcec8faa133ac5f54
 DIST dovecot-2.3.13.tar.gz 7456073 BLAKE2B 6cf3e7d9c6cf90279e0d72782cca88a11617f3f08e3c27da7948f46b8796575e42c776323cd56bc4208474831d4480afcac35ebe0b74d99db40acd4cda2279be SHA512 758a169fba8925637ed18fa7522a6f06c9fe01a1707b1ca0d0a4d8757c578a8e117c91733e8314403839f9a484bbcac71ce3532c82379eb583b480756d556a95
 DIST dovecot-2.3.14.1.tar.gz 7534719 BLAKE2B 1ba5143711fe340b9fad61db41ba658485e42be52f3b0f196eeb9b8e4b7c1b865b6a08f879dadeb2db3979b17be34699ce5febc4545887307f62bd5b72076f86 SHA512 b71b82c2918ac9940ef6bc274bc9c2b3e56a08cf5054244d80547ad89c421b9180c5afa8b5b140831239fbe2cbeeceb83a0052e037eb198d8fc27d07cba4ba35
 DIST dovecot-2.3.14.tar.gz 7483769 BLAKE2B bf2606ed64bef66fdeb165da65295031e692b7ba5186847c027adbd50093a9684b57eb724595c27838d91769e097ab2a82978ba845bf4e026dcfd78aa1372501 SHA512 69df234cb739c7ee7ae3acfb9756bc22481e94c95463d32bfac315c7ec4b1ba0dfbff552b769f2ab7ee554087ca2ebbe331aa008d3af26417016612dc7cad103
+DIST dovecot-2.3.15.tar.gz 7608561 BLAKE2B 85134064dbff0b4f50831a835fb6eafc92081d75d91ab331fa0ae79c453382a88485bad8c774491968b879478dc66841a9c6170e5931d562cf5eaa6af755440b SHA512 75bbdbeac663da109f78dba06c42bb5193e911c6b3c64f055fc4473ae9afaf0c8304c49fc7f06c5c6b61e67dd13dc21fbed6ff160a99f38f547c88ba05e6b03a

diff --git a/net-mail/dovecot/dovecot-2.3.15.ebuild b/net-mail/dovecot/dovecot-2.3.15.ebuild
new file mode 100644
index 00000000000..e249ee27c2d
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.3.15.ebuild
@@ -0,0 +1,301 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( lua5-1 lua5-3 )
+# do not add a ssl USE flag.  ssl is mandatory
+SSL_DEPS_SKIP=1
+inherit autotools lua-single ssl-cert systemd toolchain-funcs
+
+MY_P="${P/_/.}"
+#MY_S="${PN}-ce-${PV}"
+major_minor="$(ver_cut 1-2)"
+sieve_version="0.5.15"
+if [[ ${PV} == *_rc* ]]; then
+	rc_dir="rc/"
+else
+	rc_dir=""
+fi
+SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
+	sieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	)
+	managesieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	) "
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
+HOMEPAGE="https://www.dovecot.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite"
+IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib zstd"
+IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 lucene managesieve rpc
+	selinux sieve solr static-libs suid systemd tcpd textcat unwind"
+
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
+
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
+
+DEPEND="
+	dev-libs/icu:=
+	dev-libs/openssl:0=
+	virtual/libiconv
+	argon2? ( dev-libs/libsodium )
+	bzip2? ( app-arch/bzip2 )
+	caps? ( sys-libs/libcap )
+	kerberos? ( virtual/krb5 )
+	ldap? ( net-nds/openldap )
+	lua? ( ${LUA_DEPS} )
+	lucene? ( >=dev-cpp/clucene-2.3 )
+	lz4? ( app-arch/lz4 )
+	lzma? ( app-arch/xz-utils )
+	mysql? ( dev-db/mysql-connector-c:0= )
+	pam? ( sys-libs/pam )
+	postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
+	rpc? ( net-libs/libtirpc net-libs/rpcsvc-proto )
+	selinux? ( sec-policy/selinux-dovecot )
+	solr? ( net-misc/curl dev-libs/expat )
+	sqlite? ( dev-db/sqlite:* )
+	suid? ( acct-group/mail )
+	systemd? ( sys-apps/systemd:= )
+	tcpd? ( sys-apps/tcp-wrappers )
+	textcat? ( app-text/libexttextcat )
+	unwind? ( sys-libs/libunwind )
+	zlib? ( sys-libs/zlib )
+	zstd? ( app-arch/zstd )
+	"
+
+RDEPEND="
+	${DEPEND}
+	acct-group/dovecot
+	acct-group/dovenull
+	acct-user/dovecot
+	acct-user/dovenull
+	net-mail/mailbase
+	"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}"-autoconf-lua-version-v2.patch
+	"${FILESDIR}/${PN}"-socket-name-too-long.patch
+)
+
+pkg_setup() {
+	use lua && lua-single_pkg_setup
+	if use managesieve && ! use sieve; then
+		ewarn "managesieve USE flag selected but sieve USE flag unselected"
+		ewarn "sieve USE flag will be turned on"
+	fi
+}
+
+src_prepare() {
+	default
+	# bug 657108
+	#elibtoolize
+	eautoreconf
+}
+
+src_configure() {
+	local conf=""
+
+	if use postgres || use mysql || use sqlite; then
+		conf="${conf} --with-sql"
+	fi
+
+	# turn valgrind tests off. Bug #340791
+	VALGRIND=no \
+	LUAPC="${ELUA}" \
+	systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+	econf \
+		--with-rundir="${EPREFIX}/run/dovecot" \
+		--with-statedir="${EPREFIX}/var/lib/dovecot" \
+		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
+		--without-stemmer \
+		--disable-rpath \
+		--without-libbsd \
+		--with-icu \
+		--with-ssl \
+		$( use_with argon2 sodium ) \
+		$( use_with bzip2 bzlib ) \
+		$( use_with caps libcap ) \
+		$( use_with kerberos gssapi ) \
+		$( use_with lua ) \
+		$( use_with ldap ) \
+		$( use_with lucene ) \
+		$( use_with lz4 ) \
+		$( use_with lzma ) \
+		$( use_with mysql ) \
+		$( use_with pam ) \
+		$( use_with postgres pgsql ) \
+		$( use_with sqlite ) \
+		$( use_with solr ) \
+		$( use_with systemd ) \
+		$( use_with tcpd libwrap ) \
+		$( use_with textcat ) \
+		$( use_with unwind libunwind ) \
+		$( use_with zlib ) \
+		$( use_with zstd ) \
+		$( use_enable static-libs static ) \
+		${conf}
+
+	if use sieve || use managesieve; then
+		# The sieve plugin needs this file to be build to determine the plugin
+		# directory and the list of libraries to link to.
+		emake dovecot-config
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		econf \
+			$( use_enable static-libs static ) \
+			--localstatedir="${EPREFIX}/var" \
+			--enable-shared \
+			--with-dovecot="${S}" \
+			$( use_with managesieve )
+	fi
+}
+
+src_compile() {
+	default
+	if use sieve || use managesieve; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+	fi
+}
+
+src_test() {
+	default
+	if use sieve || use managesieve; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		default
+	fi
+}
+
+src_install() {
+	default
+
+	# insecure:
+	# use suid && fperms u+s /usr/libexec/dovecot/deliver
+	# better:
+	if use suid; then
+		einfo "Changing perms to allow deliver to be suided"
+		fowners root:mail "/usr/libexec/dovecot/dovecot-lda"
+		fperms 4750 "/usr/libexec/dovecot/dovecot-lda"
+	fi
+
+	newinitd "${FILESDIR}"/dovecot.init-r6 dovecot
+
+	rm -rf "${ED}"/usr/share/doc/dovecot
+
+	dodoc AUTHORS NEWS README TODO
+	dodoc doc/*.{txt,cnf,xml,sh}
+	docinto example-config
+	dodoc doc/example-config/*.{conf,ext}
+	docinto example-config/conf.d
+	dodoc doc/example-config/conf.d/*.{conf,ext}
+	docinto wiki
+	dodoc doc/wiki/*
+	doman doc/man/*.{1,7}
+
+	# Create the dovecot.conf file from the dovecot-example.conf file that
+	# the dovecot folks nicely left for us....
+	local conf="${ED}/etc/dovecot/dovecot.conf"
+	local confd="${ED}/etc/dovecot/conf.d"
+
+	insinto /etc/dovecot
+	doins doc/example-config/*.{conf,ext}
+	insinto /etc/dovecot/conf.d
+	doins doc/example-config/conf.d/*.{conf,ext}
+	fperms 0600 /etc/dovecot/dovecot-{ldap,sql}.conf.ext
+	rm -f "${confd}/../README"
+
+	# .maildir is the Gentoo default
+	local mail_location="maildir:~/.maildir"
+	sed -i -e \
+		"s|#mail_location =|mail_location = ${mail_location}|" \
+		"${confd}/10-mail.conf" \
+		|| die "failed to update mail location settings in 10-mail.conf"
+
+	# We're using pam files (imap and pop3) provided by mailbase
+	if use pam; then
+		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
+			"${confd}/auth-system.conf.ext" \
+			|| die "failed to update PAM settings in auth-system.conf.ext"
+		# mailbase does not provide a sieve pam file
+		use managesieve && dosym imap /etc/pam.d/sieve
+		sed -i -e \
+			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update PAM settings in 10-auth.conf"
+	fi
+
+	# Disable ipv6 if necessary
+	if ! use ipv6; then
+		sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
+			|| die "failed to update listen settings in dovecot.conf"
+	fi
+
+	# Update ssl cert locations
+	sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
+		|| die "ssl conf failed"
+	sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
+		-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
+		"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
+
+	# Install SQL configuration
+	if use mysql || use postgres; then
+		sed -i -e \
+			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
+			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
+			10-auth.conf"
+	fi
+
+	# Install LDAP configuration
+	if use ldap; then
+		sed -i -e \
+			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update ldap settings in 10-auth.conf"
+	fi
+
+	if use sieve || use managesieve; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake DESTDIR="${ED}" install
+		sed -i -e \
+			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
+			|| die "failed to update sieve settings in 15-lda.conf"
+		rm -rf "${ED}"/usr/share/doc/dovecot
+		docinto example-config/conf.d
+		dodoc doc/example-config/conf.d/*.conf
+		insinto /etc/dovecot/conf.d
+		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
+		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
+		docinto sieve/rfc
+		dodoc doc/rfc/*.txt
+		docinto sieve/devel
+		dodoc doc/devel/DESIGN
+		docinto plugins
+		dodoc doc/plugins/*.txt
+		docinto extensions
+		dodoc doc/extensions/*.txt
+		docinto locations
+		dodoc doc/locations/*.txt
+		doman doc/man/*.{1,7}
+	fi
+
+	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
+}
+
+pkg_postinst() {
+	# Let's not make a new certificate if we already have one
+	if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
+		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
+		einfo "Creating SSL	certificate"
+		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
+		install_cert /etc/ssl/dovecot/server
+	fi
+
+	elog "Please read https://doc.dovecot.org/installation_guide/upgrading/ for upgrade notes."
+}

diff --git a/net-mail/dovecot/files/dovecot-autoconf-lua-version-v2.patch b/net-mail/dovecot/files/dovecot-autoconf-lua-version-v2.patch
new file mode 100644
index 00000000000..7ba19a4c74a
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-autoconf-lua-version-v2.patch
@@ -0,0 +1,15 @@
+--- a/m4/want_lua.m4	2021-06-14 16:40:37.000000000 +0300
++++ b/m4/want_lua.m4	2021-06-22 10:24:39.036095013 +0300
+@@ -16,12 +16,10 @@
+     AS_IF([test -n "$LUA_CFLAGS" -o -n "$LUA_LIBS"], [
+       with_lua=yes
+     ], [
+-      for LUAPC in lua5.3 lua-5.3 lua53 lua5.1 lua-5.1 lua51 lua; do
+          PKG_CHECK_MODULES([LUA], [$LUAPC >= 5.1 $LUAPC != 5.2] , [
+            with_lua=yes
+          ], [LUAPC=""]) # otherwise pkg_check will fail
+          if test "x$LUA_LIBS" != "x"; then break; fi
+-       done
+     ])
+   ])
+ 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
@ 2022-12-26  9:32 Eray Aslan
  0 siblings, 0 replies; 10+ messages in thread
From: Eray Aslan @ 2022-12-26  9:32 UTC (permalink / raw
  To: gentoo-commits

commit:     a4b8ad829b18e44c3ed18882804b56c9b38e58f1
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 26 09:32:10 2022 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Mon Dec 26 09:32:10 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4b8ad82

net-mail/dovecot: add openssl-3 support

Bug: https://bugs.gentoo.org/888083
Signed-off-by: Eray Aslan <eras <AT> gentoo.org>

 net-mail/dovecot/dovecot-2.3.20-r1.ebuild      | 299 +++++++++++++++++++++++++
 net-mail/dovecot/files/dovecot-openssl-3.patch |  45 ++++
 2 files changed, 344 insertions(+)

diff --git a/net-mail/dovecot/dovecot-2.3.20-r1.ebuild b/net-mail/dovecot/dovecot-2.3.20-r1.ebuild
new file mode 100644
index 000000000000..5736f149f606
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.3.20-r1.ebuild
@@ -0,0 +1,299 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-1 lua5-3 )
+# do not add a ssl USE flag.  ssl is mandatory
+SSL_DEPS_SKIP=1
+inherit autotools flag-o-matic lua-single ssl-cert systemd toolchain-funcs
+
+MY_P="${P/_/.}"
+#MY_S="${PN}-ce-${PV}"
+major_minor="$(ver_cut 1-2)"
+sieve_version="0.5.20"
+if [[ ${PV} == *_rc* ]]; then
+	rc_dir="rc/"
+else
+	rc_dir=""
+fi
+SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
+	sieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	)
+	managesieve? (
+	https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
+	) "
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
+HOMEPAGE="https://www.dovecot.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1 MIT"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+
+IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite"
+IUSE_DOVECOT_COMPRESS="lz4 zstd"
+IUSE_DOVECOT_OTHER="argon2 caps doc lucene managesieve rpc
+	selinux sieve solr static-libs stemmer suid systemd tcpd textcat unwind"
+
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
+
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
+
+DEPEND="
+	app-arch/bzip2
+	app-arch/xz-utils
+	dev-libs/icu:=
+	dev-libs/openssl:0=
+	sys-libs/zlib:=
+	virtual/libiconv
+	argon2? ( dev-libs/libsodium:= )
+	caps? ( sys-libs/libcap )
+	kerberos? ( virtual/krb5 )
+	ldap? ( net-nds/openldap:= )
+	lua? ( ${LUA_DEPS} )
+	lucene? ( >=dev-cpp/clucene-2.3 )
+	lz4? ( app-arch/lz4 )
+	mysql? ( dev-db/mysql-connector-c:0= )
+	pam? ( sys-libs/pam:= )
+	postgres? ( dev-db/postgresql:* )
+	rpc? ( net-libs/libtirpc:= net-libs/rpcsvc-proto )
+	selinux? ( sec-policy/selinux-dovecot )
+	solr? ( net-misc/curl dev-libs/expat )
+	sqlite? ( dev-db/sqlite:* )
+	stemmer? ( dev-libs/snowball-stemmer:= )
+	suid? ( acct-group/mail )
+	systemd? ( sys-apps/systemd:= )
+	tcpd? ( sys-apps/tcp-wrappers )
+	textcat? ( app-text/libexttextcat )
+	unwind? ( sys-libs/libunwind:= )
+	zstd? ( app-arch/zstd:= )
+	virtual/libcrypt:=
+	"
+
+RDEPEND="
+	${DEPEND}
+	acct-group/dovecot
+	acct-group/dovenull
+	acct-user/dovecot
+	acct-user/dovenull
+	net-mail/mailbase
+	"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}"-autoconf-lua-version-v2.patch
+	"${FILESDIR}/${PN}"-socket-name-too-long.patch
+	"${FILESDIR}/${PN}"-2.3.19.1-slibtool.patch # 782631
+	"${FILESDIR}"/CVE-2022-30550.patch
+	"${FILESDIR}/${PN}"-openssl-3.patch
+)
+
+pkg_setup() {
+	use lua && lua-single_pkg_setup
+	if use managesieve && ! use sieve; then
+		ewarn "managesieve USE flag selected but sieve USE flag unselected"
+		ewarn "sieve USE flag will be turned on"
+	fi
+}
+
+src_prepare() {
+	default
+	# bug 657108, 782631
+	#elibtoolize
+	eautoreconf
+
+	# Bug #727244
+	append-cflags -fasynchronous-unwind-tables
+}
+
+src_configure() {
+	local conf=""
+
+	if use postgres || use mysql || use sqlite; then
+		conf="${conf} --with-sql"
+	fi
+
+	# turn valgrind tests off. Bug #340791
+	VALGRIND=no \
+	LUAPC="${ELUA}" \
+	systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+	econf \
+		--with-rundir="${EPREFIX}/run/dovecot" \
+		--with-statedir="${EPREFIX}/var/lib/dovecot" \
+		--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
+		--disable-rpath \
+		--with-bzlib \
+		--without-libbsd \
+		--with-lzma \
+		--with-icu \
+		--with-ssl \
+		--with-zlib \
+		$( use_with argon2 sodium ) \
+		$( use_with caps libcap ) \
+		$( use_with kerberos gssapi ) \
+		$( use_with lua ) \
+		$( use_with ldap ) \
+		$( use_with lucene ) \
+		$( use_with lz4 ) \
+		$( use_with mysql ) \
+		$( use_with pam ) \
+		$( use_with postgres pgsql ) \
+		$( use_with sqlite ) \
+		$( use_with solr ) \
+		$( use_with stemmer ) \
+		$( use_with systemd ) \
+		$( use_with tcpd libwrap ) \
+		$( use_with textcat ) \
+		$( use_with unwind libunwind ) \
+		$( use_with zstd ) \
+		$( use_enable static-libs static ) \
+		${conf}
+
+	if use sieve || use managesieve; then
+		# The sieve plugin needs this file to be build to determine the plugin
+		# directory and the list of libraries to link to.
+		emake dovecot-config
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		econf \
+			$( use_enable static-libs static ) \
+			--localstatedir="${EPREFIX}/var" \
+			--enable-shared \
+			--with-dovecot="${S}" \
+			$( use_with ldap ) \
+			$( use_with managesieve )
+	fi
+}
+
+src_compile() {
+	default
+	if use sieve || use managesieve; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+	fi
+}
+
+src_test() {
+	default
+	if use sieve || use managesieve; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		default
+	fi
+}
+
+src_install() {
+	default
+
+	if use suid; then
+		einfo "Changing perms to allow deliver to be suided"
+		fowners root:mail "/usr/libexec/dovecot/dovecot-lda"
+		fperms 4750 "/usr/libexec/dovecot/dovecot-lda"
+	fi
+
+	newinitd "${FILESDIR}"/dovecot.init-r6 dovecot
+
+	rm -rf "${ED}"/usr/share/doc/dovecot
+
+	dodoc AUTHORS NEWS README TODO
+	dodoc doc/*.{txt,cnf,xml,sh}
+	docinto example-config
+	dodoc doc/example-config/*.{conf,ext}
+	docinto example-config/conf.d
+	dodoc doc/example-config/conf.d/*.{conf,ext}
+	docinto wiki
+	dodoc doc/wiki/*
+	doman doc/man/*.{1,7}
+
+	# Create the dovecot.conf file from the dovecot-example.conf file that
+	# the dovecot folks nicely left for us....
+	local conf="${ED}/etc/dovecot/dovecot.conf"
+	local confd="${ED}/etc/dovecot/conf.d"
+
+	insinto /etc/dovecot
+	doins doc/example-config/*.{conf,ext}
+	insinto /etc/dovecot/conf.d
+	doins doc/example-config/conf.d/*.{conf,ext}
+	fperms 0600 /etc/dovecot/dovecot-{ldap,sql}.conf.ext
+	rm -f "${confd}/../README"
+
+	# .maildir is the Gentoo default
+	local mail_location="maildir:~/.maildir"
+	sed -i -e \
+		"s|#mail_location =|mail_location = ${mail_location}|" \
+		"${confd}/10-mail.conf" \
+		|| die "failed to update mail location settings in 10-mail.conf"
+
+	# We're using pam files (imap and pop3) provided by mailbase
+	if use pam; then
+		sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
+			"${confd}/auth-system.conf.ext" \
+			|| die "failed to update PAM settings in auth-system.conf.ext"
+		# mailbase does not provide a sieve pam file
+		use managesieve && dosym imap /etc/pam.d/sieve
+		sed -i -e \
+			's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update PAM settings in 10-auth.conf"
+	fi
+
+	# Update ssl cert locations
+	sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
+		|| die "ssl conf failed"
+	sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
+		-e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
+		"${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
+
+	# Install SQL configuration
+	if use mysql || use postgres; then
+		sed -i -e \
+			's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
+			"${confd}/10-auth.conf" || die "failed to update SQL settings in \
+			10-auth.conf"
+	fi
+
+	# Install LDAP configuration
+	if use ldap; then
+		sed -i -e \
+			's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
+			"${confd}/10-auth.conf" \
+			|| die "failed to update ldap settings in 10-auth.conf"
+	fi
+
+	if use sieve || use managesieve; then
+		cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
+		emake DESTDIR="${ED}" install
+		sed -i -e \
+			's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
+			|| die "failed to update sieve settings in 15-lda.conf"
+		rm -rf "${ED}"/usr/share/doc/dovecot
+		docinto example-config/conf.d
+		dodoc doc/example-config/conf.d/*.conf
+		insinto /etc/dovecot/conf.d
+		doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
+		use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
+		docinto sieve/rfc
+		dodoc doc/rfc/*.txt
+		docinto sieve/devel
+		dodoc doc/devel/DESIGN
+		docinto plugins
+		dodoc doc/plugins/*.txt
+		docinto extensions
+		dodoc doc/extensions/*.txt
+		docinto locations
+		dodoc doc/locations/*.txt
+		doman doc/man/*.{1,7}
+	fi
+
+	use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
+}
+
+pkg_postinst() {
+	# Let's not make a new certificate if we already have one
+	if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
+		-e "${ROOT}"/etc/ssl/dovecot/server.key ]];	then
+		einfo "Creating SSL	certificate"
+		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
+		install_cert /etc/ssl/dovecot/server
+	fi
+}

diff --git a/net-mail/dovecot/files/dovecot-openssl-3.patch b/net-mail/dovecot/files/dovecot-openssl-3.patch
new file mode 100644
index 000000000000..8f39a7ddfe21
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-openssl-3.patch
@@ -0,0 +1,45 @@
+From: =?utf-8?q?Christian_G=C3=B6ttsche?= <cgzones@googlemail.com>
+Date: Wed, 11 May 2022 20:27:53 +0200
+Author: Michal Hlavinka
+Origin: https://bugzilla.redhat.com/show_bug.cgi?id=1962035
+Subject: Support openssl 3.0
+
+---
+ src/lib-dcrypt/dcrypt-openssl.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/src/lib-dcrypt/dcrypt-openssl.c b/src/lib-dcrypt/dcrypt-openssl.c
+index 1cbe352..5570d62 100644
+--- a/src/lib-dcrypt/dcrypt-openssl.c
++++ b/src/lib-dcrypt/dcrypt-openssl.c
+@@ -73,10 +73,30 @@
+   2<tab>key algo oid<tab>1<tab>symmetric algo name<tab>salt<tab>hash algo<tab>rounds<tab>E(RSA = i2d_PrivateKey, EC=Private Point)<tab>key id
+ **/
+ 
++#if OPENSSL_VERSION_MAJOR == 3
++static EC_KEY *EVP_PKEY_get0_EC_KEYv3(EVP_PKEY *key)
++{
++  EC_KEY *eck = EVP_PKEY_get1_EC_KEY(key);
++  EVP_PKEY_set1_EC_KEY(key, eck);
++  EC_KEY_free(eck);
++  return eck;
++}
++
++static EC_KEY *EVP_PKEY_get1_EC_KEYv3(EVP_PKEY *key)
++{
++  EC_KEY *eck = EVP_PKEY_get1_EC_KEY(key);
++  EVP_PKEY_set1_EC_KEY(key, eck);
++  return eck;
++}
++
++#define EVP_PKEY_get0_EC_KEY EVP_PKEY_get0_EC_KEYv3 
++#define EVP_PKEY_get1_EC_KEY EVP_PKEY_get1_EC_KEYv3
++#else
+ #ifndef HAVE_EVP_PKEY_get0
+ #define EVP_PKEY_get0_EC_KEY(x) x->pkey.ec
+ #define EVP_PKEY_get0_RSA(x) x->pkey.rsa
+ #endif
++#endif
+ 
+ #ifndef HAVE_OBJ_LENGTH
+ #define OBJ_length(o) ((o)->length)


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-26  9:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-24 15:50 [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/ Eray Aslan
  -- strict thread matches above, loose matches on Subject: below --
2018-02-01  1:18 Thomas Deutschmann
2018-10-05 11:08 Eray Aslan
2019-08-29  5:39 Eray Aslan
2020-09-05 23:45 Thomas Deutschmann
2020-11-23 11:41 Eray Aslan
2021-01-05  9:35 Eray Aslan
2021-02-05 21:09 Sam James
2021-06-22 11:46 Eray Aslan
2022-12-26  9:32 Eray Aslan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox