summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-mail/cyrus-imapd
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-mail/cyrus-imapd')
-rw-r--r--net-mail/cyrus-imapd/Manifest4
-rw-r--r--net-mail/cyrus-imapd/cyrus-imapd-2.4.16.ebuild183
-rw-r--r--net-mail/cyrus-imapd/cyrus-imapd-2.4.17-r1.ebuild203
-rw-r--r--net-mail/cyrus-imapd/cyrus-imapd-2.4.17.ebuild198
-rw-r--r--net-mail/cyrus-imapd/cyrus-imapd-2.4.18.ebuild198
-rw-r--r--net-mail/cyrus-imapd/cyrus-imapd-2.5.4.ebuild176
-rw-r--r--net-mail/cyrus-imapd/files/cyrus-imapd-2.4.17-statuscache.diff11
-rw-r--r--net-mail/cyrus-imapd/files/cyrus-imapd-db.patch81
-rw-r--r--net-mail/cyrus-imapd/files/cyrus.conf43
-rw-r--r--net-mail/cyrus-imapd/files/cyrus.confd6
-rw-r--r--net-mail/cyrus-imapd/files/cyrus.pam-include6
-rw-r--r--net-mail/cyrus-imapd/files/cyrus.rc623
-rw-r--r--net-mail/cyrus-imapd/files/imapd.conf52
-rw-r--r--net-mail/cyrus-imapd/metadata.xml11
14 files changed, 1195 insertions, 0 deletions
diff --git a/net-mail/cyrus-imapd/Manifest b/net-mail/cyrus-imapd/Manifest
new file mode 100644
index 000000000000..6772d4c81c56
--- /dev/null
+++ b/net-mail/cyrus-imapd/Manifest
@@ -0,0 +1,4 @@
+DIST cyrus-imapd-2.4.16.tar.gz 2484201 SHA256 beac9d6059680bbf65948db60a30c6e8f59786df4a7821c70dc27b2a225f32c4 SHA512 31931e94ebe869516f10886cee5ab152fb6d6376bf009250718077732c6172a6430f3502370e15e94f6165500e5b4108623bceea7c0dcfb3eb746e9ff0fcffab WHIRLPOOL 1e9916d03448e7f036aa6320af69a7ae57ae37205f98d4cfee8c335d9dcdc1c09ba243f4506036da4ca17f859f5c7eef0cb56443dfe51ad3075f0e4d62874fcb
+DIST cyrus-imapd-2.4.17.tar.gz 2486355 SHA256 b3e30052c764ee7163947ffde27bdd58bd4dd2e5697ad144491941e46300a583 SHA512 86ffe1664ca3c3df164ed8fca21cc08ddae12380e1485deccec7da4ec263d8b953a806e05f0b10f6fb7717a0d40fc05669792b77cc66d7c5067061c8506e59ee WHIRLPOOL 22566578217a5901793b886ff020aa1deecbb81bf85f54a524b58de129029e51b0aa358db902a2139584d05f668404cb98ca2ff3fa33803ce986e07b95c69c45
+DIST cyrus-imapd-2.4.18.tar.gz 2495098 SHA256 166a0a1efbf01f71d9d8449569152b3cda4949cd689f299a5e77a38d7026012c SHA512 3b234c1773fe5d57cae35743985930bc7fed2eedaa0919598da8fb19588f95b3beb8ad166d3b4f0c96faf006ff56ed5027ec516fab6007edbe46c4f45572a1ef WHIRLPOOL 1a243a9b3875105dfc414e1092f328691b6bef7c0d04f8bd91824ca0d01c715ebc2449c37bbca2ab86193e4d2dc426b33cfd31a0cdfdea0bacc081fd9010b1df
+DIST cyrus-imapd-2.5.4.tar.gz 3070894 SHA256 98839d2865c0ff5c5dc0f59aba54ad111135697c3383919e037651d90f00aaaa SHA512 0bc78bf63560cc0d89f0ef4a5f6a160300cbb1090394d6bc62f51a0d73ea3615a1ecbf95cb6dab9d10c99afd3a95079a6df86a8157042e13bf907bb4eca94423 WHIRLPOOL 02ee9a685e6825473e9643e70ad4e22e22a9b6e263ec81692ff0d9e68c3b1b07b5ed1cdb1bbf4119242429779fe0435d9ae00651fbaec465308ac8bdf96650eb
diff --git a/net-mail/cyrus-imapd/cyrus-imapd-2.4.16.ebuild b/net-mail/cyrus-imapd/cyrus-imapd-2.4.16.ebuild
new file mode 100644
index 000000000000..728aad3b6871
--- /dev/null
+++ b/net-mail/cyrus-imapd/cyrus-imapd-2.4.16.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit db-use eutils multilib pam ssl-cert user
+
+MY_P=${P/_/}
+
+DESCRIPTION="The Cyrus IMAP Server"
+HOMEPAGE="http://www.cyrusimap.org/"
+SRC_URI="ftp://ftp.cyrusimap.org/cyrus-imapd/${MY_P}.tar.gz"
+
+LICENSE="BSD-with-attribution"
+SLOT="0"
+KEYWORDS="amd64 ~arm hppa ~ia64 ppc ppc64 sparc x86"
+IUSE="afs berkdb kerberos mysql nntp pam postgres replication sieve snmp sqlite ssl tcpd"
+
+RDEPEND="sys-libs/zlib
+ >=dev-libs/cyrus-sasl-2.1.13
+ afs? ( net-fs/openafs )
+ berkdb? ( >=sys-libs/db-3.2 )
+ kerberos? ( virtual/krb5 )
+ mysql? ( virtual/mysql )
+ nntp? ( !net-nntp/leafnode )
+ pam? (
+ virtual/pam
+ >=net-mail/mailbase-1
+ )
+ postgres? ( dev-db/postgresql )
+ snmp? ( >=net-analyzer/net-snmp-5.2.2-r1 )
+ sqlite? ( dev-db/sqlite )
+ ssl? ( >=dev-libs/openssl-0.9.6 )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 snmp? ( net-analyzer/net-snmp[tcpd=] ) )"
+
+DEPEND="$RDEPEND"
+
+# get rid of old style virtual - bug 350792
+# all blockers really needed?
+RDEPEND="${RDEPEND}
+ !mail-mta/courier
+ !net-mail/bincimap
+ !net-mail/courier-imap
+ !net-mail/uw-imap"
+
+REQUIRED_USE="afs? ( kerberos )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser cyrus -1 -1 /usr/cyrus mail
+}
+
+src_prepare() {
+ # Fix master(8)->cyrusmaster(8) manpage.
+ for i in `grep -rl -e 'master\.8' -e 'master(8)' "${S}"` ; do
+ sed -i -e 's:master\.8:cyrusmaster.8:g' \
+ -e 's:master(8):cyrusmaster(8):g' \
+ "${i}" || die "sed failed" || die "sed failed"
+ done
+ mv man/master.8 man/cyrusmaster.8 || die "mv failed"
+ sed -i -e "s:MASTER:CYRUSMASTER:g" \
+ -e "s:Master:Cyrusmaster:g" \
+ -e "s:master:cyrusmaster:g" \
+ man/cyrusmaster.8 || die "sed failed"
+
+ # do not strip
+ sed -i -e '/(INSTALL/s/-s //' "${S}"/imtest/Makefile.in
+
+ # correct afs include and liblwp.a directory
+ sed -i -e '/I${with_afs_incdir/s/\/include//' \
+ -e '/liblwp/s/liblwp/afs\/liblwp/' \
+ "${S}"/configure{,.in} || die
+ # same with lock.h
+ sed -i -e '/lock.h/s:lock.h:afs/lock.h:' \
+ ptclient/afskrb.c || die
+ # libcom_err.a to libafscom_err.a
+ sed -i -e '/afs\/libcom_err.a/s:libcom_err.a:libafscom_err.a:' \
+ configure{,.in} || die
+}
+
+src_configure() {
+ local myconf
+ if use mysql ; then
+ myconf=$(mysql_config --include)
+ myconf="--with-mysql-incdir=${myconf#-I}"
+ fi
+ if use afs ; then
+ myconf+=" --with-afs-libdir=/usr/$(get_libdir)"
+ myconf+=" --with-afs-incdir=/usr/include/afs"
+ fi
+ if use berkdb ; then
+ myconf+=" --with-bdb-incdir=$(db_includedir)"
+ fi
+ econf \
+ --enable-murder \
+ --enable-netscapehack \
+ --enable-idled \
+ --with-service-path=/usr/$(get_libdir)/cyrus \
+ --with-cyrus-user=cyrus \
+ --with-cyrus-group=mail \
+ --with-com_err=yes \
+ --with-sasl \
+ --without-perl \
+ --without-krb \
+ --without-krbdes \
+ --with-zlib \
+ $(use_enable afs) \
+ $(use_enable afs krb5afspts) \
+ $(use_with berkdb bdb) \
+ $(use_enable nntp) \
+ $(use_enable replication) \
+ $(use_enable kerberos gssapi) \
+ $(use_with mysql) \
+ $(use_with postgres pgsql) \
+ $(use_with sqlite) \
+ $(use_with ssl openssl) \
+ $(use_enable sieve) \
+ $(use_with snmp) \
+ $(use_with tcpd libwrap) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # file collision - bug #368245
+ if ! use nntp ; then
+ rm "${D}"/usr/share/man/man8/fetchnews.8*
+ fi
+
+ dodoc README*
+ dohtml doc/*.html doc/murder.png
+ docinto text
+ dodoc doc/text/*
+ cp doc/cyrusv2.mc "${D}/usr/share/doc/${PF}/html"
+ cp -r contrib tools "${D}/usr/share/doc/${PF}"
+ rm -f doc/text/Makefile*
+
+ insinto /etc
+ doins "${FILESDIR}/cyrus.conf" "${FILESDIR}/imapd.conf"
+
+ # turn off sieve if not installed
+ if ! use sieve; then
+ sed -i -e "/sieve/s/^/#/" "${D}/etc/cyrus.conf" || die
+ fi
+
+ newinitd "${FILESDIR}/cyrus.rc6" cyrus
+ newconfd "${FILESDIR}/cyrus.confd" cyrus
+ newpamd "${FILESDIR}/cyrus.pam-include" sieve
+
+ for subdir in imap/{,db,log,msg,proc,socket,sieve} spool/imap/{,stage.} ; do
+ keepdir "/var/${subdir}"
+ fowners cyrus:mail "/var/${subdir}"
+ fperms 0750 "/var/${subdir}"
+ done
+ for subdir in imap/{user,quota,sieve} spool/imap ; do
+ for i in a b c d e f g h i j k l m n o p q r s t v u w x y z ; do
+ keepdir "/var/${subdir}/${i}"
+ fowners cyrus:mail "/var/${subdir}/${i}"
+ fperms 0750 "/var/${subdir}/${i}"
+ done
+ done
+}
+
+pkg_postinst() {
+ # do not install server.{key,pem) if they exist.
+ if use ssl ; then
+ if [ ! -f "${ROOT}"etc/ssl/cyrus/server.key ]; then
+ install_cert /etc/ssl/cyrus/server
+ chown cyrus:mail "${ROOT}"etc/ssl/cyrus/server.{key,pem}
+ fi
+ fi
+
+ elog "For correct logging add the following to /etc/syslog.conf:"
+ elog " local6.* /var/log/imapd.log"
+ elog " auth.debug /var/log/auth.log"
+ echo
+
+ elog "You have to add user cyrus to the sasldb2. Do this with:"
+ elog " saslpasswd2 cyrus"
+}
diff --git a/net-mail/cyrus-imapd/cyrus-imapd-2.4.17-r1.ebuild b/net-mail/cyrus-imapd/cyrus-imapd-2.4.17-r1.ebuild
new file mode 100644
index 000000000000..f4ef86f14cf0
--- /dev/null
+++ b/net-mail/cyrus-imapd/cyrus-imapd-2.4.17-r1.ebuild
@@ -0,0 +1,203 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools db-use eutils multilib pam ssl-cert user toolchain-funcs
+
+MY_P=${P/_/}
+
+DESCRIPTION="The Cyrus IMAP Server"
+HOMEPAGE="http://www.cyrusimap.org/"
+SRC_URI="ftp://ftp.cyrusimap.org/cyrus-imapd/${MY_P}.tar.gz"
+
+LICENSE="BSD-with-attribution"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="afs berkdb kerberos mysql nntp pam postgres replication sieve snmp sqlite ssl tcpd"
+
+# virtual/mysql-5.5 added for the --variable= option below
+RDEPEND="sys-libs/zlib
+ >=dev-libs/cyrus-sasl-2.1.13
+ afs? ( net-fs/openafs )
+ berkdb? ( >=sys-libs/db-3.2 )
+ kerberos? ( virtual/krb5 )
+ mysql? ( >=virtual/mysql-5.5 )
+ nntp? ( !net-nntp/leafnode )
+ pam? (
+ virtual/pam
+ >=net-mail/mailbase-1
+ )
+ postgres? ( dev-db/postgresql )
+ snmp? ( >=net-analyzer/net-snmp-5.2.2-r1 )
+ sqlite? ( dev-db/sqlite )
+ ssl? ( >=dev-libs/openssl-0.9.6 )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 snmp? ( net-analyzer/net-snmp[tcpd=] ) )"
+
+DEPEND="$RDEPEND"
+
+# get rid of old style virtual - bug 350792
+# all blockers really needed?
+RDEPEND="${RDEPEND}
+ !mail-mta/courier
+ !net-mail/bincimap
+ !net-mail/courier-imap
+ !net-mail/uw-imap"
+
+REQUIRED_USE="afs? ( kerberos )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser cyrus -1 -1 /usr/cyrus mail
+}
+
+src_prepare() {
+ # fix squatter segfaults, see:
+ # https://bugzilla.cyrusimap.org/show_bug.cgi?id=3757
+ epatch "${FILESDIR}/${P}-statuscache.diff"
+
+ # Fix master(8)->cyrusmaster(8) manpage.
+ for i in `grep -rl -e 'master\.8' -e 'master(8)' "${S}"` ; do
+ sed -i -e 's:master\.8:cyrusmaster.8:g' \
+ -e 's:master(8):cyrusmaster(8):g' \
+ "${i}" || die "sed failed" || die "sed failed"
+ done
+ mv man/master.8 man/cyrusmaster.8 || die "mv failed"
+ sed -i -e "s:MASTER:CYRUSMASTER:g" \
+ -e "s:Master:Cyrusmaster:g" \
+ -e "s:master:cyrusmaster:g" \
+ man/cyrusmaster.8 || die "sed failed"
+
+ # do not strip
+ sed -i -e '/(INSTALL/s/-s //' "${S}"/imtest/Makefile.in
+
+ # correct afs include and liblwp.a directory
+ sed -i -e '/I${with_afs_incdir/s/\/include//' \
+ -e '/liblwp/s/liblwp/afs\/liblwp/' \
+ "${S}"/configure{,.in} || die
+ # same with lock.h
+ sed -i -e '/lock.h/s:lock.h:afs/lock.h:' \
+ ptclient/afskrb.c || die
+ # libcom_err.a to libafscom_err.a
+ sed -i -e '/afs\/libcom_err.a/s:libcom_err.a:libafscom_err.a:' \
+ configure{,.in} || die
+
+ sed -i -e "s/ar cr/$(tc-getAR) cr/" \
+ perl/sieve/lib/Makefile.in \
+ imap/Makefile.in \
+ lib/Makefile.in \
+ installsieve/Makefile.in \
+ com_err/et/Makefile.in \
+ sieve/Makefile.in \
+ syslog/Makefile.in || die
+
+ AT_M4DIR="cmulocal" eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use mysql ; then
+ myconf="--with-mysql-incdir=$(mysql_config --variable=pkgincludedir)"
+ myconf+=" --with-mysql-libdir=$(mysql_config --variable=pkglibdir)"
+ fi
+ if use afs ; then
+ myconf+=" --with-afs-libdir=/usr/$(get_libdir)"
+ myconf+=" --with-afs-incdir=/usr/include/afs"
+ fi
+ if use berkdb ; then
+ myconf+=" --with-bdb-incdir=$(db_includedir)"
+ fi
+ econf \
+ --enable-murder \
+ --enable-netscapehack \
+ --enable-idled \
+ --with-service-path=/usr/$(get_libdir)/cyrus \
+ --with-cyrus-user=cyrus \
+ --with-cyrus-group=mail \
+ --with-com_err=yes \
+ --with-sasl \
+ --without-perl \
+ --without-krb \
+ --without-krbdes \
+ --with-zlib \
+ $(use_enable afs) \
+ $(use_enable afs krb5afspts) \
+ $(use_with berkdb bdb) \
+ $(use_enable nntp) \
+ $(use_enable replication) \
+ $(use_enable kerberos gssapi) \
+ $(use_with mysql) \
+ $(use_with postgres pgsql) \
+ $(use_with sqlite) \
+ $(use_with ssl openssl) \
+ $(use_enable sieve) \
+ $(use_with snmp) \
+ $(use_with tcpd libwrap) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # file collision - bug #368245
+ if ! use nntp ; then
+ rm "${D}"/usr/share/man/man8/fetchnews.8*
+ fi
+
+ dodoc README*
+ dohtml doc/*.html doc/murder.png
+ docinto text
+ dodoc doc/text/*
+ cp doc/cyrusv2.mc "${D}/usr/share/doc/${PF}/html"
+ cp -r contrib tools "${D}/usr/share/doc/${PF}"
+ rm -f doc/text/Makefile*
+
+ insinto /etc
+ doins "${FILESDIR}/cyrus.conf" "${FILESDIR}/imapd.conf"
+
+ # turn off sieve if not installed
+ if ! use sieve; then
+ sed -i -e "/sieve/s/^/#/" "${D}/etc/cyrus.conf" || die
+ fi
+
+ newinitd "${FILESDIR}/cyrus.rc6" cyrus
+ newconfd "${FILESDIR}/cyrus.confd" cyrus
+ newpamd "${FILESDIR}/cyrus.pam-include" sieve
+
+ for subdir in imap/{,db,log,msg,proc,socket,sieve} spool/imap/{,stage.} ; do
+ keepdir "/var/${subdir}"
+ fowners cyrus:mail "/var/${subdir}"
+ fperms 0750 "/var/${subdir}"
+ done
+ for subdir in imap/{user,quota,sieve} spool/imap ; do
+ for i in a b c d e f g h i j k l m n o p q r s t v u w x y z ; do
+ keepdir "/var/${subdir}/${i}"
+ fowners cyrus:mail "/var/${subdir}/${i}"
+ fperms 0750 "/var/${subdir}/${i}"
+ done
+ done
+}
+
+pkg_preinst() {
+ if ! has_version ${CATEGORY}/${PN} ; then
+ elog "For correct logging add the following to /etc/syslog.conf:"
+ elog " local6.* /var/log/imapd.log"
+ elog " auth.debug /var/log/auth.log"
+ echo
+
+ elog "You have to add user cyrus to the sasldb2. Do this with:"
+ elog " saslpasswd2 cyrus"
+ fi
+}
+
+pkg_postinst() {
+ # do not install server.{key,pem) if they exist.
+ if use ssl ; then
+ if [ ! -f "${ROOT}"etc/ssl/cyrus/server.key ]; then
+ install_cert /etc/ssl/cyrus/server
+ chown cyrus:mail "${ROOT}"etc/ssl/cyrus/server.{key,pem}
+ fi
+ fi
+}
diff --git a/net-mail/cyrus-imapd/cyrus-imapd-2.4.17.ebuild b/net-mail/cyrus-imapd/cyrus-imapd-2.4.17.ebuild
new file mode 100644
index 000000000000..ec349747384d
--- /dev/null
+++ b/net-mail/cyrus-imapd/cyrus-imapd-2.4.17.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools db-use eutils multilib pam ssl-cert user toolchain-funcs
+
+MY_P=${P/_/}
+
+DESCRIPTION="The Cyrus IMAP Server"
+HOMEPAGE="http://www.cyrusimap.org/"
+SRC_URI="ftp://ftp.cyrusimap.org/cyrus-imapd/${MY_P}.tar.gz"
+
+LICENSE="BSD-with-attribution"
+SLOT="0"
+KEYWORDS="amd64 ~arm hppa ~ia64 ppc ppc64 sparc x86"
+IUSE="afs berkdb kerberos mysql nntp pam postgres replication sieve snmp sqlite ssl tcpd"
+
+RDEPEND="sys-libs/zlib
+ >=dev-libs/cyrus-sasl-2.1.13
+ afs? ( net-fs/openafs )
+ berkdb? ( >=sys-libs/db-3.2 )
+ kerberos? ( virtual/krb5 )
+ mysql? ( virtual/mysql )
+ nntp? ( !net-nntp/leafnode )
+ pam? (
+ virtual/pam
+ >=net-mail/mailbase-1
+ )
+ postgres? ( dev-db/postgresql )
+ snmp? ( >=net-analyzer/net-snmp-5.2.2-r1 )
+ sqlite? ( dev-db/sqlite )
+ ssl? ( >=dev-libs/openssl-0.9.6 )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 snmp? ( net-analyzer/net-snmp[tcpd=] ) )"
+
+DEPEND="$RDEPEND"
+
+# get rid of old style virtual - bug 350792
+# all blockers really needed?
+RDEPEND="${RDEPEND}
+ !mail-mta/courier
+ !net-mail/bincimap
+ !net-mail/courier-imap
+ !net-mail/uw-imap"
+
+REQUIRED_USE="afs? ( kerberos )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser cyrus -1 -1 /usr/cyrus mail
+}
+
+src_prepare() {
+ # Fix master(8)->cyrusmaster(8) manpage.
+ for i in `grep -rl -e 'master\.8' -e 'master(8)' "${S}"` ; do
+ sed -i -e 's:master\.8:cyrusmaster.8:g' \
+ -e 's:master(8):cyrusmaster(8):g' \
+ "${i}" || die "sed failed" || die "sed failed"
+ done
+ mv man/master.8 man/cyrusmaster.8 || die "mv failed"
+ sed -i -e "s:MASTER:CYRUSMASTER:g" \
+ -e "s:Master:Cyrusmaster:g" \
+ -e "s:master:cyrusmaster:g" \
+ man/cyrusmaster.8 || die "sed failed"
+
+ # do not strip
+ sed -i -e '/(INSTALL/s/-s //' "${S}"/imtest/Makefile.in
+
+ # correct afs include and liblwp.a directory
+ sed -i -e '/I${with_afs_incdir/s/\/include//' \
+ -e '/liblwp/s/liblwp/afs\/liblwp/' \
+ "${S}"/configure{,.in} || die
+ # same with lock.h
+ sed -i -e '/lock.h/s:lock.h:afs/lock.h:' \
+ ptclient/afskrb.c || die
+ # libcom_err.a to libafscom_err.a
+ sed -i -e '/afs\/libcom_err.a/s:libcom_err.a:libafscom_err.a:' \
+ configure{,.in} || die
+
+ sed -i -e "s/ar cr/$(tc-getAR) cr/" \
+ perl/sieve/lib/Makefile.in \
+ imap/Makefile.in \
+ lib/Makefile.in \
+ installsieve/Makefile.in \
+ com_err/et/Makefile.in \
+ sieve/Makefile.in \
+ syslog/Makefile.in || die
+
+ AT_M4DIR="cmulocal" eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use mysql ; then
+ myconf=$(mysql_config --include)
+ myconf="--with-mysql-incdir=${myconf#-I}"
+ fi
+ if use afs ; then
+ myconf+=" --with-afs-libdir=/usr/$(get_libdir)"
+ myconf+=" --with-afs-incdir=/usr/include/afs"
+ fi
+ if use berkdb ; then
+ myconf+=" --with-bdb-incdir=$(db_includedir)"
+ fi
+ econf \
+ --enable-murder \
+ --enable-netscapehack \
+ --enable-idled \
+ --with-service-path=/usr/$(get_libdir)/cyrus \
+ --with-cyrus-user=cyrus \
+ --with-cyrus-group=mail \
+ --with-com_err=yes \
+ --with-sasl \
+ --without-perl \
+ --without-krb \
+ --without-krbdes \
+ --with-zlib \
+ $(use_enable afs) \
+ $(use_enable afs krb5afspts) \
+ $(use_with berkdb bdb) \
+ $(use_enable nntp) \
+ $(use_enable replication) \
+ $(use_enable kerberos gssapi) \
+ $(use_with mysql) \
+ $(use_with postgres pgsql) \
+ $(use_with sqlite) \
+ $(use_with ssl openssl) \
+ $(use_enable sieve) \
+ $(use_with snmp) \
+ $(use_with tcpd libwrap) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # file collision - bug #368245
+ if ! use nntp ; then
+ rm "${D}"/usr/share/man/man8/fetchnews.8*
+ fi
+
+ dodoc README*
+ dohtml doc/*.html doc/murder.png
+ docinto text
+ dodoc doc/text/*
+ cp doc/cyrusv2.mc "${D}/usr/share/doc/${PF}/html"
+ cp -r contrib tools "${D}/usr/share/doc/${PF}"
+ rm -f doc/text/Makefile*
+
+ insinto /etc
+ doins "${FILESDIR}/cyrus.conf" "${FILESDIR}/imapd.conf"
+
+ # turn off sieve if not installed
+ if ! use sieve; then
+ sed -i -e "/sieve/s/^/#/" "${D}/etc/cyrus.conf" || die
+ fi
+
+ newinitd "${FILESDIR}/cyrus.rc6" cyrus
+ newconfd "${FILESDIR}/cyrus.confd" cyrus
+ newpamd "${FILESDIR}/cyrus.pam-include" sieve
+
+ for subdir in imap/{,db,log,msg,proc,socket,sieve} spool/imap/{,stage.} ; do
+ keepdir "/var/${subdir}"
+ fowners cyrus:mail "/var/${subdir}"
+ fperms 0750 "/var/${subdir}"
+ done
+ for subdir in imap/{user,quota,sieve} spool/imap ; do
+ for i in a b c d e f g h i j k l m n o p q r s t v u w x y z ; do
+ keepdir "/var/${subdir}/${i}"
+ fowners cyrus:mail "/var/${subdir}/${i}"
+ fperms 0750 "/var/${subdir}/${i}"
+ done
+ done
+}
+
+pkg_preinst() {
+ if ! has_version ${CATEGORY}/${PN} ; then
+ elog "For correct logging add the following to /etc/syslog.conf:"
+ elog " local6.* /var/log/imapd.log"
+ elog " auth.debug /var/log/auth.log"
+ echo
+
+ elog "You have to add user cyrus to the sasldb2. Do this with:"
+ elog " saslpasswd2 cyrus"
+ fi
+}
+
+pkg_postinst() {
+ # do not install server.{key,pem) if they exist.
+ if use ssl ; then
+ if [ ! -f "${ROOT}"etc/ssl/cyrus/server.key ]; then
+ install_cert /etc/ssl/cyrus/server
+ chown cyrus:mail "${ROOT}"etc/ssl/cyrus/server.{key,pem}
+ fi
+ fi
+}
diff --git a/net-mail/cyrus-imapd/cyrus-imapd-2.4.18.ebuild b/net-mail/cyrus-imapd/cyrus-imapd-2.4.18.ebuild
new file mode 100644
index 000000000000..007acd3eea34
--- /dev/null
+++ b/net-mail/cyrus-imapd/cyrus-imapd-2.4.18.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools db-use eutils multilib pam ssl-cert user toolchain-funcs
+
+MY_P=${P/_/}
+
+DESCRIPTION="The Cyrus IMAP Server"
+HOMEPAGE="http://www.cyrusimap.org/"
+SRC_URI="ftp://ftp.cyrusimap.org/cyrus-imapd/${MY_P}.tar.gz"
+
+LICENSE="BSD-with-attribution"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="afs berkdb kerberos mysql nntp pam postgres replication sieve snmp sqlite ssl tcpd"
+
+# virtual/mysql-5.5 added for the --variable= option below
+RDEPEND="sys-libs/zlib
+ >=dev-libs/cyrus-sasl-2.1.13
+ afs? ( net-fs/openafs )
+ berkdb? ( >=sys-libs/db-3.2:* )
+ kerberos? ( virtual/krb5 )
+ mysql? ( >=virtual/mysql-5.5 )
+ nntp? ( !net-nntp/leafnode )
+ pam? (
+ virtual/pam
+ >=net-mail/mailbase-1
+ )
+ postgres? ( dev-db/postgresql:* )
+ snmp? ( >=net-analyzer/net-snmp-5.2.2-r1 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? ( >=dev-libs/openssl-0.9.6:* )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 snmp? ( net-analyzer/net-snmp[tcpd=] ) )"
+
+DEPEND="$RDEPEND"
+
+# get rid of old style virtual - bug 350792
+# all blockers really needed?
+RDEPEND="${RDEPEND}
+ !mail-mta/courier
+ !net-mail/bincimap
+ !net-mail/courier-imap
+ !net-mail/uw-imap"
+
+REQUIRED_USE="afs? ( kerberos )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser cyrus -1 -1 /usr/cyrus mail
+}
+
+src_prepare() {
+ # Fix master(8)->cyrusmaster(8) manpage.
+ for i in `grep -rl -e 'master\.8' -e 'master(8)' "${S}"` ; do
+ sed -i -e 's:master\.8:cyrusmaster.8:g' \
+ -e 's:master(8):cyrusmaster(8):g' \
+ "${i}" || die "sed failed" || die "sed failed"
+ done
+ mv man/master.8 man/cyrusmaster.8 || die "mv failed"
+ sed -i -e "s:MASTER:CYRUSMASTER:g" \
+ -e "s:Master:Cyrusmaster:g" \
+ -e "s:master:cyrusmaster:g" \
+ man/cyrusmaster.8 || die "sed failed"
+
+ # do not strip
+ sed -i -e '/(INSTALL/s/-s //' "${S}"/imtest/Makefile.in
+
+ # correct afs include and liblwp.a directory
+ sed -i -e '/I${with_afs_incdir/s/\/include//' \
+ -e '/liblwp/s/liblwp/afs\/liblwp/' \
+ "${S}"/configure{,.in} || die
+ # same with lock.h
+ sed -i -e '/lock.h/s:lock.h:afs/lock.h:' \
+ ptclient/afskrb.c || die
+ # libcom_err.a to libafscom_err.a
+ sed -i -e '/afs\/libcom_err.a/s:libcom_err.a:libafscom_err.a:' \
+ configure{,.in} || die
+
+ sed -i -e "s/ar cr/$(tc-getAR) cr/" \
+ perl/sieve/lib/Makefile.in \
+ imap/Makefile.in \
+ lib/Makefile.in \
+ installsieve/Makefile.in \
+ com_err/et/Makefile.in \
+ sieve/Makefile.in \
+ syslog/Makefile.in || die
+
+ AT_M4DIR="cmulocal" eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use mysql ; then
+ myconf="--with-mysql-incdir=$(mysql_config --variable=pkgincludedir)"
+ myconf+=" --with-mysql-libdir=$(mysql_config --variable=pkglibdir)"
+ fi
+ if use afs ; then
+ myconf+=" --with-afs-libdir=/usr/$(get_libdir)"
+ myconf+=" --with-afs-incdir=/usr/include/afs"
+ fi
+ if use berkdb ; then
+ myconf+=" --with-bdb-incdir=$(db_includedir)"
+ fi
+ econf \
+ --enable-murder \
+ --enable-netscapehack \
+ --enable-idled \
+ --with-service-path=/usr/$(get_libdir)/cyrus \
+ --with-cyrus-user=cyrus \
+ --with-cyrus-group=mail \
+ --with-com_err=yes \
+ --with-sasl \
+ --without-perl \
+ --without-krb \
+ --without-krbdes \
+ --with-zlib \
+ $(use_enable afs) \
+ $(use_enable afs krb5afspts) \
+ $(use_with berkdb bdb) \
+ $(use_enable nntp) \
+ $(use_enable replication) \
+ $(use_enable kerberos gssapi) \
+ $(use_with mysql) \
+ $(use_with postgres pgsql) \
+ $(use_with sqlite) \
+ $(use_with ssl openssl) \
+ $(use_enable sieve) \
+ $(use_with snmp) \
+ $(use_with tcpd libwrap) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # file collision - bug #368245
+ if ! use nntp ; then
+ rm "${D}"/usr/share/man/man8/fetchnews.8*
+ fi
+
+ dodoc README*
+ dohtml doc/*.html doc/murder.png
+ docinto text
+ dodoc doc/text/*
+ cp doc/cyrusv2.mc "${D}/usr/share/doc/${PF}/html"
+ cp -r contrib tools "${D}/usr/share/doc/${PF}"
+ rm -f doc/text/Makefile*
+
+ insinto /etc
+ doins "${FILESDIR}/cyrus.conf" "${FILESDIR}/imapd.conf"
+
+ # turn off sieve if not installed
+ if ! use sieve; then
+ sed -i -e "/sieve/s/^/#/" "${D}/etc/cyrus.conf" || die
+ fi
+
+ newinitd "${FILESDIR}/cyrus.rc6" cyrus
+ newconfd "${FILESDIR}/cyrus.confd" cyrus
+ newpamd "${FILESDIR}/cyrus.pam-include" sieve
+
+ for subdir in imap/{,db,log,msg,proc,socket,sieve} spool/imap/{,stage.} ; do
+ keepdir "/var/${subdir}"
+ fowners cyrus:mail "/var/${subdir}"
+ fperms 0750 "/var/${subdir}"
+ done
+ for subdir in imap/{user,quota,sieve} spool/imap ; do
+ for i in a b c d e f g h i j k l m n o p q r s t v u w x y z ; do
+ keepdir "/var/${subdir}/${i}"
+ fowners cyrus:mail "/var/${subdir}/${i}"
+ fperms 0750 "/var/${subdir}/${i}"
+ done
+ done
+}
+
+pkg_preinst() {
+ if ! has_version ${CATEGORY}/${PN} ; then
+ elog "For correct logging add the following to /etc/syslog.conf:"
+ elog " local6.* /var/log/imapd.log"
+ elog " auth.debug /var/log/auth.log"
+ echo
+
+ elog "You have to add user cyrus to the sasldb2. Do this with:"
+ elog " saslpasswd2 cyrus"
+ fi
+}
+
+pkg_postinst() {
+ # do not install server.{key,pem) if they exist.
+ if use ssl ; then
+ if [ ! -f "${ROOT}"etc/ssl/cyrus/server.key ]; then
+ install_cert /etc/ssl/cyrus/server
+ chown cyrus:mail "${ROOT}"etc/ssl/cyrus/server.{key,pem}
+ fi
+ fi
+}
diff --git a/net-mail/cyrus-imapd/cyrus-imapd-2.5.4.ebuild b/net-mail/cyrus-imapd/cyrus-imapd-2.5.4.ebuild
new file mode 100644
index 000000000000..ed147aab046c
--- /dev/null
+++ b/net-mail/cyrus-imapd/cyrus-imapd-2.5.4.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils multilib pam ssl-cert user toolchain-funcs
+
+MY_P=${P/_/}
+
+DESCRIPTION="The Cyrus IMAP Server"
+HOMEPAGE="http://www.cyrusimap.org/"
+SRC_URI="ftp://ftp.cyrusimap.org/cyrus-imapd/${MY_P}.tar.gz"
+
+LICENSE="BSD-with-attribution"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="afs berkdb clamav http kerberos mysql nntp pam perl postgres \
+ replication +server sieve snmp sqlite ssl static-libs tcpd"
+
+# virtual/mysql-5.5 added for the --variable= option below
+DEPEND="sys-libs/zlib
+ dev-libs/libpcre
+ >=dev-libs/cyrus-sasl-2.1.13
+ dev-libs/jansson
+ afs? ( net-fs/openafs )
+ berkdb? ( >=sys-libs/db-3.2:* )
+ clamav? ( app-antivirus/clamav )
+ http? ( dev-libs/libxml2 dev-libs/libical )
+ kerberos? ( virtual/krb5 )
+ mysql? ( >=virtual/mysql-5.5 )
+ nntp? ( !net-nntp/leafnode )
+ pam? (
+ virtual/pam
+ >=net-mail/mailbase-1
+ )
+ postgres? ( dev-db/postgresql:* )
+ snmp? ( >=net-analyzer/net-snmp-5.2.2-r1 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? ( >=dev-libs/openssl-1.0.1e:* )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 snmp? ( net-analyzer/net-snmp[tcpd=] ) )"
+
+# all blockers really needed?
+RDEPEND="${DEPEND}
+ !mail-mta/courier
+ !net-mail/bincimap
+ !net-mail/courier-imap
+ !net-mail/uw-imap"
+
+REQUIRED_USE="afs? ( kerberos )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser cyrus -1 -1 /usr/cyrus mail
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-db.patch"
+ # Fix master(8)->cyrusmaster(8) manpage.
+ for i in `grep -rl -e 'master\.8' -e 'master(8)' "${S}"` ; do
+ sed -i -e 's:master\.8:cyrusmaster.8:g' \
+ -e 's:master(8):cyrusmaster(8):g' \
+ "${i}" || die "sed failed" || die "sed failed"
+ done
+ mv man/master.8 man/cyrusmaster.8 || die "mv failed"
+ sed -i -e "s:MASTER:CYRUSMASTER:g" \
+ -e "s:Master:Cyrusmaster:g" \
+ -e "s:master:cyrusmaster:g" \
+ man/cyrusmaster.8 || die "sed failed"
+
+ # lock.h to afs/lock.h
+ sed -i -e '/lock.h/s:lock.h:afs/lock.h:' \
+ ptclient/afskrb.c || die
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use afs ; then
+ myconf+=" --with-afs-libdir=/usr/$(get_libdir)"
+ myconf+=" --with-afs-incdir=/usr/include/afs"
+ fi
+ econf \
+ --enable-murder \
+ --enable-netscapehack \
+ --enable-idled \
+ --enable-event-notification \
+ --enable-autocreate \
+ --enable-pcre \
+ --with-service-path=/usr/$(get_libdir)/cyrus \
+ --with-cyrus-user=cyrus \
+ --with-cyrus-group=mail \
+ --with-com_err=yes \
+ --with-sasl \
+ --without-krb \
+ --without-krbdes \
+ --with-zlib \
+ $(use_enable afs) \
+ $(use_enable afs krb5afspts) \
+ $(use_with berkdb bdb) \
+ $(use_with clamav) \
+ $(use_enable nntp) \
+ $(use_enable replication) \
+ $(use_enable kerberos gssapi) \
+ $(use_with mysql) \
+ $(use_with postgres pgsql) \
+ $(use_with perl) \
+ $(use_with sqlite) \
+ $(use_with ssl openssl) \
+ $(use_enable server) \
+ $(use_enable sieve) \
+ $(use_with snmp) \
+ $(use_enable static-libs static) \
+ $(use_with tcpd libwrap) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALLDIRS=vendor install
+
+ dodoc README*
+ dohtml doc/*.html
+ docinto text
+ dodoc doc/text/*
+ cp doc/cyrusv2.mc "${D}/usr/share/doc/${PF}/html"
+ cp -r contrib tools "${D}/usr/share/doc/${PF}"
+ rm -f doc/text/Makefile*
+
+ insinto /etc
+ doins "${FILESDIR}/cyrus.conf" "${FILESDIR}/imapd.conf"
+
+ # turn off sieve if not installed
+ if ! use sieve; then
+ sed -i -e "/sieve/s/^/#/" "${D}/etc/cyrus.conf" || die
+ fi
+
+ newinitd "${FILESDIR}/cyrus.rc6" cyrus
+ newconfd "${FILESDIR}/cyrus.confd" cyrus
+ newpamd "${FILESDIR}/cyrus.pam-include" sieve
+
+ for subdir in imap/{,db,log,msg,proc,socket,sieve} spool/imap/{,stage.} ; do
+ keepdir "/var/${subdir}"
+ fowners cyrus:mail "/var/${subdir}"
+ fperms 0750 "/var/${subdir}"
+ done
+ for subdir in imap/{user,quota,sieve} spool/imap ; do
+ for i in a b c d e f g h i j k l m n o p q r s t v u w x y z ; do
+ keepdir "/var/${subdir}/${i}"
+ fowners cyrus:mail "/var/${subdir}/${i}"
+ fperms 0750 "/var/${subdir}/${i}"
+ done
+ done
+}
+
+pkg_preinst() {
+ if ! has_version ${CATEGORY}/${PN} ; then
+ elog "For correct logging add the following to /etc/syslog.conf:"
+ elog " local6.* /var/log/imapd.log"
+ elog " auth.debug /var/log/auth.log"
+ echo
+
+ elog "You have to add user cyrus to the sasldb2. Do this with:"
+ elog " saslpasswd2 cyrus"
+ fi
+}
+
+pkg_postinst() {
+ # do not install server.{key,pem) if they exist.
+ if use ssl ; then
+ if [ ! -f "${ROOT}"etc/ssl/cyrus/server.key ]; then
+ install_cert /etc/ssl/cyrus/server
+ chown cyrus:mail "${ROOT}"etc/ssl/cyrus/server.{key,pem}
+ fi
+ fi
+}
diff --git a/net-mail/cyrus-imapd/files/cyrus-imapd-2.4.17-statuscache.diff b/net-mail/cyrus-imapd/files/cyrus-imapd-2.4.17-statuscache.diff
new file mode 100644
index 000000000000..b939479e4a78
--- /dev/null
+++ b/net-mail/cyrus-imapd/files/cyrus-imapd-2.4.17-statuscache.diff
@@ -0,0 +1,11 @@
+--- imap/statuscache_db.c.orig 2012-12-01 20:57:54.000000000 +0100
++++ imap/statuscache_db.c 2013-10-18 17:09:42.110915989 +0200
+@@ -152,7 +152,7 @@
+ len = strlcpy(key, mailboxname, sizeof(key));
+ key[len++] = '%';
+ key[len++] = '%';
+- len += strlcpy(key + len, userid, sizeof(key) - len);
++ if (userid) len += strlcpy(key + len, userid, sizeof(key) - len);
+
+ *keylen = len;
+
diff --git a/net-mail/cyrus-imapd/files/cyrus-imapd-db.patch b/net-mail/cyrus-imapd/files/cyrus-imapd-db.patch
new file mode 100644
index 000000000000..f720cf2cb127
--- /dev/null
+++ b/net-mail/cyrus-imapd/files/cyrus-imapd-db.patch
@@ -0,0 +1,81 @@
+--- configure.ac 2015-07-06 01:22:19.000000000 +0000
++++ configure.ac 2015-07-22 11:18:33.000000000 +0000
+@@ -236,50 +236,29 @@
+ dnl Berkeley DB Detection
+
+ AC_ARG_WITH(bdb,
+- [AS_HELP_STRING([--with-bdb=DIR], [use Berkeley DB (in DIR) [yes]])],
+- with_bdb=$withval, with_bdb="yes")
+-
+-dnl support old-style
+-AC_ARG_WITH(dbdir,, with_bdb=$withval)
++ [AS_HELP_STRING([--with-bdb], [use Berkeley DB [yes]])],
++ [],
++ [with_bdb="yes"])
+
++# On a properly installed system, we build
++# by including <db.h> and by linking with -ldb
+ case "$with_bdb" in
+- no)
+- use_berkeley="no"
+- ;;
+- yes)
+- use_berkeley="yes"
+- with_bdb_lib=none
+- with_bdb_inc=none
+- ;;
+- *)
+- use_berkeley="yes"
+- with_bdb_lib="$with_bdb/lib"
+- with_bdb_inc="$with_bdb/include"
++ no) ;;
++ *) AC_CHECK_FILE([/usr/include/db.h],
++ [],
++ AC_CHECK_FILE([/usr/include/db/db.h]),
++ [BDB_INC="-I/usr/include/db"],
++ AC_MSG_ERROR([No <db.h> include file is found. Install the
++ appropriate db*-devel package first.]))
++ BDB_LIB="-ldb"
++ AC_SUBST(BDB_INC)
++ AC_SUBST(BDB_LIB)
++ LIBS="${LIBS} ${BDB_LIB}"
++ CPPFLAGS="${CPPFLAGS} ${BDB_INC}"
++ AC_DEFINE(HAVE_BDB,[],[Build in Berkeley DB support?])
+ ;;
+ esac
+-
+-if test "$use_berkeley" != "no"; then
+- CYRUS_BERKELEY_DB_CHK()
+-
+- if test "$dblib" = "no"; then
+- AC_MSG_ERROR([Berkeley DB 3.x or later was not found. You may need to
+- supply the --with-bdb-libdir or --with-bdb-incdir configure options.])
+- fi
+-
+- if test "$with_bdb_lib" != "none"; then
+- CMU_ADD_LIBPATH($with_bdb_lib)
+- fi
+-
+- BDB_INC=${BDB_INCADD}
+- BDB_LIB=${BDB_LIBADD}
+- AC_SUBST(BDB_INC)
+- AC_SUBST(BDB_LIB)
+-
+- LIBS="${LIBS} ${BDB_LIBADD}"
+- CPPFLAGS="${BDB_INCADD} ${CPPFLAGS}"
+- AC_DEFINE(HAVE_BDB,[],[Build in Berkeley DB support?])
+-fi
+-AM_CONDITIONAL([USE_BERKELEY], [test "$use_berkeley" != "no"])
++AM_CONDITIONAL([USE_BERKELEY], [test "$with_bdb" != "no"])
+
+ dnl End Berkeley DB Detection
+
+@@ -1800,7 +1779,7 @@
+ pcre: $cyrus_cv_pcre_utf8
+
+ Database support:
+- bdb: $use_berkeley
++ bdb: $with_bdb
+ mysql: $with_mysql
+ postgresql: $use_pgsql
+ sqlite: $use_sqlite
diff --git a/net-mail/cyrus-imapd/files/cyrus.conf b/net-mail/cyrus-imapd/files/cyrus.conf
new file mode 100644
index 000000000000..18bbd51d4c09
--- /dev/null
+++ b/net-mail/cyrus-imapd/files/cyrus.conf
@@ -0,0 +1,43 @@
+# $Id$
+
+# Standard standalone server configuration.
+
+START {
+ # Do not delete this entry!
+ recover cmd="ctl_cyrusdb -r"
+
+ # This is only necessary if using idled for IMAP IDLE.
+ #idled cmd="idled"
+}
+
+# UNIX sockets start with a slash and are put into /var/imap/socket.
+SERVICES {
+ # Add or remove based on preferences.
+ imap cmd="imapd" listen="imap2" prefork=0
+ pop3 cmd="pop3d" listen="pop-3" prefork=0
+
+ # Don't forget to generate the needed keys for SSL or TLS
+ # (see doc/html/install-configure.html).
+ #imaps cmd="imapd -s" listen="imaps" prefork=0
+ #pop3s cmd="pop3d -s" listen="pop3s" prefork=0
+
+ sieve cmd="timsieved" listen="sieve" prefork=0
+
+ # at least one LMTP is required for delivery
+ #lmtp cmd="lmtpd" listen="lmtp" prefork=0
+ lmtpunix cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=0
+
+ # this is only necessary if using notifications
+ #notify cmd="notifyd" listen="/var/imap/socket/notify" proto="udp" prefork=1
+}
+
+EVENTS {
+ # This is required.
+ checkpoint cmd="ctl_cyrusdb -c" period=30
+
+ # This is only necessary if using duplicate delivery suppression.
+ delprune cmd="ctl_deliver -E 3" period=1440
+
+ # This is only necessary if caching TLS sessions.
+ tlsprune cmd="tls_prune" period=1440
+}
diff --git a/net-mail/cyrus-imapd/files/cyrus.confd b/net-mail/cyrus-imapd/files/cyrus.confd
new file mode 100644
index 000000000000..ed7ffe93209d
--- /dev/null
+++ b/net-mail/cyrus-imapd/files/cyrus.confd
@@ -0,0 +1,6 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Additional options for the cyrus master
+CYRUS_OPTS=""
diff --git a/net-mail/cyrus-imapd/files/cyrus.pam-include b/net-mail/cyrus-imapd/files/cyrus.pam-include
new file mode 100644
index 000000000000..6e47645bd7d6
--- /dev/null
+++ b/net-mail/cyrus-imapd/files/cyrus.pam-include
@@ -0,0 +1,6 @@
+#%PAM-1.0
+
+auth required pam_nologin.so
+auth include system-auth
+
+account include system-auth
diff --git a/net-mail/cyrus-imapd/files/cyrus.rc6 b/net-mail/cyrus-imapd/files/cyrus.rc6
new file mode 100644
index 000000000000..89a3b9fc7bbf
--- /dev/null
+++ b/net-mail/cyrus-imapd/files/cyrus.rc6
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use net
+ use dns logger
+ after drac saslauthd
+}
+
+start() {
+ ebegin "Starting cyrus imapd"
+ start-stop-daemon --start --quiet --background \
+ --exec /usr/lib/cyrus/master -- ${CYRUS_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping cyrus imapd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/cyrus-master.pid
+ eend $?
+}
diff --git a/net-mail/cyrus-imapd/files/imapd.conf b/net-mail/cyrus-imapd/files/imapd.conf
new file mode 100644
index 000000000000..c7595a116cd4
--- /dev/null
+++ b/net-mail/cyrus-imapd/files/imapd.conf
@@ -0,0 +1,52 @@
+# $Id$
+
+# Don't forget to use chattr +S (if you are using ext[23])
+# when you change these directories (read the docs).
+configdirectory: /var/imap
+partition-default: /var/spool/imap
+sievedir: /var/imap/sieve
+
+tls_ca_path: /etc/ssl/certs
+tls_cert_file: /etc/ssl/cyrus/server.crt
+tls_key_file: /etc/ssl/cyrus/server.key
+
+# Don't use an everyday user as admin.
+admins: cyrus
+
+hashimapspool: yes
+allowanonymouslogin: no
+allowplaintext: no
+
+# Allow renaming of top-level mailboxes.
+#allowusermoves: yes
+
+# Use this if sieve-scripts could be in ~user/.sieve.
+#sieveusehomedir: yes
+
+# Use saslauthd if you want to use pam for imap.
+# But be warned: login with DIGEST-MD5 or CRAM-MD5
+# is not possible using pam.
+#sasl_pwcheck_method: saslauthd
+
+####################################################
+## This is a recommended authentication method if you
+## emerge cyrus-sasl with 'postgres' or 'mysql'
+## To use with mysql database uncomment those lines below.
+
+#sasl_pwcheck_method: auxprop
+#sasl_auxprop_plugin: sql
+
+## possible values for sasl_auxprop_plugin 'mysql', 'pgsql', 'sqlite'.
+#sasl_sql_engine: mysql
+
+## all possible values.
+#sasl_mech_list: LOGIN PLAIN CRAM-MD5 DIGEST-MD5 NTLM
+## or limit to CRAM-MD5 only
+#sasl_mech_list: CRAM-MD5
+
+## change below to suit your setup.
+sasl_sql_user: mailsqluser
+sasl_sql_passwd: password
+sasl_sql_database: mailsqldb
+sasl_sql_hostnames: localhost
+sasl_sql_select: SELECT clear FROM users WHERE email = '%u@%r'
diff --git a/net-mail/cyrus-imapd/metadata.xml b/net-mail/cyrus-imapd/metadata.xml
new file mode 100644
index 000000000000..120284d1cc4f
--- /dev/null
+++ b/net-mail/cyrus-imapd/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <use>
+ <flag name="replication">Enable replication support in the cyrus imap server</flag>
+ <flag name="sieve">Enable sieve support</flag>
+ <flag name="http">Enable http support</flag>
+ <flag name="server">Enable building server binaries</flag>
+ </use>
+</pkgmetadata>