Added patched dovecot package.

This commit is contained in:
László Valkó 2018-07-13 21:10:09 +02:00
parent 95d4ae7134
commit 956a925ae9
6 changed files with 433 additions and 0 deletions

View file

@ -0,0 +1,7 @@
AUX dovecot-10-ssl.patch 550 BLAKE2B 5317b802113e6dd711056684bb2de8167113c95ea28ea805fd3a1f688878505d02d85bd9ab69fc222cb2debdc1b5186f48f3c2cbea2f1df24714482939284f46 SHA512 7acc31dd4a3f51a9c13d590fd2803c2cb98c281e0595ca2a800539a143f89b95f923a3678beb0aa2b254a54385522329e0f3e1e8ba4c5852e7b51f8f111122a9
AUX dovecot-2.2.34-glibc226.patch 1097 BLAKE2B aaa965712a9fbca80bca3950ce52a31a9127ddbb72dbf86378455faa5ba8aa58918ab8dd14be14fd50c7c741a2a948961e32f6a1dd33764d2c1acb286fe4dc3f SHA512 fad9548c69f6bef174c3fce920a520363e283a832af15bc3a379cd1e4c4a6516eb40383eb11ab875ef14ba11f88b7dbd394541af784fdcef67df1a9e0ae53b6f
AUX dovecot.init-r4 1499 BLAKE2B 9c05fd7da0409b0944b0204bdcd683ab889190effc8cb7b072dcab140f52e2f39336a344deb74b63ef184152604412ca4c2b3d79c3d63341386e7952c54b0a26 SHA512 8fbc80bc0efa6b83685da19b6a5c2a2d2ca7e59be7f1f7352984fe30004175330e53f3db1c4c2471f1d7d5e088bef0b4dced97d29d32be8b50d000987b6eeb09
DIST dovecot-2.2-pigeonhole-0.4.21.tar.gz 1774887 BLAKE2B ebf2601e7b087d655713f985b72442496e36543ec32881d3bc84d2c6b132f58082aee6c5fae3747f756b72a3c9a2e11f78350bc34c398214de13dfc83cffdef1 SHA512 4751f449ede1b05173c706b414ebf9f7f670ff78589ce6f0b687c32c9abe6dae8b3064ed1b20e893d9ec0147b0139ce479e1d74ebe94747c33f2d8ca177912de
DIST dovecot-2.2.34.tar.gz 6181270 BLAKE2B dfdb1e6812574e79595202e830167400569adf61155aa5ddaae443e798c4a05ccec2acd2975e00e9e7ffc63ee1dcf7e4e2a9288b1e6e1e1427d1e89790a8fa13 SHA512 9f08a7116a08a08495aa0e7b4cb6b11a924ea61006970487946e338bc79bba7fd7619c345cbf278a74de285d548af04fc66eaaee508185b8b9d7335cf5612055
EBUILD dovecot-2.2.34-r1.ebuild 8727 BLAKE2B fc9957dfb9711ec36de6a32465f25713fd64b1f24ed3537cc57b7d7bdf847bdeac2323af3c3bbfcac1f3e064136dd3cee8139066d8b83f1675375e63999bc408 SHA512 f916a161ab3f46f5fd0916899c4e89afc94bdc93fd74dab28b2d6eb7edd30fa7986b630e8e79e1d5b7bb78fdb370e1e6bb6f938820189af56c75f6ba0f945f28
MISC metadata.xml 1374 BLAKE2B 629969318c5bcbdf0521d2293c6ead5e735ba5a113db3166e4df82103a3a84cbc62f3a2843082c9d5bdb635f25353ac7d3a4fcdf80d45e07b11b98754e744506 SHA512 16bdf15120dd8c957cd6e4957910acf21440dd0b8774cac9d9c5a48635cd46c7093850974b592ebbcd49085607fff2051691a42112f4ab9df44c51b9fea6d180

View file

@ -0,0 +1,293 @@
# 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="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 +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() {
default
eapply -p0 "${FILESDIR}/${PN}-10-ssl.patch"
eapply -p0 "${FILESDIR}/${PN}-${PV}-glibc226.patch"
eapply_user
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 \
--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."
}

View file

@ -0,0 +1,15 @@
--- doc/example-config/conf.d/10-ssl.conf 2014-12-08 07:58:21.000000000 +0000
+++ doc/example-config/conf.d/10-ssl.conf 2014-12-08 08:02:19.000000000 +0000
@@ -49,6 +49,12 @@
#ssl_protocols = !SSLv2
# SSL ciphers to use
+# ###############
+# Added by Gentoo
+# You are encouraged to change the cipher list to
+#ssl_cipher_list = DEFAULT:!EXPORT:!LOW:!MEDIUM:!MD5
+# if you are not required to support legacy mail clients.
+# ###############
#ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL
# Prefer the server's order of ciphers over client's.

View file

@ -0,0 +1,33 @@
--- a/configure.ac 2018-02-28 15:45:34.000000000 +0100
+++ b/configure.ac 2018-07-13 20:48:53.678923351 +0200
@@ -2836,8 +2836,17 @@
have_rquota=no
if test -f /usr/include/rpcsvc/rquota.x && test -n "$RPCGEN"; then
+ PKG_CHECK_MODULES(LIBTIRPC, libtirpc, [
+ have_rquota=yes
+ QUOTA_LIBS="$QUOTA_LIBS \$(LIBTIRPC_LIBS)"
+ ], [
+ AC_CHECK_HEADER([rpc/rpc.h], [
+ have_rquota=yes
+ ])
+ ])
+fi
+if test "$have_rquota" = yes; then
AC_DEFINE(HAVE_RQUOTA,, [Define if you wish to retrieve quota of NFS mounted mailboxes])
- have_rquota=yes
fi
AM_CONDITIONAL(HAVE_RQUOTA, test "$have_rquota" = "yes")
--- a/src/plugins/quota/Makefile.am 2018-02-28 15:45:34.000000000 +0100
+++ b/src/plugins/quota/Makefile.am 2018-07-13 20:50:16.056369313 +0200
@@ -17,7 +17,8 @@
-I$(top_srcdir)/src/lib-storage/index \
-I$(top_srcdir)/src/lib-storage/index/imapc \
-I$(top_srcdir)/src/lib-storage/index/maildir \
- -I$(top_srcdir)/src/doveadm
+ -I$(top_srcdir)/src/doveadm \
+ $(LIBTIRPC_CFLAGS)
NOPLUGIN_LDFLAGS =
lib10_doveadm_quota_plugin_la_LDFLAGS = -module -avoid-version

View file

@ -0,0 +1,57 @@
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# 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} -a | grep '^base_dir = ' | sed 's/^base_dir = //')
else
eerror "dovecot not executable"
return 1
fi
DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/var/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 $?
}

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>eras@gentoo.org</email>
<name>Eray Aslan</name>
</maintainer>
<maintainer type="project">
<email>net-mail@gentoo.org</email>
<name>Net-Mail</name>
</maintainer>
<use>
<flag name="argon2">Add support for ARGON2 password schemes</flag>
<flag name="cydir">Add cydir storage support</flag>
<flag name="managesieve">Add managesieve protocol support</flag>
<flag name="mdbox">Add mdbox storage support</flag>
<flag name="sdbox">Add sdbox storage support</flag>
<flag name="sieve">Add sieve support</flag>
<flag name="vpopmail">Add vpopmail support</flag>
<flag name="imapc">Add imap client storage support</flag>
<flag name="pop3c">Add pop3 client storage support</flag>
<flag name="lucene">Add lucene full text search (FTS) support using <pkg>dev-cpp/clucene</pkg></flag>
<flag name="lzma">Add support for lzma (de)compression</flag>
<flag name="lz4">Add support for lz4 (de)compression</flag>
<flag name="solr">Add solr full text search (FTS) support</flag>
<flag name="textcat">Add libtextcat language guessing support for full text search (FTS)</flag>
</use>
</pkgmetadata>