summaryrefslogtreecommitdiff
path: root/net-mail/dovecot
diff options
context:
space:
mode:
Diffstat (limited to 'net-mail/dovecot')
-rw-r--r--net-mail/dovecot/Manifest3
-rw-r--r--net-mail/dovecot/dovecot-2.2.33.2-r1.ebuild291
-rw-r--r--net-mail/dovecot/dovecot-2.3.0-r2.ebuild286
-rw-r--r--net-mail/dovecot/files/dovecot-2.2.33.2-CVE-2017-15132.patch14
4 files changed, 594 insertions, 0 deletions
diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
index a042c90f112d..9b3ca7b1e8fa 100644
--- a/net-mail/dovecot/Manifest
+++ b/net-mail/dovecot/Manifest
@@ -1,4 +1,5 @@
AUX dovecot-10-ssl.patch 550 BLAKE2B 5317b802113e6dd711056684bb2de8167113c95ea28ea805fd3a1f688878505d02d85bd9ab69fc222cb2debdc1b5186f48f3c2cbea2f1df24714482939284f46 SHA512 7acc31dd4a3f51a9c13d590fd2803c2cb98c281e0595ca2a800539a143f89b95f923a3678beb0aa2b254a54385522329e0f3e1e8ba4c5852e7b51f8f111122a9
+AUX dovecot-2.2.33.2-CVE-2017-15132.patch 582 BLAKE2B fdc4cf138c3c943ed34b520a3935fc3d941063fdd64c4dd50a1d03f9374e79062a14b35b9894bd8744e640377c493fc0641c451a0da695a52f893386cbb3a443 SHA512 be433223e55859199c5dd651286a634fec03b7efcb0221297139154383dc71c30a75fa8484ae338babc8ec2f9a1a4cf0aeebc53cf1d7286272a663068537ccfd
AUX dovecot.init-r4 1499 BLAKE2B 9c05fd7da0409b0944b0204bdcd683ab889190effc8cb7b072dcab140f52e2f39336a344deb74b63ef184152604412ca4c2b3d79c3d63341386e7952c54b0a26 SHA512 8fbc80bc0efa6b83685da19b6a5c2a2d2ca7e59be7f1f7352984fe30004175330e53f3db1c4c2471f1d7d5e088bef0b4dced97d29d32be8b50d000987b6eeb09
DIST dovecot-2.2-pigeonhole-0.4.18.tar.gz 1742357 BLAKE2B 8f9fc54e6effb233f7e8543a560b474dd4cd028d0a7bd1cc02e45c879bc2e7d636c2543e8aed3bd8e0b49b260703590be44fd1032ba3e1f4eb87a8e6f8ecf396 SHA512 6f49a6a6435b0e4dcbe29f852ce17c016df2f367f5460301a2a2c6bd5f5ba6260b23bfe1c5e78b91c6041554ee67d1ce14ad3adf219505f692c61681d9e70cc4
DIST dovecot-2.2-pigeonhole-0.4.20.tar.gz 1745121 BLAKE2B 4a320d7340f3a7fbb92f911c16abb49561692310c7c9224842065b9830f057e442e6ae27010232d615a06f6fdd889ef8619c555516e2d843802297644b935a27 SHA512 84a28842be206e05cb96c07cf1c1b62c9c378ba4c952caa47cf79a44b9428e076f4182eadd9c4fb8f45d3605b881f91e8e520c41705017ac4039240d4bcace39
@@ -14,7 +15,9 @@ DIST dovecot-2.3.0.tar.gz 6635541 BLAKE2B 3c76ccc0fac19511c9852aabd5d86c2fb81589
EBUILD dovecot-2.2.19.ebuild 9085 BLAKE2B 6f0bcda9ec145e8ad90e024fbe38f4036ca4ff632a7281bdaf1f292d148b63df587ea380a7df8bcf0bde2e5aa9e4ca6200f2159b61923fe93710f7c30dc230d3 SHA512 cb619f9f5588ab1be1b5de749663e4798044d695a359c96182037c8b3cdb94c8a7b41eac93054f2979b30d09405a3396e83d0d08cad3ad964654ae98f7632098
EBUILD dovecot-2.2.29.1.ebuild 9214 BLAKE2B 4107278bc4fe19d5ea04f1e7218ba4ce7f4fbcc7521d04d018433934b23f46480bb62a2c00f6ec324e8d32ca2fdc7064f19c927d4285460f8f357e28f5f4f307 SHA512 e278bb8f734cc648ae10b34615ef08b3bbd4e070dda898c85ec5b48dde22b6475b266470cbba41f82b33969ad2f55fc523d6a2df9a3f74dceaa14e015b8b5ccf
EBUILD dovecot-2.2.32.ebuild 8654 BLAKE2B 46aa411f0cab5d3ef96127912d59e23d72a8b4149afed4f9e7fbbb39397f75ff1a4369d10e259287ff0c5bf6b8bbcfe8de19f4940645ba315ab2a0c9c692668e SHA512 570c9c5e20344a3c941e7b13a3dd1be6150967a108f15150d56dbcd6852e08a67a4b975259fabb8bdb9ecfd1a5dd3cbf94b19c13c5482cc39dc2fe23bfb77a80
+EBUILD dovecot-2.2.33.2-r1.ebuild 8717 BLAKE2B 293456634a74b240d0dd8e06f2929b53a101fd1d91ac1faff53b89449bdab7b5c3d3223a2761188123010738e8e7607f138a6db6f6f29a6139d5efcde682e93b SHA512 4dd6f96f611668fcac174ee055529fd910f42d79fedd3bce465a9ce354a650a4062b7fe202b1a2a3edd1fd1cc5fe74ef64ecce3e437a0d8671202a8e652126f6
EBUILD dovecot-2.2.33.2.ebuild 8659 BLAKE2B cbfd45f4ac3642de86f543fafb39e91c67ee27eec6d67f8e862670f8a125e7d4c9dab55771100db357dd8576c6fba1d6ae825c240f7cf803a95e141955a183ce SHA512 6c86a0ade4f80b658e162b7518f5bc543c2b51008ecc33894432a22b7de1b2b78a11fb38483630f1277bd89c60d6a119f5a4400d11d5d4f9c9505b2484d2ad47
EBUILD dovecot-2.3.0-r1.ebuild 8684 BLAKE2B c8f291c972ea59fe10c7cfe1dc4bbe49998aa9e1764c18ee95825a9dc91e05eec64e4e73956a61860989341b94a4c3688ff6ead414bd36bc63c7ae01ec7efe73 SHA512 ea6b08be76fb43c4a66355daf9ae1e73e51bf5f6b39d9638cfad112e434721a58fcea99936fff6a332c9a39518c797daa8e023bbdca96d1633a508460977ae4d
+EBUILD dovecot-2.3.0-r2.ebuild 8747 BLAKE2B 2e89b81e959b7e7350a407f41a6a826d34b5b087c3d2f6e4b112248084cef9fef1337140b299ee42dfcac016e302b98dfefe733b27a54064252309ef9b05744f SHA512 76ce6c3d0cc7b22189d51c6f87a631f44381bdbc23c3dd29c9f94b40fcaf9e481b8e8a91d55816e9d1c6807a878f4362dc8fb3034c4d066ff0677cc265a95577
EBUILD dovecot-2.3.0.ebuild 8682 BLAKE2B 8e68158b78c35696390ceb4d9d235e2b42b3c021d42104edc02a1b0b7317194ba8ff378ad13e1dc2b440ca9bb7bba6cb77f7bc27e1468468a9ca5b733ef73be2 SHA512 c0623ef0de56297328fddb614364e2500bda86237997042b0e3f75692e994d23f743769333c050cc13b7d0cb71ba67cdbaf15df6be1aefd2cdcae1bd94467a4b
MISC metadata.xml 1374 BLAKE2B 629969318c5bcbdf0521d2293c6ead5e735ba5a113db3166e4df82103a3a84cbc62f3a2843082c9d5bdb635f25353ac7d3a4fcdf80d45e07b11b98754e744506 SHA512 16bdf15120dd8c957cd6e4957910acf21440dd0b8774cac9d9c5a48635cd46c7093850974b592ebbcd49085607fff2051691a42112f4ab9df44c51b9fea6d180
diff --git a/net-mail/dovecot/dovecot-2.2.33.2-r1.ebuild b/net-mail/dovecot/dovecot-2.2.33.2-r1.ebuild
new file mode 100644
index 000000000000..c45f29c7a8b2
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.2.33.2-r1.ebuild
@@ -0,0 +1,291 @@
+# 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_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-r2.ebuild b/net-mail/dovecot/dovecot-2.3.0-r2.ebuild
new file mode 100644
index 000000000000..bac241d30cad
--- /dev/null
+++ b/net-mail/dovecot/dovecot-2.3.0-r2.ebuild
@@ -0,0 +1,286 @@
+# 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 )
+
+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.patch b/net-mail/dovecot/files/dovecot-2.2.33.2-CVE-2017-15132.patch
new file mode 100644
index 000000000000..3f87e71b559a
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-2.2.33.2-CVE-2017-15132.patch
@@ -0,0 +1,14 @@
+CVE-2017-15132: dovecot: auth client leaks memory if SASL authentication is aborted.
+
+https://github.com/dovecot/core/commit/1a29ed2f96da1be22fa5a4d96c7583aa81b8b060
+
+--- a/src/lib-auth/auth-client-request.c
++++ b/src/lib-auth/auth-client-request.c
+@@ -186,6 +186,7 @@ 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);
++ pool_unref(&request->pool);
+ }
+
+ unsigned int auth_client_request_get_id(struct auth_client_request *request)