summaryrefslogtreecommitdiff
path: root/mail-mta
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /mail-mta
reinit the tree, so we can have metadata
Diffstat (limited to 'mail-mta')
-rw-r--r--mail-mta/courier/Manifest12
-rw-r--r--mail-mta/courier/courier-0.75.0-r1.ebuild312
-rw-r--r--mail-mta/courier/courier-0.75.0.ebuild310
-rw-r--r--mail-mta/courier/courier-0.76.4.ebuild308
-rw-r--r--mail-mta/courier/files/apache-sqwebmail.inc14
-rw-r--r--mail-mta/courier/files/courier-init-r4189
-rw-r--r--mail-mta/courier/files/norewrite.patch21
-rw-r--r--mail-mta/courier/files/password.dist6
-rw-r--r--mail-mta/courier/metadata.xml25
-rw-r--r--mail-mta/esmtp/Manifest6
-rw-r--r--mail-mta/esmtp/esmtp-1.2-r1.ebuild44
-rw-r--r--mail-mta/esmtp/esmtp-1.2.ebuild37
-rw-r--r--mail-mta/esmtp/metadata.xml11
-rw-r--r--mail-mta/exim/Manifest29
-rw-r--r--mail-mta/exim/exim-4.89-r1.ebuild528
-rw-r--r--mail-mta/exim/exim-4.89-r3.ebuild530
-rw-r--r--mail-mta/exim/files/auth_conf.sub25
-rw-r--r--mail-mta/exim/files/exim-4.14-tail.patch11
-rw-r--r--mail-mta/exim/files/exim-4.20-maildir.patch14
-rw-r--r--mail-mta/exim/files/exim-4.69-r1.27021.patch48
-rw-r--r--mail-mta/exim/files/exim-4.74-localscan_dlopen.patch262
-rw-r--r--mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch22
-rw-r--r--mail-mta/exim/files/exim-4.76-crosscompile.patch15
-rw-r--r--mail-mta/exim/files/exim-4.80-spool-mail-group.patch27
-rw-r--r--mail-mta/exim/files/exim-4.82-makefile-freebsd.patch45
-rw-r--r--mail-mta/exim/files/exim-4.89-CVE-2017-1000369.patch58
-rw-r--r--mail-mta/exim/files/exim-4.89-address-expando-crash.patch85
-rw-r--r--mail-mta/exim/files/exim-4.89-as-needed-ldflags.patch145
-rw-r--r--mail-mta/exim/files/exim-4.89-transport-crash.patch62
-rw-r--r--mail-mta/exim/files/exim-submission.socket10
-rw-r--r--mail-mta/exim/files/exim-submission_at.service11
-rw-r--r--mail-mta/exim/files/exim.confd5
-rw-r--r--mail-mta/exim/files/exim.logrotate9
-rw-r--r--mail-mta/exim/files/exim.rc1047
-rw-r--r--mail-mta/exim/files/exim.service12
-rw-r--r--mail-mta/exim/files/exim.socket10
-rw-r--r--mail-mta/exim/files/exim_at.service7
-rw-r--r--mail-mta/exim/metadata.xml54
-rw-r--r--mail-mta/metadata.xml38
-rw-r--r--mail-mta/mini-qmail/Manifest14
-rw-r--r--mail-mta/mini-qmail/files/1.05-config-mini-help.patch16
-rw-r--r--mail-mta/mini-qmail/files/1.06-headers.patch37
-rw-r--r--mail-mta/mini-qmail/files/99qmail3
-rw-r--r--mail-mta/mini-qmail/files/config-mini38
-rw-r--r--mail-mta/mini-qmail/metadata.xml11
-rw-r--r--mail-mta/mini-qmail/mini-qmail-1.05-r1.ebuild97
-rw-r--r--mail-mta/mini-qmail/mini-qmail-1.05.ebuild105
-rw-r--r--mail-mta/mini-qmail/mini-qmail-1.06.ebuild69
-rw-r--r--mail-mta/msmtp/Manifest5
-rw-r--r--mail-mta/msmtp/metadata.xml15
-rw-r--r--mail-mta/msmtp/msmtp-1.6.6.ebuild134
-rw-r--r--mail-mta/netqmail/Manifest23
-rw-r--r--mail-mta/netqmail/files/1.06-exit.patch18
-rw-r--r--mail-mta/netqmail/files/1.06-fbsd-utmpx.patch64
-rw-r--r--mail-mta/netqmail/files/1.06-readwrite.patch13
-rw-r--r--mail-mta/netqmail/files/genqmail-20080406-ldflags.patch13
-rw-r--r--mail-mta/netqmail/files/qmail-smtputf8.patch242
-rw-r--r--mail-mta/netqmail/files/use-new-path-for-functions.sh.patch11
-rw-r--r--mail-mta/netqmail/metadata.xml17
-rw-r--r--mail-mta/netqmail/netqmail-1.06-r1.ebuild161
-rw-r--r--mail-mta/netqmail/netqmail-1.06-r2.ebuild169
-rw-r--r--mail-mta/netqmail/netqmail-1.06-r3.ebuild172
-rw-r--r--mail-mta/netqmail/netqmail-1.06-r4.ebuild177
-rw-r--r--mail-mta/netqmail/netqmail-1.06-r5.ebuild182
-rw-r--r--mail-mta/netqmail/netqmail-1.06.ebuild148
-rw-r--r--mail-mta/nullmailer/Manifest17
-rw-r--r--mail-mta/nullmailer/files/init.d-nullmailer-r450
-rw-r--r--mail-mta/nullmailer/files/init.d-nullmailer-r551
-rw-r--r--mail-mta/nullmailer/files/init.d-nullmailer-r651
-rw-r--r--mail-mta/nullmailer/files/nullmailer-1.13-unistd.h.patch28
-rw-r--r--mail-mta/nullmailer/files/nullmailer.service17
-rw-r--r--mail-mta/nullmailer/files/remotes.sample-1.1329
-rw-r--r--mail-mta/nullmailer/files/remotes.sample-2.030
-rw-r--r--mail-mta/nullmailer/metadata.xml15
-rw-r--r--mail-mta/nullmailer/nullmailer-1.13-r5.ebuild167
-rw-r--r--mail-mta/nullmailer/nullmailer-2.0-r1.ebuild137
-rw-r--r--mail-mta/nullmailer/nullmailer-2.0-r2.ebuild138
-rw-r--r--mail-mta/nullmailer/nullmailer-2.0.ebuild137
-rw-r--r--mail-mta/opensmtpd/Manifest14
-rw-r--r--mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-autoconf.patch46
-rw-r--r--mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-libressl.patch101
-rw-r--r--mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-musl.patch51
-rw-r--r--mail-mta/opensmtpd/files/smtpd.initd11
-rw-r--r--mail-mta/opensmtpd/files/smtpd.pam4
-rw-r--r--mail-mta/opensmtpd/files/smtpd.service10
-rw-r--r--mail-mta/opensmtpd/files/smtpd.socket8
-rw-r--r--mail-mta/opensmtpd/metadata.xml14
-rw-r--r--mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r1.ebuild94
-rw-r--r--mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r2.ebuild98
-rw-r--r--mail-mta/opensmtpd/opensmtpd-6.0.2_p1.ebuild93
-rw-r--r--mail-mta/postfix/Manifest24
-rw-r--r--mail-mta/postfix/files/postfix-2.11.1-db6.patch12
-rw-r--r--mail-mta/postfix/files/postfix-libressl-runtime.patch102
-rw-r--r--mail-mta/postfix/files/postfix-libressl.patch17
-rw-r--r--mail-mta/postfix/files/postfix.rc6.2.785
-rw-r--r--mail-mta/postfix/files/postfix.service26
-rw-r--r--mail-mta/postfix/files/smtp.pass2
-rw-r--r--mail-mta/postfix/files/smtp.sasl2
-rw-r--r--mail-mta/postfix/metadata.xml24
-rw-r--r--mail-mta/postfix/postfix-2.10.9.ebuild298
-rw-r--r--mail-mta/postfix/postfix-3.1.2-r2.ebuild308
-rw-r--r--mail-mta/postfix/postfix-3.1.6.ebuild308
-rw-r--r--mail-mta/postfix/postfix-3.2.2.ebuild308
-rw-r--r--mail-mta/postfix/postfix-3.2.3.ebuild308
-rw-r--r--mail-mta/postfix/postfix-3.3_pre20170924.ebuild310
-rw-r--r--mail-mta/qmail-ldap/Manifest13
-rw-r--r--mail-mta/qmail-ldap/files/1.03-warnings.patch55
-rw-r--r--mail-mta/qmail-ldap/files/samples.ldif32
-rw-r--r--mail-mta/qmail-ldap/metadata.xml22
-rw-r--r--mail-mta/qmail-ldap/qmail-ldap-1.03-r8.ebuild225
-rw-r--r--mail-mta/qpsmtpd/Manifest17
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd-0.40-badrcptto_allowrelay.patch10
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch44
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd-0.83-clamd_conf.patch12
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd-0.84-Net-DNS-id.patch28
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd.confd25
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd.envd2
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd.initd62
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd.initd-r162
-rw-r--r--mail-mta/qpsmtpd/files/qpsmtpd.xinetd20
-rw-r--r--mail-mta/qpsmtpd/metadata.xml14
-rw-r--r--mail-mta/qpsmtpd/qpsmtpd-0.84-r2.ebuild80
-rw-r--r--mail-mta/qpsmtpd/qpsmtpd-0.95.ebuild91
-rw-r--r--mail-mta/qpsmtpd/qpsmtpd-9999.ebuild74
-rw-r--r--mail-mta/sendmail/Manifest17
-rw-r--r--mail-mta/sendmail/files/libmilter-sharedlib.patch55
-rw-r--r--mail-mta/sendmail/files/sendmail25
-rw-r--r--mail-mta/sendmail/files/sendmail-8.14.5+db-5.0.patch13
-rw-r--r--mail-mta/sendmail/files/sendmail-8.14.6-build-system.patch211
-rw-r--r--mail-mta/sendmail/files/sendmail-delivered_hdr.patch10
-rw-r--r--mail-mta/sendmail/files/sendmail-procmail.mc12
-rw-r--r--mail-mta/sendmail/files/sendmail-starttls-multi-crl.patch20
-rw-r--r--mail-mta/sendmail/files/sendmail.mc-r111
-rw-r--r--mail-mta/sendmail/files/sendmail.service15
-rw-r--r--mail-mta/sendmail/files/site.config.m416
-rw-r--r--mail-mta/sendmail/files/sm-client.service14
-rw-r--r--mail-mta/sendmail/metadata.xml8
-rw-r--r--mail-mta/sendmail/sendmail-8.14.9-r1.ebuild205
-rw-r--r--mail-mta/sendmail/sendmail-8.14.9.ebuild202
-rw-r--r--mail-mta/ssmtp/Manifest8
-rw-r--r--mail-mta/ssmtp/metadata.xml11
-rw-r--r--mail-mta/ssmtp/ssmtp-2.64-r2.ebuild116
-rw-r--r--mail-mta/ssmtp/ssmtp-2.64-r3.ebuild119
143 files changed, 10879 insertions, 0 deletions
diff --git a/mail-mta/courier/Manifest b/mail-mta/courier/Manifest
new file mode 100644
index 000000000000..6855fd71fc03
--- /dev/null
+++ b/mail-mta/courier/Manifest
@@ -0,0 +1,12 @@
+AUX apache-sqwebmail.inc 347 SHA256 3a6616dacfd49ab0c89c62d9df5662fc3c2d9e598786d781240bf5e8900afc65 SHA512 e3f8f4f01563184ec4afc98d61ab739d5900f7d8757638fb06ff21ca3604f8c6f708730af514f6ca662559980503dee5955ba48c5a643e473054f3eec49b89a0 WHIRLPOOL e586f1bcf82af87df2285ec142f92056fd25df515b2cdc1027d62a97a26ba8205204c192c0bf0b59fb636ca84f70baadd79ea8a60bf9cb97db34e2b66aaee8f4
+AUX courier-init-r4 4965 SHA256 ee9316314925c8c4d59a225398d0d0ab48ba0788224e8383ba610402357128be SHA512 ca5e12bfa4fe2166cd2c1ef8c68e3cda957fd33011971237f3f76ec9d4ec1503eb22d78ec08ed42671d8858790ea7761c272a4896c680a51691c094696fee5f9 WHIRLPOOL e1857116d36306c03db5a82a29b41821fc74c7262ac5499df1af7c917e2877a2d97de8c49da3c30b18d29f8d2c7bda05c5780fb75e0594386aa04c889b0a0411
+AUX norewrite.patch 489 SHA256 526f3742fb43af93811e6e4b3210fda1c611b50ce5abdf3a57a25dfe4f5c38e4 SHA512 e9e95bd5d1a78b510f6dd7e155999089f123eecfdc16d3b5005b00981a7b6d29827cdddc61035ed3c3edcf0b9907ddfbae76df6503a1a8ef26b4de43a02bfc8e WHIRLPOOL c41a0b63a2109ac33532de0830257929995383d246eb3f84674e6fcf267ce5cc0b7e8ce339926429a7212f63aa117b5de65bc870f21b0a4a545f4b3f10827323
+AUX password.dist 247 SHA256 46f20a84922d108d39a7c26ad3ba8915326549f46cea811e2384f55a589d38e2 SHA512 f488b0ab1a909c9b878b9f3f3147641a9ed6d8d2ad44c67cd641934b800b18a62de2a7f5f51fdbecfbbcdd7c39c753734984cc0836c905a3b708858e1b91093d WHIRLPOOL 98883b10ae103663d1d1205532e6c243bb462e9dc2adf1b9d6a968f9246283bbb2aabb8779ab5d8b7d052a5a3032f9d113ac74c773bf7591e81ccf086a2e51b3
+DIST courier-0.75.0.tar.bz2 6970339 SHA256 2571a5b938649681ee98a2dc137f088aae0fd584cca3adf2dde1d826185406cc SHA512 37e66329f157e18176d4ac8c5e814be78e80ff7dec234886bec8dce2ae5c58ac68bc18e07c739295c25fae8ec778b162bab505d85ea0998db7192d52c47e7bc6 WHIRLPOOL 8cfd184beddb48e7e6efab4917372ec331d3e08f608abc6257ed408df96e100cf28226665fe1018b24e00e4336d705417484a6d890f11a6feb84045d9f969e17
+DIST courier-0.76.4.tar.bz2 7237424 SHA256 4e2fd0dbe7375a081731fe27ef2cd6c27ec87be0a0364374ffb8729e4ab65e59 SHA512 6350ef5e30bd1e4921350bf3a09de0b56513530852c93f9a06e23625e49ae09d7ff26558da1f816a5bb492579afb5c1cbcf7573199bf898a039cd3607e847c30 WHIRLPOOL 3de5fc1869563182bf6e63bb8e9ded677e4ee27f0344acec5611cc86672cb4df98b4a2ffcae08f307e50f00f3d2444a44b76ea52f25ed4b6dcdb7756cac81986
+EBUILD courier-0.75.0-r1.ebuild 9427 SHA256 574cc7e9c6577c4c5332ca343b21bfa652aa168c71862f0ee1e53b0b129b590c SHA512 f2f24fc78ef2865f2734802004abbcad11fd78ff11ec3ea4f9a5a9599c227553bb3c4f73225aef46dba28961e4c9113f722fc1ec9d9bebd23f83097efa4ea866 WHIRLPOOL b951a08d10ddc002fd3d9cf5e1431889a38de86e2649489f1cdc2714feaff1ea80cd9bb714498e94bb7047105d78e49248380c192f27247b15e602706b0e7694
+EBUILD courier-0.75.0.ebuild 9322 SHA256 44fc43ecbae3585da361cc609778f8528bce22618c7412e46556e26092a954b0 SHA512 11c0d1f278d13d0ff77691f48065c289870545414161e35fd10dd95c429a1e2adc97f1cef3da578211468ec46b74fa7b698a8fbf6205c1bd7b05b1f71c6b9434 WHIRLPOOL 25c4ab6d472b8ae1a8353e694b71f88f57ec50f631e970db2d1a7319f598960fde3626ca4af6d885bda6ef6fed663b47afd1b00da1f74c9205fe4e44e0bef703
+EBUILD courier-0.76.4.ebuild 9327 SHA256 9cc11da2d5639bba61d76fd75df868a766d33facf2dc77dab63ebe6e78150083 SHA512 91a9cf8f9f2953b97793e6c1fe3db0e3e0eeb81692a8604eef46736b58584235bff3194db8d4de2d062e4d90a267c2e578623f8a2c4e710b7092273096672a90 WHIRLPOOL f803243b0c076f7b04b0bc46cd9ac8a70e542eb34948168c1f6a36d5186deef57f55aba10b0ad1b69d349524d98130b39d2ab88877e8c40c5bd8ddcece2c8229
+MISC ChangeLog 3523 SHA256 999a8bb7b052fb1de25a32dd0432cf2c1b463acf92b6635cd3efda3530234833 SHA512 dc766a3d52a171336631157f7cb8a293628255620aa194f65a670f0dd0fc6872e363969aa4b6e7b70bc6f7833b906cc852b6d5cbd575d391bf9a08204b7e5cb8 WHIRLPOOL f29554b2e080984ab8e2e8d178917e1f37803648488d33b078bb8d6c13cb928c1d127c5af2dd56047b4b6be52a03779177fe3bb2cadc25c2547618cb9d4b5053
+MISC ChangeLog-2015 41616 SHA256 976bf31b34bb52b1419c3a3ce9c4aac056cb151831f349adaa748b4ff468fe98 SHA512 6802d9404f5973301c400bead487ef1ab82469ae962106096ea734c92a10afc653ef21b40060d324d82cc7684cb12179278483245ba5cf3ef0bf66a5145cfd5e WHIRLPOOL 4bdea1231ca3bb87efd3470abb6df693c34dbbfd67603bae38060079d8eca352e0dc8132d845aefeb491ec9151ddb26201e95c48d2d6d65bc6fcdb5e51615d33
+MISC metadata.xml 860 SHA256 4e30b525e98f5fcf1aea328bc8ee53e87d5d4270b5a341b66279c17133d07cf7 SHA512 00c4c31649f17ac2fba94122762bcd4c2f9b57ad3117645c1f0607d6d214ecd6c9c789a7b2d48b1945472e38da49257ea2903b1abec3294cfecbc25ff4501c7e WHIRLPOOL 86d40c34f61404ba38f5fe945b7d8c9a6b6c5d2fe40c8250867703c8f76123a8754f3f36a38c79f8a697b235940f2d1de8b9e31c964687d513365e774b4d2894
diff --git a/mail-mta/courier/courier-0.75.0-r1.ebuild b/mail-mta/courier/courier-0.75.0-r1.ebuild
new file mode 100644
index 000000000000..6ace61ccecb1
--- /dev/null
+++ b/mail-mta/courier/courier-0.75.0-r1.ebuild
@@ -0,0 +1,312 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils flag-o-matic multilib
+
+DESCRIPTION="An MTA designed specifically for maildirs"
+SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
+HOMEPAGE="http://www.courier-mta.org/"
+SLOT="0"
+LICENSE="GPL-2"
+# not in keywords due to missing dependencies:
+# ~s390 ~ppc64 ~alpha ~ia64 ~sparc ~x86
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~sparc ~x86"
+IUSE="postgres ldap libressl mysql pam nls ipv6 spell fax crypt norewrite \
+ fam web webmail gnutls"
+REQUIRED_USE="?? ( gnutls libressl )"
+
+DEPEND="
+ >=net-libs/courier-authlib-0.66.3
+ >=net-libs/courier-unicode-1.3
+ !gnutls? ( !libressl? ( dev-libs/openssl:0= ) )
+ libressl? ( dev-libs/libressl:= )
+ gnutls? ( net-libs/gnutls )
+ >=sys-libs/gdbm-1.8.0
+ dev-libs/libpcre
+ app-misc/mime-types
+ fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
+ pam? ( virtual/pam )
+ mysql? ( virtual/mysql )
+ ldap? ( >=net-nds/openldap-1.2.11 )
+ postgres? ( dev-db/postgresql:= )
+ spell? ( app-text/aspell )
+ fam? ( virtual/fam )
+ !mail-filter/maildrop
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ !mail-mta/opensmtpd
+ !net-mail/dot-forward
+ !sys-apps/ucspi-tcp
+ "
+
+RDEPEND="${DEPEND}
+ dev-lang/perl
+ sys-process/procps"
+
+# get rid of old style virtual/imapd - bug 350792
+# all blockers really needed?
+RDEPEND="${RDEPEND}
+ !net-mail/bincimap
+ !net-mail/courier-imap
+ !net-mail/cyrus-imapd
+ !net-mail/uw-imap"
+
+PDEPEND="pam? ( net-mail/mailbase )
+ crypt? ( >=app-crypt/gnupg-1.0.4 )"
+
+src_prepare() {
+# unpack ${A}
+# cd "${S}"
+ use norewrite && epatch "${FILESDIR}/norewrite.patch"
+}
+
+src_configure() {
+ filter-flags '-fomit-frame-pointer'
+
+ local myconf
+ myconf=""
+
+ use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
+
+ econf ${myconf} \
+ $(use_with fam) \
+ $(use_with ipv6) \
+ $(use_with spell ispell) \
+ $(use_with ldap ldapaliasd) \
+ $(use_enable ldap maildroldap) \
+ $(use_with gnutls) \
+ --enable-mimetypes=/etc/mime.types \
+ --prefix=/usr \
+ --disable-root-check \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc/courier \
+ --libexecdir=/usr/$(get_libdir)/courier \
+ --datadir=/usr/share/courier \
+ --sharedstatedir=/var/lib/courier/com \
+ --localstatedir=/var/lib/courier \
+ --with-piddir=/var/run/courier \
+ --with-authdaemonvar=/var/lib/courier/authdaemon \
+ --with-mailuser=mail \
+ --with-mailgroup=mail \
+ --with-paranoid-smtpext \
+ --with-db=gdbm \
+ --disable-autorenamesent \
+ --cache-file="${S}/configuring.cache" \
+ --host="${CHOST}" debug=true || die "./configure"
+ sed -e'/^install-perms-local:/a\ sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
+}
+
+src_compile() {
+ default
+}
+
+etc_courier() {
+ # Import existing /etc/courier/file if it exists.
+ # Add option only if it was not already set or even commented out
+ file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
+ [ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
+ cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
+ grep -q "${word}" "${D}/etc/courier/${file}" || \
+ echo "${2}" >> "${D}/etc/courier/${file}"
+}
+
+etc_courier_chg() {
+ file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
+ [ -z "${section}" ] && section="${2}"
+ grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
+ sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
+}
+
+src_install() {
+ local f
+ diropts -o mail -g mail
+ keepdir /var/lib/courier/tmp
+ keepdir /var/lib/courier/msgs
+ make install DESTDIR="${D}" || die "install"
+ make install-configure || die "install-configure"
+
+ # init script takes care of this
+ rm -rf "${D}/var/run"
+
+ # Get rid of files we dont want
+ if ! use webmail ; then
+ rm -rf "${D}/usr/$(get_libdir)/courier/courier/webmail" \
+ "${D}/usr/$(get_libdir)/courier/courier/sqwebmaild" \
+ "${D}/usr/share/courier/sqwebmail/" \
+ "${D}/usr/sbin/webmaild" \
+ "${D}/usr/sbin/webgpg" \
+ "${D}/etc/courier/webmail.authpam" \
+ "${D}/var/lib/courier/webmail-logincache" \
+ "${D}"/etc/courier/sqwebmaild*
+ fi
+
+ if ! use web ; then
+ rm -rf "${D}/usr/share/courier/courierwebadmin/" \
+ "${D}/etc/courier/webadmin"
+ fi
+
+ for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
+ keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
+ done
+
+ newinitd "${FILESDIR}/courier-init-r4" "courier"
+ use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
+
+ cd "${D}/etc/courier"
+ if use webmail ; then
+ insinto /etc/courier
+ newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
+ fi
+
+ for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
+ if use ldap ; then
+ [ -e ldapaliasrc ] && ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
+ else
+ rm -f ldapaliasrc
+ fi
+
+ ( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
+ > "${D}/etc/courier/sizelimit"
+ etc_courier maildroprc ""
+ etc_courier esmtproutes ""
+ etc_courier backuprelay ""
+ etc_courier locallowercase ""
+ etc_courier bofh "opt BOFHBADMIME=accept"
+ etc_courier bofh "opt BOFHSPFTRUSTME=1"
+ etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
+ etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
+ etc_courier bofh "opt BOFHSPFFROM=all"
+ etc_courier bofh "opt BOFHSPFMAILFROM=all"
+ etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
+ etc_courier esmtpd "BOFHBADMIME=accept"
+ etc_courier esmtpd-ssl "BOFHBADMIME=accept"
+ etc_courier esmtpd-msa "BOFHBADMIME=accept"
+
+ use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
+ use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
+
+ # Fix for a sandbox violation on subsequential merges
+ # - ticho@gentoo.org, 2005-07-10
+ dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
+ dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
+ dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
+ dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
+
+ cd "${S}"
+ cp imap/README README.imap
+ use nls && cp unicode/README README.unicode
+ dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
+ dodoc libs/tcpd/README.couriertls
+ mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${PF}/html"
+
+ if use webmail ; then
+ insinto /usr/$(get_libdir)/courier/courier
+ insopts -m 755 -o mail -g mail
+ doins "${S}/courier/webmaild"
+ fi
+
+ if use web ; then
+ insinto /etc/courier/webadmin
+ insopts -m 400 -o mail -g mail
+ doins "${FILESDIR}/password.dist"
+ fi
+
+ # avoid name collisions in /usr/sbin, make webadmin match
+ cd "${D}/usr/sbin"
+ for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
+ if use web ; then
+ sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
+ -e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
+ "${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
+ || ewarn "failed to fix webadmin"
+ sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
+ -e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
+ "${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
+ || ewarn "failed to fix webadmin"
+ fi
+
+ # users should be able to send mail. Could be restricted with suictl.
+ chmod u+s "${D}/usr/bin/sendmail"
+
+ dosym /usr/bin/sendmail /usr/sbin/sendmail
+}
+
+src_test() {
+ if [ `whoami` != 'root' ]; then
+ emake -j1 check || die "Make check failed."
+ else
+ einfo "make check skipped, can't run as root."
+ einfo "You can enable it with FEATURES=\"userpriv\""
+ fi
+}
+
+pkg_postinst() {
+ use fam && elog "fam daemon is needed for courier-imapd" \
+ || ewarn "courier was built without fam support"
+}
+
+pkg_config() {
+ mailhost="$(hostname)"
+ export mailhost
+
+ domainname="$(domainname)"
+ if [ "x$domainname" = "x(none)" ] ; then
+ domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
+ fi
+ export domainname
+
+ if [ "${ROOT}" = "/" ] ; then
+ file="${ROOT}/etc/courier/locals"
+ if [ ! -f "${file}" ] ; then
+ echo "localhost" > "${file}";
+ echo "${domainname}" >> "${file}";
+ fi
+ file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
+ if [ ! -f "${file}" ] ; then
+ echo "${domainname}" > "${file}"
+ /usr/sbin/makeacceptmailfor
+ fi
+
+ file="${ROOT}/etc/courier/smtpaccess/${domainname}"
+ if [ ! -f "${file}" ]
+ then
+ netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
+ do
+ i=1
+ net=""
+ TIFS="${IFS}"
+ IFS="."
+ for o in "${netmask}"
+ do
+ if [ "${o}" == "255" ]
+ then
+ [ "_${net}" == "_" ] || net="${net}."
+ t="$(echo "${network}" | cut -d " " -f ${i})"
+ net="${net}${t}"
+ fi
+ i="$((${i} + 1))"
+ done
+ IFS="${TIFS}"
+ echo "doing configuration - relay control for the network ${net} !"
+ echo "${net} allow,RELAYCLIENT" >> ${file}
+ done
+ /usr/sbin/makesmtpaccess
+ fi
+ fi
+
+ echo "creating cert for esmtpd-ssl:"
+ /usr/sbin/mkesmtpdcert
+ echo "creating cert for imapd-ssl:"
+ /usr/sbin/mkpop3dcert
+ echo "creating cert for pop3d-ssl:"
+ /usr/sbin/mkimapdcert
+}
diff --git a/mail-mta/courier/courier-0.75.0.ebuild b/mail-mta/courier/courier-0.75.0.ebuild
new file mode 100644
index 000000000000..0365834aafe8
--- /dev/null
+++ b/mail-mta/courier/courier-0.75.0.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils flag-o-matic multilib
+
+DESCRIPTION="An MTA designed specifically for maildirs"
+SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
+HOMEPAGE="http://www.courier-mta.org/"
+SLOT="0"
+LICENSE="GPL-2"
+# not in keywords due to missing dependencies:
+# ~s390 ~ppc64 ~alpha ~ia64 ~sparc ~x86
+KEYWORDS="alpha amd64 ~arm hppa ia64 ppc sparc x86"
+IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite \
+ fam web webmail gnutls"
+
+DEPEND="
+ >=net-libs/courier-authlib-0.66.3
+ >=net-libs/courier-unicode-1.3
+ !gnutls? ( dev-libs/openssl:= )
+ gnutls? ( net-libs/gnutls )
+ >=sys-libs/gdbm-1.8.0
+ dev-libs/libpcre
+ app-misc/mime-types
+ fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
+ pam? ( virtual/pam )
+ mysql? ( virtual/mysql )
+ ldap? ( >=net-nds/openldap-1.2.11 )
+ postgres? ( dev-db/postgresql:= )
+ spell? ( app-text/aspell )
+ fam? ( virtual/fam )
+ !mail-filter/maildrop
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ !mail-mta/opensmtpd
+ !net-mail/dot-forward
+ !sys-apps/ucspi-tcp
+ "
+
+RDEPEND="${DEPEND}
+ dev-lang/perl
+ sys-process/procps"
+
+# get rid of old style virtual/imapd - bug 350792
+# all blockers really needed?
+RDEPEND="${RDEPEND}
+ !net-mail/bincimap
+ !net-mail/courier-imap
+ !net-mail/cyrus-imapd
+ !net-mail/uw-imap"
+
+PDEPEND="pam? ( net-mail/mailbase )
+ crypt? ( >=app-crypt/gnupg-1.0.4 )"
+
+src_prepare() {
+# unpack ${A}
+# cd "${S}"
+ use norewrite && epatch "${FILESDIR}/norewrite.patch"
+}
+
+src_configure() {
+ filter-flags '-fomit-frame-pointer'
+
+ local myconf
+ myconf=""
+
+ use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
+
+ econf ${myconf} \
+ $(use_with fam) \
+ $(use_with ipv6) \
+ $(use_with spell ispell) \
+ $(use_with ldap ldapaliasd) \
+ $(use_enable ldap maildroldap) \
+ $(use_with gnutls) \
+ --enable-mimetypes=/etc/mime.types \
+ --prefix=/usr \
+ --disable-root-check \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc/courier \
+ --libexecdir=/usr/$(get_libdir)/courier \
+ --datadir=/usr/share/courier \
+ --sharedstatedir=/var/lib/courier/com \
+ --localstatedir=/var/lib/courier \
+ --with-piddir=/var/run/courier \
+ --with-authdaemonvar=/var/lib/courier/authdaemon \
+ --with-mailuser=mail \
+ --with-mailgroup=mail \
+ --with-paranoid-smtpext \
+ --with-db=gdbm \
+ --disable-autorenamesent \
+ --cache-file="${S}/configuring.cache" \
+ --host="${CHOST}" debug=true || die "./configure"
+ sed -e'/^install-perms-local:/a\ sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
+}
+
+src_compile() {
+ default
+}
+
+etc_courier() {
+ # Import existing /etc/courier/file if it exists.
+ # Add option only if it was not already set or even commented out
+ file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
+ [ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
+ cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
+ grep -q "${word}" "${D}/etc/courier/${file}" || \
+ echo "${2}" >> "${D}/etc/courier/${file}"
+}
+
+etc_courier_chg() {
+ file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
+ [ -z "${section}" ] && section="${2}"
+ grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
+ sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
+}
+
+src_install() {
+ local f
+ diropts -o mail -g mail
+ keepdir /var/lib/courier/tmp
+ keepdir /var/lib/courier/msgs
+ make install DESTDIR="${D}" || die "install"
+ make install-configure || die "install-configure"
+
+ # init script takes care of this
+ rm -rf "${D}/var/run"
+
+ # Get rid of files we dont want
+ if ! use webmail ; then
+ rm -rf "${D}/usr/$(get_libdir)/courier/courier/webmail" \
+ "${D}/usr/$(get_libdir)/courier/courier/sqwebmaild" \
+ "${D}/usr/share/courier/sqwebmail/" \
+ "${D}/usr/sbin/webmaild" \
+ "${D}/usr/sbin/webgpg" \
+ "${D}/etc/courier/webmail.authpam" \
+ "${D}/var/lib/courier/webmail-logincache" \
+ "${D}"/etc/courier/sqwebmaild*
+ fi
+
+ if ! use web ; then
+ rm -rf "${D}/usr/share/courier/courierwebadmin/" \
+ "${D}/etc/courier/webadmin"
+ fi
+
+ for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
+ keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
+ done
+
+ newinitd "${FILESDIR}/courier-init-r4" "courier"
+ use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
+
+ cd "${D}/etc/courier"
+ if use webmail ; then
+ insinto /etc/courier
+ newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
+ fi
+
+ for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
+ if use ldap ; then
+ [ -e ldapaliasrc ] && ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
+ else
+ rm -f ldapaliasrc
+ fi
+
+ ( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
+ > "${D}/etc/courier/sizelimit"
+ etc_courier maildroprc ""
+ etc_courier esmtproutes ""
+ etc_courier backuprelay ""
+ etc_courier locallowercase ""
+ etc_courier bofh "opt BOFHBADMIME=accept"
+ etc_courier bofh "opt BOFHSPFTRUSTME=1"
+ etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
+ etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
+ etc_courier bofh "opt BOFHSPFFROM=all"
+ etc_courier bofh "opt BOFHSPFMAILFROM=all"
+ etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
+ etc_courier esmtpd "BOFHBADMIME=accept"
+ etc_courier esmtpd-ssl "BOFHBADMIME=accept"
+ etc_courier esmtpd-msa "BOFHBADMIME=accept"
+
+ use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
+ use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
+
+ # Fix for a sandbox violation on subsequential merges
+ # - ticho@gentoo.org, 2005-07-10
+ dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
+ dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
+ dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
+ dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
+
+ cd "${S}"
+ cp imap/README README.imap
+ use nls && cp unicode/README README.unicode
+ dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
+ dodoc libs/tcpd/README.couriertls
+ mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${PF}/html"
+
+ if use webmail ; then
+ insinto /usr/$(get_libdir)/courier/courier
+ insopts -m 755 -o mail -g mail
+ doins "${S}/courier/webmaild"
+ fi
+
+ if use web ; then
+ insinto /etc/courier/webadmin
+ insopts -m 400 -o mail -g mail
+ doins "${FILESDIR}/password.dist"
+ fi
+
+ # avoid name collisions in /usr/sbin, make webadmin match
+ cd "${D}/usr/sbin"
+ for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
+ if use web ; then
+ sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
+ -e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
+ "${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
+ || ewarn "failed to fix webadmin"
+ sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
+ -e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
+ "${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
+ || ewarn "failed to fix webadmin"
+ fi
+
+ # users should be able to send mail. Could be restricted with suictl.
+ chmod u+s "${D}/usr/bin/sendmail"
+
+ dosym /usr/bin/sendmail /usr/sbin/sendmail
+}
+
+src_test() {
+ if [ `whoami` != 'root' ]; then
+ emake -j1 check || die "Make check failed."
+ else
+ einfo "make check skipped, can't run as root."
+ einfo "You can enable it with FEATURES=\"userpriv\""
+ fi
+}
+
+pkg_postinst() {
+ use fam && elog "fam daemon is needed for courier-imapd" \
+ || ewarn "courier was built without fam support"
+}
+
+pkg_config() {
+ mailhost="$(hostname)"
+ export mailhost
+
+ domainname="$(domainname)"
+ if [ "x$domainname" = "x(none)" ] ; then
+ domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
+ fi
+ export domainname
+
+ if [ "${ROOT}" = "/" ] ; then
+ file="${ROOT}/etc/courier/locals"
+ if [ ! -f "${file}" ] ; then
+ echo "localhost" > "${file}";
+ echo "${domainname}" >> "${file}";
+ fi
+ file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
+ if [ ! -f "${file}" ] ; then
+ echo "${domainname}" > "${file}"
+ /usr/sbin/makeacceptmailfor
+ fi
+
+ file="${ROOT}/etc/courier/smtpaccess/${domainname}"
+ if [ ! -f "${file}" ]
+ then
+ netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
+ do
+ i=1
+ net=""
+ TIFS="${IFS}"
+ IFS="."
+ for o in "${netmask}"
+ do
+ if [ "${o}" == "255" ]
+ then
+ [ "_${net}" == "_" ] || net="${net}."
+ t="$(echo "${network}" | cut -d " " -f ${i})"
+ net="${net}${t}"
+ fi
+ i="$((${i} + 1))"
+ done
+ IFS="${TIFS}"
+ echo "doing configuration - relay control for the network ${net} !"
+ echo "${net} allow,RELAYCLIENT" >> ${file}
+ done
+ /usr/sbin/makesmtpaccess
+ fi
+ fi
+
+ echo "creating cert for esmtpd-ssl:"
+ /usr/sbin/mkesmtpdcert
+ echo "creating cert for imapd-ssl:"
+ /usr/sbin/mkpop3dcert
+ echo "creating cert for pop3d-ssl:"
+ /usr/sbin/mkimapdcert
+}
diff --git a/mail-mta/courier/courier-0.76.4.ebuild b/mail-mta/courier/courier-0.76.4.ebuild
new file mode 100644
index 000000000000..f1b0aa79e0c5
--- /dev/null
+++ b/mail-mta/courier/courier-0.76.4.ebuild
@@ -0,0 +1,308 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils flag-o-matic multilib
+
+DESCRIPTION="An MTA designed specifically for maildirs"
+SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
+HOMEPAGE="http://www.courier-mta.org/"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="postgres ldap libressl mysql pam nls ipv6 spell fax crypt norewrite \
+ fam web webmail gnutls"
+REQUIRED_USE="?? ( gnutls libressl )"
+
+DEPEND="
+ >=net-libs/courier-authlib-0.66.3
+ >=net-libs/courier-unicode-1.4
+ !gnutls? ( !libressl? ( dev-libs/openssl:0= ) )
+ libressl? ( dev-libs/libressl:= )
+ gnutls? ( net-libs/gnutls )
+ >=sys-libs/gdbm-1.8.0
+ dev-libs/libpcre
+ app-misc/mime-types
+ fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
+ pam? ( virtual/pam )
+ mysql? ( virtual/mysql )
+ ldap? ( >=net-nds/openldap-1.2.11 )
+ postgres? ( dev-db/postgresql:= )
+ spell? ( app-text/aspell )
+ fam? ( virtual/fam )
+ !mail-filter/maildrop
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ !mail-mta/opensmtpd
+ !net-mail/dot-forward
+ !sys-apps/ucspi-tcp
+ "
+
+RDEPEND="${DEPEND}
+ dev-lang/perl
+ sys-process/procps"
+
+# get rid of old style virtual/imapd - bug 350792
+# all blockers really needed?
+RDEPEND="${RDEPEND}
+ !net-mail/bincimap
+ !net-mail/courier-imap
+ !net-mail/cyrus-imapd
+ !net-mail/uw-imap"
+
+PDEPEND="pam? ( net-mail/mailbase )
+ crypt? ( >=app-crypt/gnupg-1.0.4 )"
+
+src_prepare() {
+ use norewrite && epatch "${FILESDIR}/norewrite.patch"
+}
+
+src_configure() {
+ filter-flags '-fomit-frame-pointer'
+
+ local myconf
+ myconf=""
+
+ use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
+
+ econf ${myconf} \
+ $(use_with fam) \
+ $(use_with ipv6) \
+ $(use_with spell ispell) \
+ $(use_with ldap ldapaliasd) \
+ $(use_enable ldap maildroldap) \
+ $(use_with gnutls) \
+ --enable-mimetypes=/etc/mime.types \
+ --prefix=/usr \
+ --disable-root-check \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc/courier \
+ --libexecdir=/usr/$(get_libdir)/courier \
+ --datadir=/usr/share/courier \
+ --sharedstatedir=/var/lib/courier/com \
+ --localstatedir=/var/lib/courier \
+ --with-piddir=/var/run/courier \
+ --with-authdaemonvar=/var/lib/courier/authdaemon \
+ --with-mailuser=mail \
+ --with-mailgroup=mail \
+ --with-paranoid-smtpext \
+ --with-db=gdbm \
+ --disable-autorenamesent \
+ --cache-file="${S}/configuring.cache" \
+ --host="${CHOST}" debug=true || die "./configure"
+ sed -e'/^install-perms-local:/a\ sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
+}
+
+src_compile() {
+ default
+}
+
+etc_courier() {
+ # Import existing /etc/courier/file if it exists.
+ # Add option only if it was not already set or even commented out
+ file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
+ [ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
+ cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
+ grep -q "${word}" "${D}/etc/courier/${file}" || \
+ echo "${2}" >> "${D}/etc/courier/${file}"
+}
+
+etc_courier_chg() {
+ file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
+ [ -z "${section}" ] && section="${2}"
+ grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
+ sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
+}
+
+src_install() {
+ local f
+ diropts -o mail -g mail
+ keepdir /var/lib/courier/tmp
+ keepdir /var/lib/courier/msgs
+ make install DESTDIR="${D}" || die "install"
+ make install-configure || die "install-configure"
+
+ # init script takes care of this
+ rm -rf "${D}/var/run"
+
+ # Get rid of files we dont want
+ if ! use webmail ; then
+ rm -rf "${D}/usr/$(get_libdir)/courier/courier/webmail" \
+ "${D}/usr/$(get_libdir)/courier/courier/sqwebmaild" \
+ "${D}/usr/share/courier/sqwebmail/" \
+ "${D}/usr/sbin/webmaild" \
+ "${D}/usr/sbin/webgpg" \
+ "${D}/etc/courier/webmail.authpam" \
+ "${D}/var/lib/courier/webmail-logincache" \
+ "${D}"/etc/courier/sqwebmaild*
+ fi
+
+ if ! use web ; then
+ rm -rf "${D}/usr/share/courier/courierwebadmin/" \
+ "${D}/etc/courier/webadmin"
+ fi
+
+ for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
+ keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
+ done
+
+ newinitd "${FILESDIR}/courier-init-r4" "courier"
+ use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
+
+ cd "${D}/etc/courier"
+ if use webmail ; then
+ insinto /etc/courier
+ newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
+ fi
+
+ for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
+ if use ldap ; then
+ [ -e ldapaliasrc ] && ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
+ else
+ rm -f ldapaliasrc
+ fi
+
+ ( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
+ > "${D}/etc/courier/sizelimit"
+ etc_courier maildroprc ""
+ etc_courier esmtproutes ""
+ etc_courier backuprelay ""
+ etc_courier locallowercase ""
+ etc_courier bofh "opt BOFHBADMIME=accept"
+ etc_courier bofh "opt BOFHSPFTRUSTME=1"
+ etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
+ etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
+ etc_courier bofh "opt BOFHSPFFROM=all"
+ etc_courier bofh "opt BOFHSPFMAILFROM=all"
+ etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
+ etc_courier esmtpd "BOFHBADMIME=accept"
+ etc_courier esmtpd-ssl "BOFHBADMIME=accept"
+ etc_courier esmtpd-msa "BOFHBADMIME=accept"
+
+ use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
+ use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
+
+ # Fix for a sandbox violation on subsequential merges
+ # - ticho@gentoo.org, 2005-07-10
+ dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
+ dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
+ dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
+ dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
+
+ cd "${S}"
+ cp imap/README README.imap
+ use nls && cp unicode/README README.unicode
+ dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
+ dodoc libs/tcpd/README.couriertls
+ mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${PF}/html"
+
+ if use webmail ; then
+ insinto /usr/$(get_libdir)/courier/courier
+ insopts -m 755 -o mail -g mail
+ doins "${S}/courier/webmaild"
+ fi
+
+ if use web ; then
+ insinto /etc/courier/webadmin
+ insopts -m 400 -o mail -g mail
+ doins "${FILESDIR}/password.dist"
+ fi
+
+ # avoid name collisions in /usr/sbin, make webadmin match
+ cd "${D}/usr/sbin"
+ for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
+ if use web ; then
+ sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
+ -e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
+ "${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
+ || ewarn "failed to fix webadmin"
+ sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
+ -e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
+ "${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
+ || ewarn "failed to fix webadmin"
+ fi
+
+ # users should be able to send mail. Could be restricted with suictl.
+ chmod u+s "${D}/usr/bin/sendmail"
+
+ dosym /usr/bin/sendmail /usr/sbin/sendmail
+}
+
+src_test() {
+ if [ `whoami` != 'root' ]; then
+ emake -j1 check || die "Make check failed."
+ else
+ einfo "make check skipped, can't run as root."
+ einfo "You can enable it with FEATURES=\"userpriv\""
+ fi
+}
+
+pkg_postinst() {
+ use fam && elog "fam daemon is needed for courier-imapd" \
+ || ewarn "courier was built without fam support"
+}
+
+pkg_config() {
+ mailhost="$(hostname)"
+ export mailhost
+
+ domainname="$(domainname)"
+ if [ "x$domainname" = "x(none)" ] ; then
+ domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
+ fi
+ export domainname
+
+ if [ "${ROOT}" = "/" ] ; then
+ file="${ROOT}/etc/courier/locals"
+ if [ ! -f "${file}" ] ; then
+ echo "localhost" > "${file}";
+ echo "${domainname}" >> "${file}";
+ fi
+ file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
+ if [ ! -f "${file}" ] ; then
+ echo "${domainname}" > "${file}"
+ /usr/sbin/makeacceptmailfor
+ fi
+
+ file="${ROOT}/etc/courier/smtpaccess/${domainname}"
+ if [ ! -f "${file}" ]
+ then
+ netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
+ do
+ i=1
+ net=""
+ TIFS="${IFS}"
+ IFS="."
+ for o in "${netmask}"
+ do
+ if [ "${o}" == "255" ]
+ then
+ [ "_${net}" == "_" ] || net="${net}."
+ t="$(echo "${network}" | cut -d " " -f ${i})"
+ net="${net}${t}"
+ fi
+ i="$((${i} + 1))"
+ done
+ IFS="${TIFS}"
+ echo "doing configuration - relay control for the network ${net} !"
+ echo "${net} allow,RELAYCLIENT" >> ${file}
+ done
+ /usr/sbin/makesmtpaccess
+ fi
+ fi
+
+ echo "creating cert for esmtpd-ssl:"
+ /usr/sbin/mkesmtpdcert
+ echo "creating cert for imapd-ssl:"
+ /usr/sbin/mkpop3dcert
+ echo "creating cert for pop3d-ssl:"
+ /usr/sbin/mkimapdcert
+}
diff --git a/mail-mta/courier/files/apache-sqwebmail.inc b/mail-mta/courier/files/apache-sqwebmail.inc
new file mode 100644
index 000000000000..c88f803c5d1b
--- /dev/null
+++ b/mail-mta/courier/files/apache-sqwebmail.inc
@@ -0,0 +1,14 @@
+Alias /webmail/ /usr/share/courier/sqwebmail/images/
+<Directory /usr/share/courier/sqwebmail/>
+ Order Allow,Deny
+ AllowOverride All
+ Allow from all
+</Directory>
+
+ScriptAlias /courier/ /usr/lib/courier/courier/webmail/
+<Directory /usr/lib/courier/courier/webmail/>
+ AllowOverride All
+ Options ExecCGI
+ Order allow,deny
+ Allow from all
+</Directory>
diff --git a/mail-mta/courier/files/courier-init-r4 b/mail-mta/courier/files/courier-init-r4
new file mode 100644
index 000000000000..28dbd7936744
--- /dev/null
+++ b/mail-mta/courier/files/courier-init-r4
@@ -0,0 +1,189 @@
+#!/sbin/openrc-run
+# Portions Copyright 2003 Gentoo Linux
+#
+# script originally from Courier distfile original name = courier.sysvinit
+# adapted for Gentoo by Brian Jackson
+#
+# TODO
+# should we update all the .dat/.pem files when the source/config files are
+# newer than the .dat/.pem files?
+
+prefix="/usr"
+exec_prefix="/usr/bin"
+sysconfdir="/etc/courier"
+sbindir="/usr/sbin"
+libexecdir="/usr/lib/courier"
+datadir="/usr/share/courier"
+
+depend() {
+ need net
+ [ -d /etc/courier/authlib ] && need courier-authlib
+ grep -q "^IMAPDSTART=.*[Yy].*" /etc/courier/imapd && use famd
+ grep -q "^IMAPDSSLSTART=.*[Yy].*" /etc/courier/imapd-ssl && use famd
+}
+
+checkconfig() {
+ checkpath -q -d -o mail:mail -m 0755 /var/run/courier
+
+ [ -f ${sysconfdir}/pop3d-ssl ] && . ${sysconfdir}/pop3d-ssl
+
+ # If we do not have a certificate, make one up.
+ [ ! -f "${datadir}/pop3d.pem" ] && \
+ ebegin " generating-POP3-SSL-certificate..." && "${sbindir}/mkpop3dcert"
+
+ [ -f ${sysconfdir}/imapd-ssl ] && . ${sysconfdir}/imapd-ssl
+
+ # If we do not have a certificate, make one up.
+ [ ! -f ${datadir}/imapd.pem ] && \
+ ebegin " generating-IMAP-SSL-certificate..." && "${sbindir}/mkimapdcert"
+
+ [ -f ${sysconfdir}/esmtpd-ssl ] && . ${sysconfdir}/esmtpd-ssl
+
+ # If we do not have a certificate, make one up.
+ [ ! -f ${datadir}/esmtpd.pem ] && \
+ ebegin " generating-ESMTP-SSL-certificate..." && "${sbindir}/mkesmtpdcert"
+
+ # First time after install create aliases.dat and smtpaccess.dat
+
+ [ -f ${sysconfdir}/aliases.dat ] || ${sbindir}/makealiases
+
+ [ -f ${sysconfdir}/${ACCESSFILE}.dat ] || ${sbindir}/makesmtpaccess
+
+ [ -f ${sysconfdir}/${ACCESSFILE}.dat ] || ${sbindir}/makesmtpaccess-msa
+}
+
+start() {
+ # Start daemons.
+ ebegin "Starting Courier mail server:"
+
+ checkconfig || return 1
+
+ ebegin " Starting courierfilterd"
+ ${sbindir}/courierfilter start
+
+ [ ! -d /etc/courier/authlib ] && [ -x ${libexecdir}/authlib/authdaemond ] && \
+ ${libexecdir}/authlib/authdaemond start && ebegin " Starting authdaemond"
+
+ [ -x ${sbindir}/webmaild ] && \
+ ${sbindir}/webmaild start && ebegin " Starting webmaild"
+
+ [ -x ${sbindir}/courierldapaliasd ] && \
+ ${sbindir}/courierldapaliasd start && ebegin " Starting courierldapaliasd"
+
+ ebegin " Starting courierd"
+ ${sbindir}/courier start
+
+ savepath="$PATH"
+ # start esmtpd if so written
+ [ -f ${sysconfdir}/esmtpd ] && source ${sysconfdir}/esmtpd
+ PATH="$savepath"
+ case x$ESMTPDSTART in
+ x[yY]*)
+ ebegin " Starting esmtpd"
+ ${sbindir}/esmtpd start
+ ;;
+ esac
+
+ # start esmtpd-msa if so written
+ [ -f ${sysconfdir}/esmtpd-msa ] && source ${sysconfdir}/esmtpd-msa
+ PATH="$savepath"
+ case x$ESMTPDSTART in
+ x[yY]*)
+ ebegin " Starting esmtpd-msa"
+ ${sbindir}/esmtpd-msa start
+ ;;
+ esac
+
+ # start esmtpd-ssl if so written
+ [ -f ${sysconfdir}/esmtpd-ssl ] && source ${sysconfdir}/esmtpd-ssl
+ PATH="$savepath"
+ case x$ESMTPDSSLSTART in
+ x[yY]*)
+ ebegin " Starting esmtpd-ssl"
+ ${sbindir}/esmtpd-ssl start
+ ;;
+ esac
+
+ # start pop3d if so written
+ [ -f ${sysconfdir}/pop3d ] && source ${sysconfdir}/pop3d
+ PATH="$savepath"
+ case x$POP3DSTART in
+ x[yY]*)
+ ebegin " courier-pop3d"
+ ${sbindir}/courier-pop3d start
+ ;;
+ esac
+
+ # start pop3d-ssl if so written
+ [ -f ${sysconfdir}/pop3d-ssl ] && source ${sysconfdir}/pop3d-ssl
+ PATH="$savepath"
+ case x$POP3DSSLSTART in
+ x[yY]*)
+ ebegin " courier-pop3d-ssl"
+ ${sbindir}/courier-pop3d-ssl start
+ ;;
+ esac
+
+ [ -f ${sysconfdir}/imapd ] && source ${sysconfdir}/imapd
+ PATH="$savepath"
+ case x$IMAPDSTART in
+ x[yY]*)
+ ebegin " courier-imapd"
+ ${sbindir}/courier-imapd start
+ ;;
+ esac
+
+ [ -f ${sysconfdir}/imapd-ssl ] && source ${sysconfdir}/imapd-ssl
+ PATH="$savepath"
+ case x$IMAPDSSLSTART in
+ x[yY]*)
+ ebegin " courier-imapd-ssl"
+ ${sbindir}/courier-imapd-ssl start
+ ;;
+ esac
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Courier mail server:"
+
+ ebegin " Stopping courier-esmtpd"
+ ${sbindir}/esmtpd stop
+
+ ebegin " Stopping courier-esmtpd-msa"
+ ${sbindir}/esmtpd-msa stop
+
+ ebegin " Stopping courier-esmtpd-ssl"
+ ${sbindir}/esmtpd-ssl stop
+
+ [ -x ${sbindir}/courier-pop3d ] && \
+ ebegin " Stopping courier-pop3d" && ${sbindir}/courier-pop3d stop
+
+ [ -x ${sbindir}/courier-pop3d-ssl ] && \
+ ebegin " Stopping courier-pop3d-ssl" && ${sbindir}/courier-pop3d-ssl stop
+
+ [ -x ${sbindir}/courier-imapd ] && \
+ ebegin " Stopping courier-imapd" && ${sbindir}/courier-imapd stop
+
+
+ [ -x ${sbindir}/courier-imapd-ssl ] && \
+ ebegin " Stopping courier-imapd-ssl" && ${sbindir}/courier-imapd-ssl stop
+
+ ebegin " Stopping courierd"
+ ${sbindir}/courier stop
+
+ [ -x ${sbindir}/courierldapaliasd ] && \
+ ( ${sbindir}/courierldapaliasd stop ; ebegin " Stopping courierldapaliasd" )
+
+ [ -x ${sbindir}/webmaild ] && \
+ ( ${sbindir}/webmaild stop ; ebegin " Stopping webmaild" )
+
+ [ ! -d /etc/courier/authlib ] && [ -x ${libexecdir}/authlib/authdaemond ] && \
+ ( ${libexecdir}/authlib/authdaemond stop ; ebegin " Stopping authdaemond" )
+
+ ${sbindir}/courierfilter stop
+ ebegin " Stopping courierfilterd"
+
+ eend $?
+}
diff --git a/mail-mta/courier/files/norewrite.patch b/mail-mta/courier/files/norewrite.patch
new file mode 100644
index 000000000000..8d8f5362967e
--- /dev/null
+++ b/mail-mta/courier/files/norewrite.patch
@@ -0,0 +1,21 @@
+--- courier/module.esmtp/esmtp.c.orig 2004-02-03 01:08:15.679486558 -0700
++++ courier/module.esmtp/esmtp.c 2004-02-03 01:07:41.262697092 -0700
+@@ -255,6 +255,10 @@ const char *me;
+ struct rfc822t *tp;
+ struct rfc822token at;
+
++#if 1
++ (*func)(info);
++ return;
++#else
+ if (info->ptr == 0)
+ {
+ (*func)(info);
+@@ -289,6 +293,7 @@ struct rfc822token at;
+ (*func)(info);
+ *r=0;
+ rfc822t_free(tp);
++#endif
+ }
+
+ static void rw_esmtp(struct rw_info *info, void (*func)(struct rw_info *))
diff --git a/mail-mta/courier/files/password.dist b/mail-mta/courier/files/password.dist
new file mode 100644
index 000000000000..5220e4ee0eb3
--- /dev/null
+++ b/mail-mta/courier/files/password.dist
@@ -0,0 +1,6 @@
+# 1. Open /etc/courier/webadmin/password for editing
+# 2. There should be one word in this file. The webadmin password
+# 3. chown mail:mail password
+# 4. chmod 400 password
+#
+# Thanks to Fernando Tobler on bug #10574 for the concise instructions
diff --git a/mail-mta/courier/metadata.xml b/mail-mta/courier/metadata.xml
new file mode 100644
index 000000000000..97214a9aee27
--- /dev/null
+++ b/mail-mta/courier/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hanno@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <longdescription>
+ Complete email package consisting of pop, imap, smtp, and fax
+ server and secure version of the above also.
+ </longdescription>
+ <use>
+ <flag name="fax">Enables fax support in the courier mail server</flag>
+ <flag name="norewrite">Prevents courier mail server from mangling
+ virtual user addresses when sending</flag>
+ <flag name="web">Enable the web interface</flag>
+ <flag name="webmail">Enable the webmail interface</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">courier</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/esmtp/Manifest b/mail-mta/esmtp/Manifest
new file mode 100644
index 000000000000..6657b1149f86
--- /dev/null
+++ b/mail-mta/esmtp/Manifest
@@ -0,0 +1,6 @@
+DIST esmtp-1.2.tar.bz2 127921 SHA256 a0d26931bf731f97514da266d079d8bc7d73c65b3499ed080576ab606b21c0ce SHA512 a1e7b56743ba32b1778bf02d0abcbdb5e6e3cb7d592c3a23a575789de60dfd62a307d4aef06860c9553cc492cdde0fff0a42de53e9d4e972587a10f609be4821 WHIRLPOOL 175ccf454a9eb76a9dccbf8964ee58c24000e6141a311fbf6c98ff09265fc167ab7d7b0721e187dcab90d2c0958cb55efcd88a4e34514158b559e18b67f2dcff
+EBUILD esmtp-1.2-r1.ebuild 1001 SHA256 4641444e7d4d4aacc5ac5d7dd74e1ae4c5333aeb94b7d74fee7566c38eb7eabf SHA512 c3558bdd6a590487e8ae190d00d1b41c3ce9db755bafd4555736bfc67a6f4b6a4cc85b16547b42959c8e4b8e587f00b5f1db19547059605395dcc96cf3006f54 WHIRLPOOL aa9e1f1f589b8c89992715aa84f8c12ba41df9a6245c6d3b4d977f242130a5d84c99e5ded048cb67fa0adc132311a3382bd3200c21dce576a3d71790a83f83f0
+EBUILD esmtp-1.2.ebuild 960 SHA256 337d573445de3b84b3743a3c7231a5ab864c8a321c192e2709a4292353d854a3 SHA512 40cdab611e4af55baa468820e650ecccf0f19d8b655fcd27ca8302d5f8901c0c2113219b8d0d3144285cb380f44614572574ac1aa6455b0c9a3669376e82530d WHIRLPOOL 0bdbe6322ce118632659c0a1fed686c5911dc9aa492696aa2ed6048ba3d36128f89fbb856b3d78f0188c5885560ff1a846906ab7b61bb5827b046d3c475eb426
+MISC ChangeLog 2563 SHA256 86faf9500c7b57fcf92f5a40ba2876ab7cb78e7332926e58085e0384992911f3 SHA512 5e9db4331b0bed679a1f63c3bb1e6e23333ff0bbf949f39789b3287325024245fb5594492d2e82000c0af199d7b42308a5e1ac19428e14dfb8947a72a610ded5 WHIRLPOOL 0c8c83910f5359d215e4c2a3db26a204f9df9ec5ea497b35d30e6d9679e9c81c664b79448c3311f155694af23fc8715db9579908e8d06e71e7b57724998c21c6
+MISC ChangeLog-2015 4515 SHA256 2568eeab41799c070ebb362c78dbcf420c2c64737ac449373336ca5d34a77b70 SHA512 253862b2ae93fe9ee8a9f16e69edd480f9f7d736c9feead9a843b039cefb5e77c320e7b50dfbb9c8b9dd65fa2c8f94c9654e7a82273d6dd1450d5e486370ad78 WHIRLPOOL 80bc8850a042f30cca7b750b0babfbde1ed6abea18f669857a872ca86380673eed315aa0cb67a31c3f321d0543f249adcb2934cdd046801c6ac1e5420a490938
+MISC metadata.xml 319 SHA256 c1eb0d38961b43cb4a0e7ff02900467257804a49ab40de943952e1eb49e2c616 SHA512 e4d66ee7dbffe75806e0c558e8ccdb27775477051c56e813a9e1d494c971909bd6797e6e0e9986150c15f9ddf51c06cb73da4798f125ba57ea8ece83ecc5961c WHIRLPOOL 168ed50a6f6821b0ee1b3a997221ac53183598a4ed9be2db0bbee32f190b6a8529ac067079a4d870167d59886bc0c1b5f55e321e992e8895616c1ca9e8238c83
diff --git a/mail-mta/esmtp/esmtp-1.2-r1.ebuild b/mail-mta/esmtp/esmtp-1.2-r1.ebuild
new file mode 100644
index 000000000000..320421752547
--- /dev/null
+++ b/mail-mta/esmtp/esmtp-1.2-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="esmtp is a user configurable relay-only Mail Transfer Agent (MTA) with a sendmail compatible syntax"
+HOMEPAGE="http://esmtp.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x86-macos"
+IUSE="libressl"
+
+CDEPEND="
+ net-libs/libesmtp
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )
+"
+RDEPEND="${CDEPEND}
+ !mail-mta/courier
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ !mail-mta/opensmtpd
+"
+DEPEND="${CDEPEND}
+ sys-devel/flex
+"
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS ChangeLog NEWS README TODO sample.esmtprc
+}
+
+pkg_postinst() {
+ elog "A sample esmtprc file has been installed in /usr/share/doc/${P}"
+}
diff --git a/mail-mta/esmtp/esmtp-1.2.ebuild b/mail-mta/esmtp/esmtp-1.2.ebuild
new file mode 100644
index 000000000000..e512a546b22b
--- /dev/null
+++ b/mail-mta/esmtp/esmtp-1.2.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="esmtp is a user configurable relay-only Mail Transfer Agent (MTA) with a sendmail compatible syntax"
+HOMEPAGE="http://esmtp.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~x86-macos"
+IUSE=""
+
+DEPEND="net-libs/libesmtp
+ dev-libs/openssl
+ sys-devel/flex"
+RDEPEND="net-libs/libesmtp
+ dev-libs/openssl
+ !mail-mta/courier
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ !mail-mta/opensmtpd"
+
+src_install() {
+ emake DESTDIR="${D}" install || die "einstall failed"
+ dodoc AUTHORS ChangeLog NEWS README TODO sample.esmtprc || die
+}
+
+pkg_postinst() {
+ elog "A sample esmtprc file has been installed in /usr/share/doc/${P}"
+}
diff --git a/mail-mta/esmtp/metadata.xml b/mail-mta/esmtp/metadata.xml
new file mode 100644
index 000000000000..94a817aff74e
--- /dev/null
+++ b/mail-mta/esmtp/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">esmtp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/exim/Manifest b/mail-mta/exim/Manifest
new file mode 100644
index 000000000000..18f8ee6c587f
--- /dev/null
+++ b/mail-mta/exim/Manifest
@@ -0,0 +1,29 @@
+AUX auth_conf.sub 790 SHA256 d0631d487f115c07a178d48bc7168cd16d7b22c8879b1e926923152cde95ba78 SHA512 c0799a44e0fabdd4eb33c9c4a009c7abed80d5b2ab773206b11d644e54bb79004c5741fc510df77fe9856bdff979a14f1cf9a58da19fb00aaae05c623da287b3 WHIRLPOOL 54a457732851ec3154b38e161728f932e52166e0a3debe3f4672208207eb3070056a473bd6b73977ecda2d8d6c7348cbaf4870ee3d4b3250e64f2da5f58c5153
+AUX exim-4.14-tail.patch 446 SHA256 74d1044bb94e167180fd8f8aba7449ca3d2b09b1ce170a1a2e4e54ca0cd660da SHA512 a0365b15f0a48076f9660ebc424d48f68995ac21bbf77f407bdca5103ca65758d7f2241d0151eb5c78476557e240b24a95c23d3b12cfffc1b34ab6f89f2c2110 WHIRLPOOL c6e7e1d183c7669a745b33643c61b672a2c2800a0f1eeff380afa5cafe6d97a91106a4f08273ed154a87cfc7ee807cef8308422b53092083fcc12030403786a5
+AUX exim-4.20-maildir.patch 478 SHA256 2704c4db67bb7c58c2421656d942f533d1eedf1df187e76297ab72d2c2a2fb4c SHA512 2c6f68e3c162a51e62ce6e391db8e79733f11bba20cc8778737650158203b88f9a77b7bbbd2a32b2cf8ae50f039b794fb0996f198acec6a50b94cad6a111f432 WHIRLPOOL 4cf3638b7c7b05badeebbb65151f5d8e847fe2324ca5f88bcca87b8bf7e01ae290a9deccb26dec6abec89f105d00625efe99874e9ea2edf4a557b3d831c3b9f0
+AUX exim-4.69-r1.27021.patch 1447 SHA256 dc81115be1324cf2d61ff2e2393462bd31aa63551a8b58d9dac39293bec058d5 SHA512 45a5b833c698da4690485716c7c45d762a9194d5ae41514028bbad548bbd44373cf7a3a3c6a1c4f635f3f50d1695ac7ead098bf8be15cd1f691c7cc6c7f8d715 WHIRLPOOL ddf5a97d6d2c7220ebbca8ae5377a2c177c75bbed82a2e356f71582839021fe32eb6001d099fa4fb9c4afd55e7a74249d54997cdf691eb6b6aa44a8f834b1d64
+AUX exim-4.74-localscan_dlopen.patch 9280 SHA256 dcd44f552e9b9b79facc988c9efad3ab1609a4e4209e9276323f49d1ea00e462 SHA512 bfd35b8fcc7b8bd50a28b2bb7865d358ed1af3978b057da1c83a0be38ba30a737d983b6b5cf829559ba8c490709d28bdb7d679eb825fe7e24798ec223bedc94e WHIRLPOOL 7140c45782d8611638f3aecc960f890963b1d34fd1cca7a5b78058a616607d10c1a50d4110498e9c3d700ca04df8797c184ce816bfd1cab8931bd4eb9ef3aa8a
+AUX exim-4.74-radius-db-ENV-clash.patch 667 SHA256 a4150c9b73203dd284faa646a67e39f431d07c6a378af8fabc97a4ad9e078437 SHA512 040bbdb2259df882569a428b7fef03f89c3685428654ac29e93360a4791bdabe66e52d33d14f0822461fac119295bd31aad5998f63d59d4af057bd26b310a568 WHIRLPOOL 3ef9641fc821be5d7477ccc41f8656f987a896e883a7aa3a627b92e64e2663a87f345bd0fc46ae1b4b9f6ac09a560c951c0396dd135305c97821374d8aa08806
+AUX exim-4.76-crosscompile.patch 462 SHA256 25ba013858b0fc239e24166554c1e28832d3d25801b53ca633f289bc4ae72b8e SHA512 d4fd4417c1ce727f139999c399795312cdbbb9735d0793d68f8e3150240bc53b31277cb26f9946ba549b34c661fc0a61147d376bda09aa6763cab55d80d62343 WHIRLPOOL 22026d355888efb2f823842c596fb670f0821076fe6faaae9d0a6ecf57a4a6de52af9f720e784e8d7bbcf681494a020f22e75f4a2aa079d30880f5c9af759405
+AUX exim-4.80-spool-mail-group.patch 946 SHA256 4f013e30f6f96360baa7d5d7818eaf5247984ab0eb43b8b5ba8d1bd8704b811b SHA512 24f30e9a9d90dc0f1fe8b3db26f8bc2649182b4e78110dc28a9c0f3a3feb7589f923144a4f1c54a1c46ff8cfe40826a1f2212787753be752f4d15a72d54a143b WHIRLPOOL aa34f4e721fda796ebeb091514ec35ffcf153e813b7760245d25da5d6f27590734d28032498a0ffb2262e170355b0a99b53947818e669d1f79bd0393ae85a2d6
+AUX exim-4.82-makefile-freebsd.patch 1252 SHA256 c407ea37ff8125f20f535ddb02793d5242a12582b9ab388d2ba956f932af2f3d SHA512 fb440ad3e46b90d4c2e4826841944f4006390ccebee08154a39e46f6854be15edd7d0b028333b41451a0511f886ad3a30cb4b86e7ba8be99f12616a137f09d56 WHIRLPOOL 72132bdce44ba23fb162a5afaed33ea72ef2c917d020f5ddf920ce16991f02411c0bbcb23526b0e09753ab84cf2f258108aa2283ce5f9529810844497df29501
+AUX exim-4.89-CVE-2017-1000369.patch 2043 SHA256 6dc564e94d18a04ed8a31efc4ccb3d6cb183a8ead3b9b7eda558f42b6f7fa038 SHA512 6c4a227bb3a6ba8178cd13c796b10c031c39114749746ac236269b104fb2c22c6388e0a99ca7915ba48203e332714518bd865efd5ec226ffdec9334f882c9a5d WHIRLPOOL 58b08e2fa14f522c62d2265aa950d8b3aebe511b3c77ca915c96d9f051a6aac3136d51d5aeee3a8d13fb49c2c0caecdd724cb95b52126656cfb9345da8279e18
+AUX exim-4.89-address-expando-crash.patch 3655 SHA256 bda3a37c301343f883c7fca19b647e33470986bdcc426335b9d15a502d020dc8 SHA512 79623b920c4447daa607ceee5c6c0b4a178185f2768d2a8d2cd9d23b31714d06b2b5134db654156df66eec57fbf24b2129c32016c4a3800819c7638391e78c05 WHIRLPOOL b69bb88e9f9d44a38aa31a0a582f05fd9d9338fe6fb9d8acaf5966e6496de10630b8e17cabff618bb8b562884f47d3f01e33f782d29f4234514a966896956bfe
+AUX exim-4.89-as-needed-ldflags.patch 6048 SHA256 d162f0c29704f353f1a9bedc90b375fb8e08fff492b414e156b6cd5076102367 SHA512 a0ac891c2708afdf8be339a15e6c74d27a19ac87ab63e97de71b5b5d4fab63b898018f7f0ad1dc2e22a86d71c05c1a1b250d598d7622e6172f187ac36e5c3adf WHIRLPOOL 5a3b6886fc2c932cfdf5da8a0a11b4fcd6bd75ce8feafbb5c60e05b5b994b332c631cb5264a032c247f21c9488eff67335b320684900eb760156a84a7174ca39
+AUX exim-4.89-transport-crash.patch 2416 SHA256 f811f70485adf87c61cb70704237bb90e662d258ca400688934524323464ac4f SHA512 52bd267e748d92ea92ce4944acc8ec7f49e8b1cb74fc473af618fe4fafb68a961ff2b849fc508ff95340ba7bd2851500082a05a54403fa484c9b9a23c0aa787d WHIRLPOOL 553b1bd59709dc28fb11b6b7570dd4bfe609fa6bc024f2fcbcb215412757d801cdb51262ef6916425211e06624da71f9c7304335120d8619bbadd4ea97928d14
+AUX exim-submission.socket 161 SHA256 d3bb58f0fbeaaa33c812a823708664bbcd828da7d24e2a098f84a15aee443fee SHA512 4a233761793e3510e9efa5aad3a6098c41b757f13133a7ea825680f2b393aba8d7935f16bf1dd065dde884fe7ba45639a8d398333a7d9bf0a6b72f88c8f2a09d WHIRLPOOL 7fe2a157ae3361440d8a85c8eca44a97a289be1689261efda943076c9a76ab74ef9d5f01ec0eecdde940ae30ccb46530c95d7223cf62b78e8eb2bde5268288e2
+AUX exim-submission_at.service 360 SHA256 55719e8b823702b0054584326ca28349b7487e5be9e567ddc7a6e6259767e05b SHA512 dc28698f15e8eaa4614ae81fc8cb76d92fed1110ce02f7a6ee8feace418dbb194711eb2d4dd444cf818628c11721e21d80b7b974879ab6ddd78cc717cce17c2f WHIRLPOOL 8e907250dc6be75a252b0a6880004b05fccb2ebeb044a4538bc88eae6ed81f5a537a319188320657d43b3ae1850e11cfa0d86393b038d2d0d1e9a0ce7a7543fc
+AUX exim.confd 141 SHA256 352c48d5302d122d75b821395933150e1fc6e16004b0d28e99a14b60f160ee6e SHA512 cb5e4aa71d3f0b7945e9806064f6a3ab64cb894381654ead40c73a49ae2d1bbb3dc587919952a09b2c81b9fcf8784f73d59c12081cda96a5b7210442f5088998 WHIRLPOOL 078764d27c5c7614120ac0f531b97ac4b65a68ee741fe11fd3ae68e8e89307cc3aaab6d7ee651ec5969479cf9f752933c54faef1e068efa3fda85360343f4d39
+AUX exim.logrotate 116 SHA256 755eab8631ebc103fff111b0c37ff104a34f8fdff349d383d62cd91db3bc0984 SHA512 24bb8dcfadb1204c2ab0316d57de287b5092754731949390cfb3c88fa6827d45acfe1048cf9e26f615ca0449e8d780d0c98ea55ed61be9d1558755d3e53b9ec8 WHIRLPOOL 7c3092e99e20a038fe21f10ada71bae39faa31de6d032b0bd02a373a92b34f3972ab68642cca072364b28d3c0cbe3f35787f137681b8d8093105fb56abd9c7ed
+AUX exim.rc10 1135 SHA256 8fbe1f687414a75c325d2d636431a818546126770efdfe5230f2d672a0f1ff3b SHA512 5c7cee6139145983c62df8f5ef6c401d34d2eb7eae3146c28045129ba40868ca4d3d10d4b7056887cf4d4d8a83271592f7fa0a527663f727fa8694b621eb5624 WHIRLPOOL f7f67d0d411a3ad7f72dae2942529d20cc70dd592f020d95d28d8406264007ed6a335294673dc1d1f0690d805a03420470f3a9446bf1206ca1a0589c929cbd11
+AUX exim.service 229 SHA256 6e5372338d93b75d96bf571d892b167ac812378bcf978dcd3f3324d7e612463a SHA512 a071e9fb74b5fc2fdf0c73ad64ddfbc3954d8f7095d6a363dacf8c75d72a479fbf6821822ec5c8f3846d7687342e1bd447b97f91ca7b0582e5c98008aac30cca WHIRLPOOL 5f2ccd6898c95599f8e801aa111c53dbb50b7ec9f6ba6552fe195ad07d41efdcbff765cba1d696df6acb564bca29830d0bf61bcda9a244a3b48354318914bbd5
+AUX exim.socket 139 SHA256 3e3d8b6be2741d2587a496196c08b3f2ffa05b5803b2bf9fb49359cef3a98d26 SHA512 db621116907ceb573e6f34581f47c91f751bff593054d7ddc32397b34c7f2405bec184bdb0589d2ac457fa3a61bcba072761e3a6293a99c9c764d2d9fd6069ae WHIRLPOOL 6ddceaa1bf31d995afa2dc49ab4d8e1068321ab12b158e075f6ea3f2cc4dff35c2052da2a85fe998813354755e574670086880ef7e42e2a02877d4f766706d3c
+AUX exim_at.service 140 SHA256 faad96dadbb2750faa5652d830f10d5a14be487a42e8db1cec797164acf14b73 SHA512 11c8133ee15b3e5193c9b1c59aed66c81b6e045dd23310bede9fcde6c88905db5ef08afdb798b53b75a7465915ea1247e980edf95db07a7f9b7bb58ce95fbb5a WHIRLPOOL 78f0c825526ae890458c4e71df2bd724d77d508081c6d6c2e3493732f11576ffeed755968dd2f3bcfb1cc6e0b0d61ea9fc175cd71340d908646f1a9ccbc7406e
+DIST exim-4.89.tar.bz2 1844430 SHA256 912f2ee03c8dba06a3a4c0ee40522d367e1b65dc59e38dfcc1f5d9eecff51ab0 SHA512 1e059966a93b47f055ab4ec2a4556f2c918aff56ea0367585f3a853f00411e9c275e13be4f9ae615a468fa06263135cd6a138fa1753f1b7fb3259a3321fcca65 WHIRLPOOL d0b30cde5cf2dbe278d393eae70e40a3861a153a2411f98f73a7ae43881032cc3e0f15163b09e17d61c09e673c2e766371c80533908af3460f483a5c18dff80f
+DIST exim-pdf-4.89.tar.bz2 1924606 SHA256 17d70ef5b2814f725633efcf339bcb49ac9564ecd648e0e3d010b5e43d6c167d SHA512 b04ea2e4dcdb1aaf52ef77ccd76e6599c68c4c6e5a98090720dbd3c50f7191bf3f6cd7dc2089a765c47576311780809cff547f85f004caec411d0f1ac9985299 WHIRLPOOL 4ab5bc7bdbbfc998ae7ee63f19449d051a1d7183f9b70297db100f44b82df2cca0853c309ddfccafee2d44cd1228258e06628ed82dab76de851bec856321c58f
+DIST system_filter.exim.gz 3075 SHA256 3a3471b486a09e0a0153f7b520e1eaf26d21b97d73ea8348bdc593c00eb1e437 SHA512 cb358d3ce2499a0bb5920d962a06f2af8486e55ec90c8c928bd8e3aefb279aa57f5f960d5adfcef68bd94110b405eaa144e9629cfe6014a529c79c544600bbf3 WHIRLPOOL ce68d9c18b24eca3ef97ea810964cc1ada5f85b795a7c432ad39b5788188a16419101c92fb52b418738d760e1d658f7a41485e5561079a667d84d276c71be5a4
+EBUILD exim-4.89-r1.ebuild 12241 SHA256 47b6e8a97d39cc082221d74c7db092b50779f006fc6ec406fcf908020ece8ca9 SHA512 7ff6fa9d2b968a65e4b1e014f4bc1c53d7d1282a45893132aafdbceb403172a02c1455242a266960b4d403db3ca981fffaa8cc82028964e2c72dac8a0da347dc WHIRLPOOL c5cc4a4c4950da958a6b73859c24b50fcbcea05ec5bc5531300d6077c3ca4abebc6709d0533c68bc8e1f819f670d4052304ad8c7ddf0b253962b5d2fa531ebb3
+EBUILD exim-4.89-r3.ebuild 12401 SHA256 92f8ec13452af2d9825ba64b18ff002fd7d348338a8a6c8463942e60986ae1d9 SHA512 4a529526216963f566d5c30ecdfadbfdbeac276d8187b90b8e6aa6be17b6bffda64ae66e9ae7b77ada193812125669d72a524fd9095af58ee2561cfd7df0d76a WHIRLPOOL dbc0014e8225e55dc11503355c90f1879543259e7d409b77382d1ea2c58fc57400283218868d1c880f9202295b69418c2c3f1dd67b539755d512ab43bfdf28f2
+MISC ChangeLog 13030 SHA256 5686d9f0d2be8158ab3c640f0e0d2c15442db59f0dfbffaebb260f1f96e219d8 SHA512 6e0a8aecdee434eb1c7fa9420de9a1ba07ee7b629232c2ba9a03e33adfb75b049656a85fa42e972bec6e1c466f07d0f92ff77599a01ba3893348406898f84093 WHIRLPOOL 79642a92025c6cd8686ec1c0855ad44783a833875e2133a7457c19bb3a4baeb7f117ac5dffba270ef92309caaf3231551906c9817c48fd38e9d3fa744741c504
+MISC ChangeLog-2015 59473 SHA256 0867a4dc55a8e07aa1405df7cf42cb81b69ac23448033497fc1e320a3f495e8e SHA512 9617c4567c0186089802445a8457fc3ccd087285a7075a30e5072a6d53aba47a5820d391f149e9b3dfd9e576848888172a05d1a7073136dd4720fee5a43da289 WHIRLPOOL 14e758c28088f809a6052016e09f3c6e556716ce254d59bdadf1ffed8824d9cd88f435940743193332f3d9a2da6bf4be98d24be04f0602e017ff59c05c85ee28
+MISC metadata.xml 2482 SHA256 ec45d3ec75d244d4e842d76157f927deb78c933d01fabbefd1dc3f3a1666494d SHA512 dcda0d8164098a41d7defa30b84b36bfdc6fc1fecce2dc680aa22341f67be9dad281bdee0b6f9028459b4a62d4f3a83a16bd1cdca99238b114532c7b06f5c25f WHIRLPOOL 5bdfc907c3fe72cfa3846a183737de42315ebee92e168835347a419366049daab2b9ad236bc24889828d96dac8cd6d44711ccbe8de895ec9da909f5ec1c4d72c
diff --git a/mail-mta/exim/exim-4.89-r1.ebuild b/mail-mta/exim/exim-4.89-r1.ebuild
new file mode 100644
index 000000000000..affe15065466
--- /dev/null
+++ b/mail-mta/exim/exim-4.89-r1.ebuild
@@ -0,0 +1,528 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils toolchain-funcs multilib pam systemd
+
+IUSE="dane dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn exiscan-acl gnutls ipv6 ldap libressl lmtp maildir mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl selinux spf sqlite srs ssl syslog tcpd tpda X elibc_glibc"
+REQUIRED_USE="
+ dane? ( !gnutls )
+ dmarc? ( spf dkim )
+ pkcs11? ( gnutls )
+ spf? ( exiscan-acl )
+ srs? ( exiscan-acl )
+"
+
+COMM_URI="ftp://ftp.exim.org/pub/exim/exim4$([[ ${PV} == *_rc* ]] && echo /test)"
+
+DESCRIPTION="A highly configurable, drop-in replacement for sendmail"
+SRC_URI="${COMM_URI}/${P//rc/RC}.tar.bz2
+ mirror://gentoo/system_filter.exim.gz
+ doc? ( ${COMM_URI}/${PN}-pdf-${PV//rc/RC}.tar.bz2 )"
+HOMEPAGE="http://www.exim.org/"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~x86-solaris"
+
+COMMON_DEPEND=">=sys-apps/sed-4.0.5
+ >=sys-libs/db-3.2:=
+ dev-libs/libpcre
+ perl? ( dev-lang/perl:= )
+ pam? ( virtual/pam )
+ tcpd? ( sys-apps/tcp-wrappers )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )
+ )
+ gnutls? ( net-libs/gnutls[pkcs11?]
+ dev-libs/libtasn1 )
+ ldap? ( >=net-nds/openldap-2.0.7 )
+ nis? ( elibc_glibc? ( || (
+ <sys-libs/glibc-2.23
+ >=sys-libs/glibc-2.23[rpc]
+ ) ) )
+ mysql? ( virtual/libmysqlclient )
+ postgres? ( dev-db/postgresql:= )
+ sasl? ( >=dev-libs/cyrus-sasl-2.1.26-r2 )
+ redis? ( dev-libs/hiredis )
+ spf? ( >=mail-filter/libspf2-1.2.5-r1 )
+ dmarc? ( mail-filter/opendmarc )
+ srs? ( mail-filter/libsrs_alt )
+ X? ( x11-proto/xproto
+ x11-libs/libX11
+ x11-libs/libXmu
+ x11-libs/libXt
+ x11-libs/libXaw
+ )
+ sqlite? ( dev-db/sqlite )
+ radius? ( net-dialup/freeradius-client )
+ virtual/libiconv
+ "
+ # added X check for #57206
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+RDEPEND="${COMMON_DEPEND}
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/mini-qmail
+ !<mail-mta/msmtp-1.4.19-r1
+ !>=mail-mta/msmtp-1.4.19-r1[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/mailwrapper
+ >=net-mail/mailbase-0.00-r5
+ virtual/logger
+ dcc? ( mail-filter/dcc )
+ selinux? ( sec-policy/selinux-exim )
+ "
+
+S=${WORKDIR}/${P//rc/RC}
+
+src_prepare() {
+ epatch "${FILESDIR}"/exim-4.14-tail.patch
+ epatch "${FILESDIR}"/exim-4.74-localscan_dlopen.patch
+ epatch "${FILESDIR}"/exim-4.69-r1.27021.patch
+ epatch "${FILESDIR}"/exim-4.74-radius-db-ENV-clash.patch # 287426
+ epatch "${FILESDIR}"/exim-4.82-makefile-freebsd.patch # 235785
+ epatch "${FILESDIR}"/exim-4.89-as-needed-ldflags.patch # 352265, 391279
+ epatch "${FILESDIR}"/exim-4.76-crosscompile.patch # 266591
+ epatch "${FILESDIR}"/exim-4.89-CVE-2017-1000369.patch # 622212
+
+ if use maildir ; then
+ epatch "${FILESDIR}"/exim-4.20-maildir.patch
+ else
+ epatch "${FILESDIR}"/exim-4.80-spool-mail-group.patch # 438606
+ fi
+
+ eapply_user
+
+ # user Exim believes it should be
+ MAILUSER=mail
+ MAILGROUP=mail
+ if use prefix && [[ ${EUID} != 0 ]] ; then
+ MAILUSER=$(id -un)
+ MAILGROUP=$(id -gn)
+ fi
+}
+
+src_configure() {
+ # general config and paths
+
+ sed -i.orig \
+ -e "/SYSTEM_ALIASES_FILE/s'SYSTEM_ALIASES_FILE'${EPREFIX}/etc/mail/aliases'" \
+ "${S}"/src/configure.default || die
+
+ sed -i -e 's/^buildname=.*/buildname=exim-gentoo/g' Makefile || die
+
+ sed -e "48i\CFLAGS=${CFLAGS}" \
+ -e "s:BIN_DIRECTORY=/usr/exim/bin:BIN_DIRECTORY=${EPREFIX}/usr/sbin:" \
+ -e "s:EXIM_USER=:EXIM_USER=${MAILUSER}:" \
+ -e "s:CONFIGURE_FILE=/usr/exim/configure:CONFIGURE_FILE=${EPREFIX}/etc/exim/exim.conf:" \
+ -e "s:ZCAT_COMMAND=.*$:ZCAT_COMMAND=${EPREFIX}/bin/zcat:" \
+ -e "s:COMPRESS_COMMAND=.*$:COMPRESS_COMMAND=${EPREFIX}/bin/gzip:" \
+ src/EDITME > Local/Makefile
+
+ if use elibc_musl; then
+ sed -e 's/^LIBS = -lnsl/LIBS =/g' \
+ -i OS/Makefile-Linux
+ fi
+
+ cd Local
+
+ cat >> Makefile <<- EOC
+ INFO_DIRECTORY=${EPREFIX}/usr/share/info
+ PID_FILE_PATH=${EPREFIX}/run/exim.pid
+ SPOOL_DIRECTORY=${EPREFIX}/var/spool/exim
+ HAVE_ICONV=yes
+ EOC
+
+ # if we use libiconv, now is the time to tell so
+ use !elibc_glibc && use !elibc_musl && echo "EXTRALIBS_EXIM=-liconv" >> Makefile
+
+ # support for IPv6
+ if use ipv6; then
+ cat >> Makefile <<- EOC
+ HAVE_IPV6=YES
+ EOC
+ fi
+
+ #
+ # mail storage formats
+
+ # mailstore is Exim's traditional storage format
+ cat >> Makefile <<- EOC
+ SUPPORT_MAILSTORE=yes
+ EOC
+
+ # mbox
+ if use mbx; then
+ cat >> Makefile <<- EOC
+ SUPPORT_MBX=yes
+ EOC
+ fi
+
+ # maildir
+ if use maildir; then
+ cat >> Makefile <<- EOC
+ SUPPORT_MAILDIR=yes
+ EOC
+ fi
+
+ #
+ # lookup methods
+
+ # use the "native" interfaces to the DBM and CDB libraries, support
+ # passwd and directory lookups by default
+ cat >> Makefile <<- EOC
+ USE_DB=yes
+ DBMLIB=-ldb
+ LOOKUP_CDB=yes
+ LOOKUP_PASSWD=yes
+ LOOKUP_DSEARCH=yes
+ EOC
+
+ if ! use dnsdb; then
+ # DNSDB lookup is enabled by default
+ sed -i "s:^LOOKUP_DNSDB=yes:# LOOKUP_DNSDB=yes:" Makefile
+ fi
+
+ if use ldap; then
+ cat >> Makefile <<- EOC
+ LOOKUP_LDAP=yes
+ LDAP_LIB_TYPE=OPENLDAP2
+ LOOKUP_INCLUDE += -I"${EROOT}"usr/include/ldap
+ LOOKUP_LIBS += -lldap -llber
+ EOC
+ fi
+
+ if use mysql; then
+ cat >> Makefile <<- EOC
+ LOOKUP_MYSQL=yes
+ LOOKUP_INCLUDE += $(mysql_config --include)
+ LOOKUP_LIBS += $(mysql_config --libs)
+ EOC
+ fi
+
+ if use nis; then
+ cat >> Makefile <<- EOC
+ LOOKUP_NIS=yes
+ LOOKUP_NISPLUS=yes
+ EOC
+ fi
+
+ if use postgres; then
+ cat >> Makefile <<- EOC
+ LOOKUP_PGSQL=yes
+ LOOKUP_INCLUDE += -I$(pg_config --includedir)
+ LOOKUP_LIBS += -L$(pg_config --libdir) -lpq
+ EOC
+ fi
+
+ if use sqlite; then
+ cat >> Makefile <<- EOC
+ LOOKUP_SQLITE=yes
+ LOOKUP_SQLITE_PC=sqlite3
+ EOC
+ fi
+
+ if use redis; then
+ cat >> Makefile <<- EOC
+ LOOKUP_REDIS=yes
+ LOOKUP_LIBS += -lhiredis
+ EOC
+ fi
+
+ #
+ # Exim monitor, enabled by default, controlled via X USE-flag,
+ # disable if not requested, bug #46778
+ if use X; then
+ cp ../exim_monitor/EDITME eximon.conf || die
+ else
+ sed -i -e '/^EXIM_MONITOR=/s/^/# /' Makefile
+ fi
+
+ #
+ # features
+
+ # content scanning support
+ if use exiscan-acl; then
+ cat >> Makefile <<- EOC
+ WITH_CONTENT_SCAN=yes
+ WITH_OLD_DEMIME=yes
+ EOC
+ fi
+
+ # DomainKeys Identified Mail, RFC4871
+ if ! use dkim; then
+ # DKIM is enabled by default
+ cat >> Makefile <<- EOC
+ DISABLE_DKIM=yes
+ EOC
+ fi
+
+ # Per-Recipient-Data-Response
+ if ! use prdr; then
+ # PRDR is enabled by default
+ cat >> Makefile <<- EOC
+ DISABLE_PRDR=yes
+ EOC
+ fi
+
+ # log to syslog
+ if use syslog; then
+ sed -i "s:LOG_FILE_PATH=/var/log/exim/exim_%s.log:LOG_FILE_PATH=syslog:" Makefile
+ cat >> Makefile <<- EOC
+ LOG_FILE_PATH=syslog
+ EOC
+ else
+ cat >> Makefile <<- EOC
+ LOG_FILE_PATH=${EPREFIX}/var/log/exim/exim_%s.log
+ EOC
+ fi
+
+ # starttls support (ssl)
+ if use ssl; then
+ echo "SUPPORT_TLS=yes" >> Makefile
+ if use gnutls; then
+ echo "USE_GNUTLS=yes" >> Makefile
+ echo "USE_GNUTLS_PC=gnutls" >> Makefile
+ use pkcs11 || echo "AVOID_GNUTLS_PKCS11=yes" >> Makefile
+ else
+ echo "USE_OPENSSL_PC=openssl" >> Makefile
+ fi
+ fi
+
+ # TCP wrappers
+ if use tcpd; then
+ cat >> Makefile <<- EOC
+ USE_TCP_WRAPPERS=yes
+ EXTRALIBS_EXIM += -lwrap
+ EOC
+ fi
+
+ # Light Mail Transport Protocol
+ if use lmtp; then
+ cat >> Makefile <<- EOC
+ TRANSPORT_LMTP=yes
+ EOC
+ fi
+
+ # embedded Perl
+ if use perl; then
+ cat >> Makefile <<- EOC
+ EXIM_PERL=perl.o
+ EOC
+ fi
+
+ # dlfunc
+ if use dlfunc; then
+ cat >> Makefile <<- EOC
+ EXPAND_DLFUNC=yes
+ EOC
+ fi
+
+ # Proxy Protocol
+ if use proxy; then
+ cat >> Makefile <<- EOC
+ SUPPORT_PROXY=yes
+ EOC
+ fi
+
+ #
+ # experimental features
+
+ # DANE
+ if use dane; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_DANE=yes
+ EOC
+ fi
+
+ # Distributed Checksum Clearinghouse
+ if use dcc; then
+ echo "EXPERIMENTAL_DCC=yes">> Makefile
+ fi
+
+ # Sender Policy Framework
+ if use spf; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_SPF=yes
+ EXTRALIBS_EXIM += -lspf2
+ EOC
+ fi
+
+ # Sender Rewriting Scheme
+ if use srs; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_SRS=yes
+ EXTRALIBS_EXIM += -lsrs_alt
+ EOC
+ fi
+
+ # DMARC
+ if use dmarc; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_DMARC=yes
+ EXTRALIBS_EXIM += -lopendmarc
+ EOC
+ fi
+
+ # Transport post-delivery actions
+ if use tpda; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_EVENT=yes
+ EOC
+ fi
+
+ # Delivery Sender Notifications
+ if use dsn; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_DSN=yes
+ EOC
+ fi
+
+ #
+ # authentication (SMTP AUTH)
+
+ # standard bits
+ cat >> Makefile <<- EOC
+ AUTH_SPA=yes
+ AUTH_CRAM_MD5=yes
+ AUTH_PLAINTEXT=yes
+ EOC
+
+ # Cyrus SASL
+ if use sasl; then
+ cat >> Makefile <<- EOC
+ CYRUS_SASLAUTHD_SOCKET=${EPREFIX}/run/saslauthd/mux
+ AUTH_CYRUS_SASL=yes
+ AUTH_LIBS += -lsasl2
+ EOC
+ fi
+
+ # Dovecot
+ if use dovecot-sasl; then
+ cat >> Makefile <<- EOC
+ AUTH_DOVECOT=yes
+ EOC
+ fi
+
+ # Pluggable Authentication Modules
+ if use pam; then
+ cat >> Makefile <<- EOC
+ SUPPORT_PAM=yes
+ AUTH_LIBS += -lpam
+ EOC
+ fi
+
+ # Radius
+ if use radius; then
+ cat >> Makefile <<- EOC
+ RADIUS_CONFIG_FILE=${EPREFIX}/etc/radiusclient/radiusclient.conf
+ RADIUS_LIB_TYPE=RADIUSCLIENTNEW
+ AUTH_LIBS += -lfreeradius-client
+ EOC
+ fi
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" HOSTCC="$(tc-getCC $CBUILD)" \
+ AR="$(tc-getAR) cq" RANLIB="$(tc-getRANLIB)" FULLECHO='' \
+ || die "make failed"
+}
+
+src_install () {
+ cd "${S}"/build-exim-gentoo || die
+ dosbin exim
+ if use X; then
+ dosbin eximon.bin
+ dosbin eximon
+ fi
+ fperms 4755 /usr/sbin/exim
+
+ dosym exim /usr/sbin/sendmail
+ dosym exim /usr/sbin/rsmtp
+ dosym exim /usr/sbin/rmail
+ dosym /usr/sbin/exim /usr/bin/mailq
+ dosym /usr/sbin/exim /usr/bin/newaliases
+ dosym /usr/sbin/sendmail /usr/lib/sendmail
+
+ for i in exicyclog exim_dbmbuild exim_dumpdb exim_fixdb exim_lock \
+ exim_tidydb exinext exiwhat exigrep eximstats exiqsumm exiqgrep \
+ convert4r3 convert4r4 exipick
+ do
+ dosbin $i
+ done
+
+ dodoc "${S}"/doc/*
+ doman "${S}"/doc/exim.8
+ use dsn && dodoc "${S}"/README.DSN
+ use doc && dodoc "${WORKDIR}"/${PN}-pdf-${PV//rc/RC}/doc/*.pdf
+
+ # conf files
+ insinto /etc/exim
+ newins "${S}"/src/configure.default exim.conf.dist
+ if use exiscan-acl; then
+ newins "${S}"/src/configure.default exim.conf.exiscan-acl
+ fi
+ doins "${WORKDIR}"/system_filter.exim
+ doins "${FILESDIR}"/auth_conf.sub
+
+ pamd_mimic system-auth exim auth account
+
+ # headers, #436406
+ if use dlfunc ; then
+ # fixup includes so they actually can be found when including
+ sed -i \
+ -e '/#include "\(config\|store\|mytypes\).h"/s:"\(.\+\)":<exim/\1>:' \
+ local_scan.h || die
+ insinto /usr/include/exim
+ doins {config,local_scan}.h ../src/{mytypes,store}.h
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/exim.logrotate" exim
+
+ newinitd "${FILESDIR}"/exim.rc10 exim
+ newconfd "${FILESDIR}"/exim.confd exim
+
+ systemd_dounit "${FILESDIR}"/{exim.service,exim.socket,exim-submission.socket}
+ systemd_newunit "${FILESDIR}"/exim_at.service 'exim@.service'
+ systemd_newunit "${FILESDIR}"/exim-submission_at.service 'exim-submission@.service'
+
+ diropts -m 0750 -o ${MAILUSER} -g ${MAILGROUP}
+ dodir /var/log/${PN}
+}
+
+pkg_postinst() {
+ if [[ ! -f ${EROOT}etc/exim/exim.conf ]] ; then
+ einfo "${EROOT}etc/exim/system_filter.exim is a sample system_filter."
+ einfo "${EROOT}etc/exim/auth_conf.sub contains the configuration sub for using smtp auth."
+ einfo "Please create ${EROOT}etc/exim/exim.conf from ${EROOT}etc/exim/exim.conf.dist."
+ fi
+ use dane && einfo "DANE support is experimental"
+ if use dcc ; then
+ einfo "DCC support is experimental, you can find some limited"
+ einfo "documentation at the bottom of this prerelease message:"
+ einfo "http://article.gmane.org/gmane.mail.exim.devel/3579"
+ fi
+ use spf && einfo "SPF support is experimental"
+ use srs && einfo "SRS support is experimental"
+ if use dmarc ; then
+ einfo "DMARC support is experimental. See global settings to"
+ einfo "configure DMARC, for usage see the documentation at "
+ einfo "experimental-spec.txt."
+ fi
+ use tpda && einfo "TPDA/EVENT support is experimental"
+ use dsn && einfo "DSN support is experimental"
+ elog "The obsolete acl condition 'demime' is removed, the replacements"
+ elog "are the ACLs acl_smtp_mime and acl_not_smtp_mime"
+}
diff --git a/mail-mta/exim/exim-4.89-r3.ebuild b/mail-mta/exim/exim-4.89-r3.ebuild
new file mode 100644
index 000000000000..69652375c313
--- /dev/null
+++ b/mail-mta/exim/exim-4.89-r3.ebuild
@@ -0,0 +1,530 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils toolchain-funcs multilib pam systemd
+
+IUSE="dane dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn exiscan-acl gnutls ipv6 ldap libressl lmtp maildir mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl selinux spf sqlite srs ssl syslog tcpd tpda X elibc_glibc"
+REQUIRED_USE="
+ dane? ( !gnutls )
+ dmarc? ( spf dkim )
+ pkcs11? ( gnutls )
+ spf? ( exiscan-acl )
+ srs? ( exiscan-acl )
+"
+
+COMM_URI="ftp://ftp.exim.org/pub/exim/exim4$([[ ${PV} == *_rc* ]] && echo /test)"
+
+DESCRIPTION="A highly configurable, drop-in replacement for sendmail"
+SRC_URI="${COMM_URI}/${P//rc/RC}.tar.bz2
+ mirror://gentoo/system_filter.exim.gz
+ doc? ( ${COMM_URI}/${PN}-pdf-${PV//rc/RC}.tar.bz2 )"
+HOMEPAGE="http://www.exim.org/"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-solaris"
+
+COMMON_DEPEND=">=sys-apps/sed-4.0.5
+ >=sys-libs/db-3.2:=
+ dev-libs/libpcre
+ perl? ( dev-lang/perl:= )
+ pam? ( virtual/pam )
+ tcpd? ( sys-apps/tcp-wrappers )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )
+ )
+ gnutls? ( net-libs/gnutls[pkcs11?]
+ dev-libs/libtasn1 )
+ ldap? ( >=net-nds/openldap-2.0.7 )
+ nis? ( elibc_glibc? ( || (
+ <sys-libs/glibc-2.23
+ >=sys-libs/glibc-2.23[rpc]
+ ) ) )
+ mysql? ( virtual/libmysqlclient )
+ postgres? ( dev-db/postgresql:= )
+ sasl? ( >=dev-libs/cyrus-sasl-2.1.26-r2 )
+ redis? ( dev-libs/hiredis )
+ spf? ( >=mail-filter/libspf2-1.2.5-r1 )
+ dmarc? ( mail-filter/opendmarc )
+ srs? ( mail-filter/libsrs_alt )
+ X? ( x11-proto/xproto
+ x11-libs/libX11
+ x11-libs/libXmu
+ x11-libs/libXt
+ x11-libs/libXaw
+ )
+ sqlite? ( dev-db/sqlite )
+ radius? ( net-dialup/freeradius-client )
+ virtual/libiconv
+ "
+ # added X check for #57206
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+RDEPEND="${COMMON_DEPEND}
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/mini-qmail
+ !<mail-mta/msmtp-1.4.19-r1
+ !>=mail-mta/msmtp-1.4.19-r1[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/mailwrapper
+ >=net-mail/mailbase-0.00-r5
+ virtual/logger
+ dcc? ( mail-filter/dcc )
+ selinux? ( sec-policy/selinux-exim )
+ "
+
+S=${WORKDIR}/${P//rc/RC}
+
+src_prepare() {
+ epatch "${FILESDIR}"/exim-4.14-tail.patch
+ epatch "${FILESDIR}"/exim-4.74-localscan_dlopen.patch
+ epatch "${FILESDIR}"/exim-4.69-r1.27021.patch
+ epatch "${FILESDIR}"/exim-4.74-radius-db-ENV-clash.patch # 287426
+ epatch "${FILESDIR}"/exim-4.82-makefile-freebsd.patch # 235785
+ epatch "${FILESDIR}"/exim-4.89-as-needed-ldflags.patch # 352265, 391279
+ epatch "${FILESDIR}"/exim-4.76-crosscompile.patch # 266591
+ epatch "${FILESDIR}"/exim-4.89-CVE-2017-1000369.patch # 622212
+ epatch "${FILESDIR}"/${P}-transport-crash.patch # from git/in next release
+ epatch "${FILESDIR}"/${P}-address-expando-crash.patch # from git/in next release
+
+ if use maildir ; then
+ epatch "${FILESDIR}"/exim-4.20-maildir.patch
+ else
+ epatch "${FILESDIR}"/exim-4.80-spool-mail-group.patch # 438606
+ fi
+
+ eapply_user
+
+ # user Exim believes it should be
+ MAILUSER=mail
+ MAILGROUP=mail
+ if use prefix && [[ ${EUID} != 0 ]] ; then
+ MAILUSER=$(id -un)
+ MAILGROUP=$(id -gn)
+ fi
+}
+
+src_configure() {
+ # general config and paths
+
+ sed -i.orig \
+ -e "/SYSTEM_ALIASES_FILE/s'SYSTEM_ALIASES_FILE'${EPREFIX}/etc/mail/aliases'" \
+ "${S}"/src/configure.default || die
+
+ sed -i -e 's/^buildname=.*/buildname=exim-gentoo/g' Makefile || die
+
+ sed -e "48i\CFLAGS=${CFLAGS}" \
+ -e "s:BIN_DIRECTORY=/usr/exim/bin:BIN_DIRECTORY=${EPREFIX}/usr/sbin:" \
+ -e "s:EXIM_USER=:EXIM_USER=${MAILUSER}:" \
+ -e "s:CONFIGURE_FILE=/usr/exim/configure:CONFIGURE_FILE=${EPREFIX}/etc/exim/exim.conf:" \
+ -e "s:ZCAT_COMMAND=.*$:ZCAT_COMMAND=${EPREFIX}/bin/zcat:" \
+ -e "s:COMPRESS_COMMAND=.*$:COMPRESS_COMMAND=${EPREFIX}/bin/gzip:" \
+ src/EDITME > Local/Makefile
+
+ if use elibc_musl; then
+ sed -e 's/^LIBS = -lnsl/LIBS =/g' \
+ -i OS/Makefile-Linux
+ fi
+
+ cd Local
+
+ cat >> Makefile <<- EOC
+ INFO_DIRECTORY=${EPREFIX}/usr/share/info
+ PID_FILE_PATH=${EPREFIX}/run/exim.pid
+ SPOOL_DIRECTORY=${EPREFIX}/var/spool/exim
+ HAVE_ICONV=yes
+ EOC
+
+ # if we use libiconv, now is the time to tell so
+ use !elibc_glibc && use !elibc_musl && echo "EXTRALIBS_EXIM=-liconv" >> Makefile
+
+ # support for IPv6
+ if use ipv6; then
+ cat >> Makefile <<- EOC
+ HAVE_IPV6=YES
+ EOC
+ fi
+
+ #
+ # mail storage formats
+
+ # mailstore is Exim's traditional storage format
+ cat >> Makefile <<- EOC
+ SUPPORT_MAILSTORE=yes
+ EOC
+
+ # mbox
+ if use mbx; then
+ cat >> Makefile <<- EOC
+ SUPPORT_MBX=yes
+ EOC
+ fi
+
+ # maildir
+ if use maildir; then
+ cat >> Makefile <<- EOC
+ SUPPORT_MAILDIR=yes
+ EOC
+ fi
+
+ #
+ # lookup methods
+
+ # use the "native" interfaces to the DBM and CDB libraries, support
+ # passwd and directory lookups by default
+ cat >> Makefile <<- EOC
+ USE_DB=yes
+ DBMLIB=-ldb
+ LOOKUP_CDB=yes
+ LOOKUP_PASSWD=yes
+ LOOKUP_DSEARCH=yes
+ EOC
+
+ if ! use dnsdb; then
+ # DNSDB lookup is enabled by default
+ sed -i "s:^LOOKUP_DNSDB=yes:# LOOKUP_DNSDB=yes:" Makefile
+ fi
+
+ if use ldap; then
+ cat >> Makefile <<- EOC
+ LOOKUP_LDAP=yes
+ LDAP_LIB_TYPE=OPENLDAP2
+ LOOKUP_INCLUDE += -I"${EROOT}"usr/include/ldap
+ LOOKUP_LIBS += -lldap -llber
+ EOC
+ fi
+
+ if use mysql; then
+ cat >> Makefile <<- EOC
+ LOOKUP_MYSQL=yes
+ LOOKUP_INCLUDE += $(mysql_config --include)
+ LOOKUP_LIBS += $(mysql_config --libs)
+ EOC
+ fi
+
+ if use nis; then
+ cat >> Makefile <<- EOC
+ LOOKUP_NIS=yes
+ LOOKUP_NISPLUS=yes
+ EOC
+ fi
+
+ if use postgres; then
+ cat >> Makefile <<- EOC
+ LOOKUP_PGSQL=yes
+ LOOKUP_INCLUDE += -I$(pg_config --includedir)
+ LOOKUP_LIBS += -L$(pg_config --libdir) -lpq
+ EOC
+ fi
+
+ if use sqlite; then
+ cat >> Makefile <<- EOC
+ LOOKUP_SQLITE=yes
+ LOOKUP_SQLITE_PC=sqlite3
+ EOC
+ fi
+
+ if use redis; then
+ cat >> Makefile <<- EOC
+ LOOKUP_REDIS=yes
+ LOOKUP_LIBS += -lhiredis
+ EOC
+ fi
+
+ #
+ # Exim monitor, enabled by default, controlled via X USE-flag,
+ # disable if not requested, bug #46778
+ if use X; then
+ cp ../exim_monitor/EDITME eximon.conf || die
+ else
+ sed -i -e '/^EXIM_MONITOR=/s/^/# /' Makefile
+ fi
+
+ #
+ # features
+
+ # content scanning support
+ if use exiscan-acl; then
+ cat >> Makefile <<- EOC
+ WITH_CONTENT_SCAN=yes
+ WITH_OLD_DEMIME=yes
+ EOC
+ fi
+
+ # DomainKeys Identified Mail, RFC4871
+ if ! use dkim; then
+ # DKIM is enabled by default
+ cat >> Makefile <<- EOC
+ DISABLE_DKIM=yes
+ EOC
+ fi
+
+ # Per-Recipient-Data-Response
+ if ! use prdr; then
+ # PRDR is enabled by default
+ cat >> Makefile <<- EOC
+ DISABLE_PRDR=yes
+ EOC
+ fi
+
+ # log to syslog
+ if use syslog; then
+ sed -i "s:LOG_FILE_PATH=/var/log/exim/exim_%s.log:LOG_FILE_PATH=syslog:" Makefile
+ cat >> Makefile <<- EOC
+ LOG_FILE_PATH=syslog
+ EOC
+ else
+ cat >> Makefile <<- EOC
+ LOG_FILE_PATH=${EPREFIX}/var/log/exim/exim_%s.log
+ EOC
+ fi
+
+ # starttls support (ssl)
+ if use ssl; then
+ echo "SUPPORT_TLS=yes" >> Makefile
+ if use gnutls; then
+ echo "USE_GNUTLS=yes" >> Makefile
+ echo "USE_GNUTLS_PC=gnutls" >> Makefile
+ use pkcs11 || echo "AVOID_GNUTLS_PKCS11=yes" >> Makefile
+ else
+ echo "USE_OPENSSL_PC=openssl" >> Makefile
+ fi
+ fi
+
+ # TCP wrappers
+ if use tcpd; then
+ cat >> Makefile <<- EOC
+ USE_TCP_WRAPPERS=yes
+ EXTRALIBS_EXIM += -lwrap
+ EOC
+ fi
+
+ # Light Mail Transport Protocol
+ if use lmtp; then
+ cat >> Makefile <<- EOC
+ TRANSPORT_LMTP=yes
+ EOC
+ fi
+
+ # embedded Perl
+ if use perl; then
+ cat >> Makefile <<- EOC
+ EXIM_PERL=perl.o
+ EOC
+ fi
+
+ # dlfunc
+ if use dlfunc; then
+ cat >> Makefile <<- EOC
+ EXPAND_DLFUNC=yes
+ EOC
+ fi
+
+ # Proxy Protocol
+ if use proxy; then
+ cat >> Makefile <<- EOC
+ SUPPORT_PROXY=yes
+ EOC
+ fi
+
+ #
+ # experimental features
+
+ # DANE
+ if use dane; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_DANE=yes
+ EOC
+ fi
+
+ # Distributed Checksum Clearinghouse
+ if use dcc; then
+ echo "EXPERIMENTAL_DCC=yes">> Makefile
+ fi
+
+ # Sender Policy Framework
+ if use spf; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_SPF=yes
+ EXTRALIBS_EXIM += -lspf2
+ EOC
+ fi
+
+ # Sender Rewriting Scheme
+ if use srs; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_SRS=yes
+ EXTRALIBS_EXIM += -lsrs_alt
+ EOC
+ fi
+
+ # DMARC
+ if use dmarc; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_DMARC=yes
+ EXTRALIBS_EXIM += -lopendmarc
+ EOC
+ fi
+
+ # Transport post-delivery actions
+ if use tpda; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_EVENT=yes
+ EOC
+ fi
+
+ # Delivery Sender Notifications
+ if use dsn; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_DSN=yes
+ EOC
+ fi
+
+ #
+ # authentication (SMTP AUTH)
+
+ # standard bits
+ cat >> Makefile <<- EOC
+ AUTH_SPA=yes
+ AUTH_CRAM_MD5=yes
+ AUTH_PLAINTEXT=yes
+ EOC
+
+ # Cyrus SASL
+ if use sasl; then
+ cat >> Makefile <<- EOC
+ CYRUS_SASLAUTHD_SOCKET=${EPREFIX}/run/saslauthd/mux
+ AUTH_CYRUS_SASL=yes
+ AUTH_LIBS += -lsasl2
+ EOC
+ fi
+
+ # Dovecot
+ if use dovecot-sasl; then
+ cat >> Makefile <<- EOC
+ AUTH_DOVECOT=yes
+ EOC
+ fi
+
+ # Pluggable Authentication Modules
+ if use pam; then
+ cat >> Makefile <<- EOC
+ SUPPORT_PAM=yes
+ AUTH_LIBS += -lpam
+ EOC
+ fi
+
+ # Radius
+ if use radius; then
+ cat >> Makefile <<- EOC
+ RADIUS_CONFIG_FILE=${EPREFIX}/etc/radiusclient/radiusclient.conf
+ RADIUS_LIB_TYPE=RADIUSCLIENTNEW
+ AUTH_LIBS += -lfreeradius-client
+ EOC
+ fi
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" HOSTCC="$(tc-getCC $CBUILD)" \
+ AR="$(tc-getAR) cq" RANLIB="$(tc-getRANLIB)" FULLECHO='' \
+ || die "make failed"
+}
+
+src_install () {
+ cd "${S}"/build-exim-gentoo || die
+ dosbin exim
+ if use X; then
+ dosbin eximon.bin
+ dosbin eximon
+ fi
+ fperms 4755 /usr/sbin/exim
+
+ dosym exim /usr/sbin/sendmail
+ dosym exim /usr/sbin/rsmtp
+ dosym exim /usr/sbin/rmail
+ dosym ../sbin/exim /usr/bin/mailq
+ dosym ../sbin/exim /usr/bin/newaliases
+ dosym ../sbin/sendmail /usr/lib/sendmail
+
+ for i in exicyclog exim_dbmbuild exim_dumpdb exim_fixdb exim_lock \
+ exim_tidydb exinext exiwhat exigrep eximstats exiqsumm exiqgrep \
+ convert4r3 convert4r4 exipick
+ do
+ dosbin $i
+ done
+
+ dodoc "${S}"/doc/*
+ doman "${S}"/doc/exim.8
+ use dsn && dodoc "${S}"/README.DSN
+ use doc && dodoc "${WORKDIR}"/${PN}-pdf-${PV//rc/RC}/doc/*.pdf
+
+ # conf files
+ insinto /etc/exim
+ newins "${S}"/src/configure.default exim.conf.dist
+ if use exiscan-acl; then
+ newins "${S}"/src/configure.default exim.conf.exiscan-acl
+ fi
+ doins "${WORKDIR}"/system_filter.exim
+ doins "${FILESDIR}"/auth_conf.sub
+
+ pamd_mimic system-auth exim auth account
+
+ # headers, #436406
+ if use dlfunc ; then
+ # fixup includes so they actually can be found when including
+ sed -i \
+ -e '/#include "\(config\|store\|mytypes\).h"/s:"\(.\+\)":<exim/\1>:' \
+ local_scan.h || die
+ insinto /usr/include/exim
+ doins {config,local_scan}.h ../src/{mytypes,store}.h
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/exim.logrotate" exim
+
+ newinitd "${FILESDIR}"/exim.rc10 exim
+ newconfd "${FILESDIR}"/exim.confd exim
+
+ systemd_dounit "${FILESDIR}"/{exim.service,exim.socket,exim-submission.socket}
+ systemd_newunit "${FILESDIR}"/exim_at.service 'exim@.service'
+ systemd_newunit "${FILESDIR}"/exim-submission_at.service 'exim-submission@.service'
+
+ diropts -m 0750 -o ${MAILUSER} -g ${MAILGROUP}
+ dodir /var/log/${PN}
+}
+
+pkg_postinst() {
+ if [[ ! -f ${EROOT}etc/exim/exim.conf ]] ; then
+ einfo "${EROOT}etc/exim/system_filter.exim is a sample system_filter."
+ einfo "${EROOT}etc/exim/auth_conf.sub contains the configuration sub for using smtp auth."
+ einfo "Please create ${EROOT}etc/exim/exim.conf from ${EROOT}etc/exim/exim.conf.dist."
+ fi
+ use dane && einfo "DANE support is experimental"
+ if use dcc ; then
+ einfo "DCC support is experimental, you can find some limited"
+ einfo "documentation at the bottom of this prerelease message:"
+ einfo "http://article.gmane.org/gmane.mail.exim.devel/3579"
+ fi
+ use spf && einfo "SPF support is experimental"
+ use srs && einfo "SRS support is experimental"
+ if use dmarc ; then
+ einfo "DMARC support is experimental. See global settings to"
+ einfo "configure DMARC, for usage see the documentation at "
+ einfo "experimental-spec.txt."
+ fi
+ use tpda && einfo "TPDA/EVENT support is experimental"
+ use dsn && einfo "DSN support is experimental"
+ elog "The obsolete acl condition 'demime' is removed, the replacements"
+ elog "are the ACLs acl_smtp_mime and acl_not_smtp_mime"
+}
diff --git a/mail-mta/exim/files/auth_conf.sub b/mail-mta/exim/files/auth_conf.sub
new file mode 100644
index 000000000000..24434a7164a1
--- /dev/null
+++ b/mail-mta/exim/files/auth_conf.sub
@@ -0,0 +1,25 @@
+######################################################################
+# AUTHENTICATION CONFIGURATION #
+######################################################################
+# If you're using PAM to authenticate, lifes real simple.
+# This plain directive works for nearly everything except windows MUA's the
+# login directive will allow you to authenticate your Outlook 2000 and
+# outlook express clients.
+
+
+
+plain:
+ driver = plaintext
+ public_name = PLAIN
+ server_condition = "${if pam{$2:$3}{1}{0}}"
+ server_set_id = $2
+
+login:
+ driver = plaintext
+ public_name = LOGIN
+ server_prompts = "Username:: : Password::"
+ server_condition = "${if pam{$1:${sg{$2}{:}{::}}}{1}{0}}"
+ server_set_id = $1
+#
+# FIXME
+# Need to add authenticator for SPA!!
diff --git a/mail-mta/exim/files/exim-4.14-tail.patch b/mail-mta/exim/files/exim-4.14-tail.patch
new file mode 100644
index 000000000000..481dca9b80d4
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.14-tail.patch
@@ -0,0 +1,11 @@
+--- scripts/Configure-config.h.orig 2003-07-17 18:01:19.000000000 -0400
++++ scripts/Configure-config.h 2003-07-17 18:01:25.000000000 -0400
+@@ -41,7 +41,7 @@
+
+ # Double-check that config.h is complete.
+
+-if [ "`tail -1 config.h`" != "/* End of config.h */" ] ; then
++if [ "`tail -n 1 config.h`" != "/* End of config.h */" ] ; then
+ echo "*** config.h appears to be incomplete"
+ echo "*** unexpected failure in buildconfig program"
+ exit 1
diff --git a/mail-mta/exim/files/exim-4.20-maildir.patch b/mail-mta/exim/files/exim-4.20-maildir.patch
new file mode 100644
index 000000000000..3cb198d545c1
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.20-maildir.patch
@@ -0,0 +1,14 @@
+diff -urN ./exim-4.20.orig/src/configure.default exim-4.20/src/configure.default
+--- ./exim-4.20.orig/src/configure.default 2003-06-27 16:48:22.000000000 -0700
++++ exim-4.20/src/configure.default 2003-06-27 16:52:20.000000000 -0700
+@@ -451,7 +451,9 @@
+
+ local_delivery:
+ driver = appendfile
+- file = /var/mail/$local_part
++# file = /var/mail/$local_part
++ directory = /home/$local_part/.maildir
++ maildir_format
+ delivery_date_add
+ envelope_to_add
+ return_path_add
diff --git a/mail-mta/exim/files/exim-4.69-r1.27021.patch b/mail-mta/exim/files/exim-4.69-r1.27021.patch
new file mode 100644
index 000000000000..804e16d6acde
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.69-r1.27021.patch
@@ -0,0 +1,48 @@
+diff -urN exim-4.69.orig/src/configure.default exim-4.69/src/configure.default
+--- exim-4.69.orig/src/configure.default 2008-05-05 10:17:44.000000000 +0100
++++ exim-4.69/src/configure.default 2008-05-05 10:18:26.000000000 +0100
+@@ -592,6 +592,22 @@
+ pipe_transport = address_pipe
+ reply_transport = address_reply
+
++# This router runs procmail if users have a .procmailrc file
++procmail:
++ check_local_user
++ driver = accept
++ transport = procmail_pipe
++ require_files = ${local_part}:+${home}:+${home}/.procmailrc:+/usr/bin/procmail
++ no_verify
++
++# This router runs maildrop if users have a .mailfilter file
++maildrop:
++ check_local_user
++ driver = accept
++ transport = maildrop_pipe
++ require_files = ${local_part}:+${home}:+${home}/.mailfilter:+/usr/bin/maildrop
++ no_verify
++
+
+ # This router matches local user mailboxes. If the router fails, the error
+ # message is "Unknown user".
+@@ -676,6 +692,21 @@
+ address_reply:
+ driver = autoreply
+
++# This transport is used for procmail
++procmail_pipe:
++ driver = pipe
++ command = "/usr/bin/procmail -d ${local_part}"
++ return_path_add
++ delivery_date_add
++ envelope_to_add
++
++# This transport is used for courier-maildrop filtering (Maildir filter system)
++maildrop_pipe:
++ driver = pipe
++ command = "/usr/bin/maildrop -d ${local_part}"
++ return_path_add
++ delivery_date_add
++ envelope_to_add
+
+
+ ######################################################################
diff --git a/mail-mta/exim/files/exim-4.74-localscan_dlopen.patch b/mail-mta/exim/files/exim-4.74-localscan_dlopen.patch
new file mode 100644
index 000000000000..3bb57c1637c6
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.74-localscan_dlopen.patch
@@ -0,0 +1,262 @@
+diff -Naur exim-4.32/src/EDITME exim-4.32-dlopen/src/EDITME
+--- src/EDITME 2004-04-15 08:27:01.000000000 +0000
++++ src/EDITME 2004-05-06 16:15:47.000000000 +0000
+@@ -505,6 +505,24 @@
+
+
+ #------------------------------------------------------------------------------
++# On systems which support dynamic loading of shared libraries, Exim can
++# load a local_scan function specified in its config file instead of having
++# to be recompiled with the desired local_scan function. For a full
++# description of the API to this function, see the Exim specification.
++
++DLOPEN_LOCAL_SCAN=yes
++
++# If you set DLOPEN_LOCAL_SCAN, then you need to include -rdynamic in the
++# linker flags. Without it, the loaded .so won't be able to access any
++# functions from exim.
++
++LFLAGS = -rdynamic
++ifeq ($(OSTYPE),Linux)
++LFLAGS += -ldl
++endif
++
++
++#------------------------------------------------------------------------------
+ # The default distribution of Exim contains only the plain text form of the
+ # documentation. Other forms are available separately. If you want to install
+ # the documentation in "info" format, first fetch the Texinfo documentation
+diff -Naur exim-4.32/src/config.h.defaults exim-4.32-dlopen/src/config.h.defaults
+--- src/config.h.defaults 2004-04-15 08:27:01.000000000 +0000
++++ src/config.h.defaults 2004-05-06 16:16:30.000000000 +0000
+@@ -20,6 +20,8 @@
+ #define AUTH_PLAINTEXT
+ #define AUTH_SPA
+
++#define DLOPEN_LOCAL_SCAN
++
+ #define BIN_DIRECTORY
+
+ #define CONFIGURE_FILE
+diff -Naur exim-4.32/src/globals.c exim-4.32-dlopen/src/globals.c
+--- src/globals.c 2004-04-15 08:27:01.000000000 +0000
++++ src/globals.c 2004-05-06 16:17:07.000000000 +0000
+@@ -109,6 +109,10 @@
+ uschar *tls_verify_hosts = NULL;
+ #endif
+
++#ifdef DLOPEN_LOCAL_SCAN
++uschar *local_scan_path = NULL;
++#endif
++
+
+ /* Input-reading functions for messages, so we can use special ones for
+ incoming TCP/IP. The defaults use stdin. We never need these for any
+diff -Naur exim-4.32/src/globals.h exim-4.32-dlopen/src/globals.h
+--- src/globals.h 2004-04-15 08:27:01.000000000 +0000
++++ src/globals.h 2004-05-06 16:17:50.000000000 +0000
+@@ -73,6 +73,9 @@
+ extern uschar *tls_verify_hosts; /* Mandatory client verification */
+ #endif
+
++#ifdef DLOPEN_LOCAL_SCAN
++extern uschar *local_scan_path; /* Path to local_scan() library */
++#endif
+
+ /* Input-reading functions for messages, so we can use special ones for
+ incoming TCP/IP. */
+diff -Naur exim-4.32/src/local_scan.c exim-4.32-dlopen/src/local_scan.c
+--- src/local_scan.c 2004-04-15 08:27:01.000000000 +0000
++++ src/local_scan.c 2004-05-06 16:21:57.000000000 +0000
+@@ -5,60 +5,131 @@
+ /* Copyright (c) University of Cambridge 1995 - 2004 */
+ /* See the file NOTICE for conditions of use and distribution. */
+
++#include "exim.h"
+
+-/******************************************************************************
+-This file contains a template local_scan() function that just returns ACCEPT.
+-If you want to implement your own version, you should copy this file to, say
+-Local/local_scan.c, and edit the copy. To use your version instead of the
+-default, you must set
+-
+-LOCAL_SCAN_SOURCE=Local/local_scan.c
+-
+-in your Local/Makefile. This makes it easy to copy your version for use with
+-subsequent Exim releases.
+-
+-For a full description of the API to this function, see the Exim specification.
+-******************************************************************************/
+-
+-
+-/* This is the only Exim header that you should include. The effect of
+-including any other Exim header is not defined, and may change from release to
+-release. Use only the documented interface! */
+-
+-#include "local_scan.h"
+-
+-
+-/* This is a "do-nothing" version of a local_scan() function. The arguments
+-are:
+-
+- fd The file descriptor of the open -D file, which contains the
+- body of the message. The file is open for reading and
+- writing, but modifying it is dangerous and not recommended.
+-
+- return_text A pointer to an unsigned char* variable which you can set in
+- order to return a text string. It is initialized to NULL.
+-
+-The return values of this function are:
+-
+- LOCAL_SCAN_ACCEPT
+- The message is to be accepted. The return_text argument is
+- saved in $local_scan_data.
+-
+- LOCAL_SCAN_REJECT
+- The message is to be rejected. The returned text is used
+- in the rejection message.
+-
+- LOCAL_SCAN_TEMPREJECT
+- This specifies a temporary rejection. The returned text
+- is used in the rejection message.
+-*/
++#ifdef DLOPEN_LOCAL_SCAN
++#include <dlfcn.h>
++static int (*local_scan_fn)(int fd, uschar **return_text) = NULL;
++static int load_local_scan_library(void);
++#endif
+
+ int
+ local_scan(int fd, uschar **return_text)
+ {
+ fd = fd; /* Keep picky compilers happy */
+ return_text = return_text;
+-return LOCAL_SCAN_ACCEPT;
++#ifdef DLOPEN_LOCAL_SCAN
++/* local_scan_path is defined AND not the empty string */
++if (local_scan_path && *local_scan_path)
++ {
++ if (!local_scan_fn)
++ {
++ if (!load_local_scan_library())
++ {
++ char *base_msg , *error_msg , *final_msg ;
++ int final_length = -1 ;
++
++ base_msg=US"Local configuration error - local_scan() library failure\n";
++ error_msg = dlerror() ;
++
++ final_length = strlen(base_msg) + strlen(error_msg) + 1 ;
++ final_msg = (char*)malloc( final_length*sizeof(char) ) ;
++ *final_msg = '\0' ;
++
++ strcat( final_msg , base_msg ) ;
++ strcat( final_msg , error_msg ) ;
++
++ *return_text = final_msg ;
++ return LOCAL_SCAN_TEMPREJECT;
++ }
++ }
++ return local_scan_fn(fd, return_text);
++ }
++else
++#endif
++ return LOCAL_SCAN_ACCEPT;
++}
++
++#ifdef DLOPEN_LOCAL_SCAN
++
++static int load_local_scan_library(void)
++{
++/* No point in keeping local_scan_lib since we'll never dlclose() anyway */
++void *local_scan_lib = NULL;
++int (*local_scan_version_fn)(void);
++int vers_maj;
++int vers_min;
++
++local_scan_lib = dlopen(local_scan_path, RTLD_NOW);
++if (!local_scan_lib)
++ {
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library open failed - "
++ "message temporarily rejected");
++ return FALSE;
++ }
++
++local_scan_version_fn = dlsym(local_scan_lib, "local_scan_version_major");
++if (!local_scan_version_fn)
++ {
++ dlclose(local_scan_lib);
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain "
++ "local_scan_version_major() function - message temporarily rejected");
++ return FALSE;
++ }
++
++/* The major number is increased when the ABI is changed in a non
++ backward compatible way. */
++vers_maj = local_scan_version_fn();
++
++local_scan_version_fn = dlsym(local_scan_lib, "local_scan_version_minor");
++if (!local_scan_version_fn)
++ {
++ dlclose(local_scan_lib);
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain "
++ "local_scan_version_minor() function - message temporarily rejected");
++ return FALSE;
++ }
++
++/* The minor number is increased each time a new feature is added (in a
++ way that doesn't break backward compatibility) -- Marc */
++vers_min = local_scan_version_fn();
++
++
++if (vers_maj != LOCAL_SCAN_ABI_VERSION_MAJOR)
++ {
++ dlclose(local_scan_lib);
++ local_scan_lib = NULL;
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() has an incompatible major"
++ "version number, you need to recompile your module for this version"
++ "of exim (The module was compiled for version %d.%d and this exim provides"
++ "ABI version %d.%d)", vers_maj, vers_min, LOCAL_SCAN_ABI_VERSION_MAJOR,
++ LOCAL_SCAN_ABI_VERSION_MINOR);
++ return FALSE;
++ }
++else if (vers_min > LOCAL_SCAN_ABI_VERSION_MINOR)
++ {
++ dlclose(local_scan_lib);
++ local_scan_lib = NULL;
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() has an incompatible minor"
++ "version number, you need to recompile your module for this version"
++ "of exim (The module was compiled for version %d.%d and this exim provides"
++ "ABI version %d.%d)", vers_maj, vers_min, LOCAL_SCAN_ABI_VERSION_MAJOR,
++ LOCAL_SCAN_ABI_VERSION_MINOR);
++ return FALSE;
++ }
++
++local_scan_fn = dlsym(local_scan_lib, "local_scan");
++if (!local_scan_fn)
++ {
++ dlclose(local_scan_lib);
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain "
++ "local_scan() function - message temporarily rejected");
++ return FALSE;
++ }
++
++return TRUE;
+ }
+
++#endif /* DLOPEN_LOCAL_SCAN */
++
+ /* End of local_scan.c */
+diff -Naur exim-4.32/src/readconf.c exim-4.32-dlopen/src/readconf.c
+--- src/readconf.c 2004-04-15 08:27:01.000000000 +0000
++++ src/readconf.c 2004-05-06 16:23:12.000000000 +0000
+@@ -223,6 +223,9 @@
+ { "local_from_prefix", opt_stringptr, &local_from_prefix },
+ { "local_from_suffix", opt_stringptr, &local_from_suffix },
+ { "local_interfaces", opt_stringptr, &local_interfaces },
++#ifdef DLOPEN_LOCAL_SCAN
++ { "local_scan_path", opt_stringptr, &local_scan_path },
++#endif
+ { "local_scan_timeout", opt_time, &local_scan_timeout },
+ { "local_sender_retain", opt_bool, &local_sender_retain },
+ { "localhost_number", opt_stringptr, &host_number_string },
diff --git a/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch b/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch
new file mode 100644
index 000000000000..247668ef3da3
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch
@@ -0,0 +1,22 @@
+Nasty workaround for
+http://bugs.gentoo.org/show_bug.cgi?id=287426
+
+--- src/auths/call_radius.c
++++ src/auths/call_radius.c
+@@ -10,6 +10,16 @@
+ /* This file was originally supplied by Ian Kirk. The libradius support came
+ from Alex Kiernan. */
+
++/* ugly hack to work around redefinition of ENV by radiusclient.h and
++ * db.h: define _DB_H_ so the db.h include thinks it's already included,
++ * we can get away with it like this, since this file doesn't use any db
++ * functions. */
++#ifndef _DB_H_
++#define _DB_H_ 1
++#define _DB_EXT_PROT_IN_ 1
++#define DB void
++#endif
++
+ #include "../exim.h"
+
+ /* This module contains functions that call the Radius authentication
diff --git a/mail-mta/exim/files/exim-4.76-crosscompile.patch b/mail-mta/exim/files/exim-4.76-crosscompile.patch
new file mode 100644
index 000000000000..cf47adee6265
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.76-crosscompile.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/show_bug.cgi?id=266591
+
+--- OS/Makefile-Base
++++ OS/Makefile-Base
+@@ -114,8 +114,8 @@
+
+ # Targets for special-purpose configuration header builders
+ buildconfig: buildconfig.c
+- @echo "$(CC) buildconfig.c"
+- $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
++ @echo "$(HOSTCC) buildconfig.c"
++ $(FE)$(HOSTCC) $(HOSTCFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
+
+
+ # Target for the exicyclog utility script
diff --git a/mail-mta/exim/files/exim-4.80-spool-mail-group.patch b/mail-mta/exim/files/exim-4.80-spool-mail-group.patch
new file mode 100644
index 000000000000..6f88d8533e8b
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.80-spool-mail-group.patch
@@ -0,0 +1,27 @@
+Change default such that we run on a stock Gentoo system. Bug #438606
+
+--- src/configure.default
++++ src/configure.default
+@@ -674,8 +674,9 @@
+ # BSD mailbox format. By default it will be run under the uid and gid of the
+ # local user, and requires the sticky bit to be set on the /var/mail directory.
+ # Some systems use the alternative approach of running mail deliveries under a
+-# particular group instead of using the sticky bit. The commented options below
+-# show how this can be done.
++# particular group instead of using the sticky bit. This is also the
++# default case on Gentoo, therefore group and mode are set below.
++# Comment them out, to get the default behaviour.
+
+ local_delivery:
+ driver = appendfile
+@@ -683,8 +684,8 @@
+ delivery_date_add
+ envelope_to_add
+ return_path_add
+-# group = mail
+-# mode = 0660
++ group = mail
++ mode = 0660
+
+
+ # This transport is used for handling pipe deliveries generated by alias or
diff --git a/mail-mta/exim/files/exim-4.82-makefile-freebsd.patch b/mail-mta/exim/files/exim-4.82-makefile-freebsd.patch
new file mode 100644
index 000000000000..9693d4945ad9
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.82-makefile-freebsd.patch
@@ -0,0 +1,45 @@
+--- OS/Makefile-FreeBSD.orig 2013-09-30 19:59:09.000000000 +0200
++++ OS/Makefile-FreeBSD 2013-09-30 20:01:22.000000000 +0200
+@@ -1,10 +1,8 @@
+-# Exim: OS-specific make file for FreeBSD
+-# There's no setting of CFLAGS here, to allow the system default
+-# for "make" to be the default.
+-
+-CHOWN_COMMAND=/usr/sbin/chown
+-STRIP_COMMAND=/usr/bin/strip
+-CHMOD_COMMAND=/bin/chmod
++# Exim: OS-specific FreeBSD make file, modified for Gentoo Prefix
++
++CHOWN_COMMAND=look_for_it
++STRIP_COMMAND=
++CHMOD_COMMAND=look_for_it
+
+ HAVE_SA_LEN=YES
+
+@@ -15,17 +13,9 @@
+ CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
+
+ # FreeBSD always ships with Berkeley DB
++DBMLIB = -ldb
+ USE_DB=yes
+
+-# This code for building outside ports suggested by Richard Clayton
+-.ifdef X11BASE
+-X11=${X11BASE}
+-.elifdef LOCALBASE
+-X11=$(LOCALBASE)
+-.else
+-X11=/usr/local
+-.endif
+-
+ # nb: FreeBSD is entirely elf; objformat was removed prior to FreeBSD 7
+ # http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/objformat/Attic/objformat.c
+ # deleted Jan 2007.
+@@ -37,6 +27,7 @@
+ # switch to default to ELF came with FreeBSD 3. elf(5) claims ELF support
+ # introduced in FreeBSD 2.2.6.
+ #
++X11=/usr/X11R6
+ XINCLUDE=-I$(X11)/include
+ XLFLAGS=-L$(X11)/lib -Wl,-rpath,${X11}/lib
+ X11_LD_LIB=$(X11)/lib
diff --git a/mail-mta/exim/files/exim-4.89-CVE-2017-1000369.patch b/mail-mta/exim/files/exim-4.89-CVE-2017-1000369.patch
new file mode 100644
index 000000000000..c3d976a2b907
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.89-CVE-2017-1000369.patch
@@ -0,0 +1,58 @@
+CVE-2017-1000369
+
+https://github.com/Exim/exim/commit/65e061b76867a9ea7aeeb535341b790b90ae6c21
+
+--- a/doc/exim.8
++++ b/doc/exim.8
+@@ -1350,7 +1350,7 @@ option sets the received protocol value that is stored in
+ or \fB\-bs\fP is used. For \fB\-bh\fP, the protocol is forced to one of the standard
+ SMTP protocol names. For \fB\-bs\fP, the protocol is always "local\-" followed by
+ one of those same names. For \fB\-bS\fP (batched SMTP) however, the protocol can
+-be set by \fB\-oMr\fP.
++be set by \fB\-oMr\fP. Repeated use of this option is not supported.
+ .TP 10
+ \fB\-oMs\fP <\fIhost name\fP>
+ See \fB\-oMa\fP above for general remarks about the \fB\-oM\fP options. The \fB\-oMs\fP
+@@ -1418,6 +1418,7 @@ host name and its colon can be omitted when only the protocol is to be set.
+ Note the Exim already has two private options, \fB\-pd\fP and \fB\-ps\fP, that refer
+ to embedded Perl. It is therefore impossible to set a protocol value of d
+ or s using this option (but that does not seem a real limitation).
++Repeated use of this option is not supported.
+ .TP 10
+ \fB\-q\fP
+ This option is normally restricted to admin users. However, there is a
+--- a/src/exim.c
++++ b/src/exim.c
+@@ -3092,7 +3092,14 @@ for (i = 1; i < argc; i++)
+
+ /* -oMr: Received protocol */
+
+- else if (Ustrcmp(argrest, "Mr") == 0) received_protocol = argv[++i];
++ else if (Ustrcmp(argrest, "Mr") == 0)
++
++ if (received_protocol)
++ {
++ fprintf(stderr, "received_protocol is set already\n");
++ exit(EXIT_FAILURE);
++ }
++ else received_protocol = argv[++i];
+
+ /* -oMs: Set sender host name */
+
+@@ -3188,7 +3195,15 @@ for (i = 1; i < argc; i++)
+
+ if (*argrest != 0)
+ {
+- uschar *hn = Ustrchr(argrest, ':');
++ uschar *hn;
++
++ if (received_protocol)
++ {
++ fprintf(stderr, "received_protocol is set already\n");
++ exit(EXIT_FAILURE);
++ }
++
++ hn = Ustrchr(argrest, ':');
+ if (hn == NULL)
+ {
+ received_protocol = argrest;
diff --git a/mail-mta/exim/files/exim-4.89-address-expando-crash.patch b/mail-mta/exim/files/exim-4.89-address-expando-crash.patch
new file mode 100644
index 000000000000..2a868490a426
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.89-address-expando-crash.patch
@@ -0,0 +1,85 @@
+ignoring parts which don't match due to repo reorg post release
+
+From 1b7cf216d933b395dee691f05becca4dd44b26f7 Mon Sep 17 00:00:00 2001
+From: "Heiko Schlittermann (HS12-RIPE)" <hs@schlittermann.de>
+Date: Wed, 4 Oct 2017 22:25:45 +0200
+Subject: [PATCH] Check for proper output separator in expanding
+ ${addresses:STRING} (Closes 2171)
+
+Better yet would be to force setting the output separator literally,
+and not after expansion of the STRING. But this would be an incompatible
+change.
+---
+ doc/doc-docbook/spec.xfpt | 10 +++++++++-
+ src/src/expand.c | 8 +++++++-
+ test/scripts/0000-Basic/0002 | 1 +
+ test/stdout/0002 | 1 +
+ 4 files changed, 18 insertions(+), 2 deletions(-)
+
+ignored - diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
+ignored - index 4a8e1d0..c140945 100644
+ignored - --- a/doc/doc-docbook/spec.xfpt
+ignored - +++ b/doc/doc-docbook/spec.xfpt
+ignored - @@ -10118,7 +10118,15 @@ character. For example:
+ignored - .code
+ignored - ${addresses:>& Chief <ceo@up.stairs>, sec@base.ment (dogsbody)}
+ignored - .endd
+ignored - -expands to &`ceo@up.stairs&&sec@base.ment`&. Compare the &*address*& (singular)
+ignored - +expands to &`ceo@up.stairs&&sec@base.ment`&. The string is expanded
+ignored - +first, so if the expanded string starts with >, it may change the output
+ignored - +separator unintentionally. This can be avoided by setting the output
+ignored - +separator explicitly:
+ignored - +.code
+ignored - +${addresses:>:$h_from:}
+ignored - +.endd
+ignored - +
+ignored - +Compare the &*address*& (singular)
+ignored - expansion item, which extracts the working address from a single RFC2822
+ignored - address. See the &*filter*&, &*map*&, and &*reduce*& items for ways of
+ignored - processing lists.
+diff --git a/src/src/expand.c b/src/src/expand.c
+index 353b8ea..67b3d65 100644
+--- a/src/src/expand.c
++++ b/src/src/expand.c
+@@ -6797,7 +6797,13 @@ while (*s != 0)
+ int start, end, domain; /* Not really used */
+
+ while (isspace(*sub)) sub++;
+- if (*sub == '>') { *outsep = *++sub; ++sub; }
++ if (*sub == '>')
++ if (*outsep = *++sub) ++sub;
++ else {
++ expand_string_message = string_sprintf("output separator "
++ "missing in expanding ${addresses:%s}", --sub);
++ goto EXPAND_FAILED;
++ }
+ parse_allow_group = TRUE;
+
+ for (;;)
+ignored - diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002
+ignored - index cb0bb18..dd9cea2 100644
+ignored - --- a/test/scripts/0000-Basic/0002
+ignored - +++ b/test/scripts/0000-Basic/0002
+ignored - @@ -133,6 +133,7 @@ addresses: ${addresses:>+ Exim Person <local-part@dom.ain> (that's me),\
+ignored - addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me), \
+ignored - xyz@abc, nullgroupname:;, group: p@q, r@s; }
+ignored - addresses: ${addresses:local-part@dom.ain <local-part@dom.ain>}
+ignored - +addresses: ${addresses:>}
+ignored -
+ignored - escape: ${escape:B7·F2ò}
+ignored - excape8bit: ${escape8bit:undisturbed text\ttab\nnewline\ttab\\backslash \176tilde\177DEL\200\x81.}
+ignored - diff --git a/test/stdout/0002 b/test/stdout/0002
+ignored - index 5593f06..1422289 100644
+ignored - --- a/test/stdout/0002
+ignored - +++ b/test/stdout/0002
+ignored - @@ -123,6 +123,7 @@
+ignored - > addresses: local-part@dom.ain+xyz@abc
+ignored - > addresses: local-part@dom.ain:xyz@abc:p@q:r@s
+ignored - > addresses:
+ignored - +> Failed: output separator missing in expanding ${addresses:>}
+ignored - >
+ignored - > escape: B7\267F2\362
+ignored - > excape8bit: undisturbed text tab
+--
+1.9.1
+
diff --git a/mail-mta/exim/files/exim-4.89-as-needed-ldflags.patch b/mail-mta/exim/files/exim-4.89-as-needed-ldflags.patch
new file mode 100644
index 000000000000..49e430939fcd
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.89-as-needed-ldflags.patch
@@ -0,0 +1,145 @@
+https://bugs.gentoo.org/show_bug.cgi?id=352265
+
+Make sure LDFLAGS comes first, such that all libraries are considered,
+and not discarded when --as-needed is in effect.
+
+https://bugs.gentoo.org/show_bug.cgi?id=391279
+
+Use LDFLAGS for all targets, not just the exim binary, such that
+--as-needed works as well.
+
+
+--- OS/Makefile-Base
++++ OS/Makefile-Base
+@@ -346,12 +346,12 @@
+ buildrouters buildtransports \
+ $(OBJ_EXIM) version.o
+ @echo "$(LNCC) -o exim"
+- $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
++ $(FE)$(PURIFY) $(LNCC) -o exim $(LDFLAGS) $(OBJ_EXIM) version.o \
+ routers/routers.a transports/transports.a lookups/lookups.a \
+ auths/auths.a pdkim/pdkim.a \
+ $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
+ $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
+- $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
++ $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim; \
+ $(STRIP_COMMAND) exim; \
+@@ -367,8 +367,8 @@
+
+ exim_dumpdb: $(OBJ_DUMPDB)
+ @echo "$(LNCC) -o exim_dumpdb"
+- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
+- $(LIBS) $(EXTRALIBS) $(DBMLIB)
++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LDFLAGS) $(OBJ_DUMPDB) \
++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_dumpdb; \
+ $(STRIP_COMMAND) exim_dumpdb; \
+@@ -382,8 +382,8 @@
+
+ exim_fixdb: $(OBJ_FIXDB) buildauths
+ @echo "$(LNCC) -o exim_fixdb"
+- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
+- auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LDFLAGS) $(OBJ_FIXDB) \
++ auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_fixdb; \
+ $(STRIP_COMMAND) exim_fixdb; \
+@@ -397,8 +397,8 @@
+
+ exim_tidydb: $(OBJ_TIDYDB)
+ @echo "$(LNCC) -o exim_tidydb"
+- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
+- $(LIBS) $(EXTRALIBS) $(DBMLIB)
++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LDFLAGS) $(OBJ_TIDYDB) \
++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_tidydb; \
+ $(STRIP_COMMAND) exim_tidydb; \
+@@ -410,8 +410,8 @@
+
+ exim_dbmbuild: exim_dbmbuild.o
+ @echo "$(LNCC) -o exim_dbmbuild"
+- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
+- $(LIBS) $(EXTRALIBS) $(DBMLIB)
++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LDFLAGS) exim_dbmbuild.o \
++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_dbmbuild; \
+ $(STRIP_COMMAND) exim_dbmbuild; \
+@@ -425,8 +425,8 @@
+ @echo "$(CC) exim_lock.c"
+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
+ @echo "$(LNCC) -o exim_lock"
+- $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
+- $(LIBS) $(EXTRALIBS)
++ $(FE)$(LNCC) -o exim_lock $(LDFLAGS) exim_lock.o \
++ $(LIBS) $(EXTRALIBS) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_lock; \
+ $(STRIP_COMMAND) exim_lock; \
+@@ -462,9 +462,9 @@
+ $(FE)$(CC) -o em_version.o -c \
+ $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
+ @echo "$(LNCC) -o eximon.bin"
+- $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
++ $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LDFLAGS) $(XLFLAGS) \
+ $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
+- $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
++ $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) eximon.bin; \
+ $(STRIP_COMMAND) eximon.bin; \
+@@ -780,9 +780,9 @@
+ string.o tod.o version.o utf8.o
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
+- $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
++ $(LNCC) -o test_dbfn $(LDFLAGS) dbfn.o \
+ dummies.o sa-globals.o sa-os.o store.o string.o \
+- tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
++ tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LFLAGS)
+ rm -f dbfn.o store.o
+
+ test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
+@@ -790,29 +790,29 @@
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
+- $(LNCC) -o test_host $(LFLAGS) \
++ $(LNCC) -o test_host $(LDFLAGS) \
+ host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
+- tod.o tree.o $(LIBS) $(LIBRESOLV)
++ tod.o tree.o $(LIBS) $(LIBRESOLV) $(LFLAGS)
+ rm -f child.o dummies.o host.o dns.o
+
+ test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
+- $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
+- sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
++ $(LNCC) -o test_os $(LDFLAGS) os.o dummies.o \
++ sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LFLAGS)
+ rm -f os.o
+
+ test_parse: config.h parse.c dummies.o sa-globals.o \
+ store.o string.o tod.o version.o utf8.o
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
+- $(LNCC) -o test_parse $(LFLAGS) parse.o \
++ $(LNCC) -o test_parse $(LDFLAGS) parse.o \
+ dummies.o sa-globals.o store.o string.o tod.o version.o \
+- utf8.o $(LDFLAGS)
++ utf8.o $(LFLAGS)
+ rm -f parse.o
+
+ test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
+- $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
+- dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)
++ $(LNCC) -o test_string $(LDFLAGS) -DSTAND_ALONE string.o \
++ dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LFLAGS)
+ rm -f string.o
+
+ # End
diff --git a/mail-mta/exim/files/exim-4.89-transport-crash.patch b/mail-mta/exim/files/exim-4.89-transport-crash.patch
new file mode 100644
index 000000000000..94a1d6b15525
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.89-transport-crash.patch
@@ -0,0 +1,62 @@
+This is a manual backport of the following commit which fixes the
+original bug as well as https://bugs.exim.org/show_bug.cgi?id=2166:
+
+From e69636bc9ddf3617be688b07941d7d659d50eaa7 Mon Sep 17 00:00:00 2001
+From: Jeremy Harris <jgh146exb@wizmail.org>
+Date: Sat, 3 Jun 2017 13:39:18 +0100
+Subject: [PATCH 1/1] Fix crash in transport, on second smtp-connect fail for a
+ list of target hosts
+
+Reported as the sequence:
+ 1MX: 554 on connect (banner)
+ 2MX: TCP conn timeout
+
+diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
+index 454c0f7..dc9e03b 100644
+--- a/src/src/transports/smtp.c
++++ b/src/src/transports/smtp.c
+@@ -2177,25 +2177,34 @@ return OK;
+
+ /* The failure happened while setting up the call; see if the failure was
+ a 5xx response (this will either be on connection, or following HELO - a 5xx
+- after EHLO causes it to try HELO). If so, fail all addresses, as this host is
+- never going to accept them. For other errors during setting up (timeouts or
+- whatever), defer all addresses, and yield DEFER, so that the host is not
+- tried again for a while. */
++ after EHLO causes it to try HELO). If so, and there are no more hosts to try,
++ fail all addresses, as this host is never going to accept them. For other
++ errors during setting up (timeouts or whatever), defer all addresses, and
++ yield DEFER, so that the host is not tried again for a while.
++
++ XXX This peeking for another host feels like a layering violation. We want
++ to note the host as unusable, but down here we shouldn't know if this was
++ the last host to try for the addr(list). Perhaps the upper layer should be
++ the one to do set_errno() ? The problem is that currently the addr is where
++ errno etc. are stashed, but until we run out of hosts to try the errors are
++ host-specific. Maybe we should enhance the host_item definition? */
+
+ FAILED:
+ sx->ok = FALSE; /* For when reached by GOTO */
+-
+- yield = code == '5'
++ set_errno(sx->addrlist, errno, message,
++ sx->host->next
++ ? DEFER
++ : code == '5'
+ #ifdef SUPPORT_I18N
+- || errno == ERRNO_UTF8_FWD
++ || errno == ERRNO_UTF8_FWD
+ #endif
+- ? FAIL : DEFER;
+-
+- set_errno(sx->addrlist, errno, message, yield, pass_message, sx->host
++ ? FAIL : DEFER,
++ pass_message, sx->host
+ #ifdef EXPERIMENTAL_DSN_INFO
+ , sx->smtp_greeting, sx->helo_response
+ #endif
+ );
++ yield = DEFER;
+ }
+
+
diff --git a/mail-mta/exim/files/exim-submission.socket b/mail-mta/exim/files/exim-submission.socket
new file mode 100644
index 000000000000..b9593e2ef7b2
--- /dev/null
+++ b/mail-mta/exim/files/exim-submission.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Exim Mail Transfer Agent (message submission)
+Conflicts=exim.service
+
+[Socket]
+ListenStream=587
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/mail-mta/exim/files/exim-submission_at.service b/mail-mta/exim/files/exim-submission_at.service
new file mode 100644
index 000000000000..4f90cd83dc8d
--- /dev/null
+++ b/mail-mta/exim/files/exim-submission_at.service
@@ -0,0 +1,11 @@
+# It doesn't make sense for this to be separate from exim@.service
+# However, I couldn't think of a way to have two .socket files point
+# to it ([Socket] Service= is rejected if Accept=yes is set).
+
+[Unit]
+Description=Exim Mail Daemon per-connection server (message submission)
+
+[Service]
+ExecStart=-/usr/bin/exim -bs
+StandardInput=socket
+StandardError=syslog
diff --git a/mail-mta/exim/files/exim.confd b/mail-mta/exim/files/exim.confd
new file mode 100644
index 000000000000..1534d9dfaf08
--- /dev/null
+++ b/mail-mta/exim/files/exim.confd
@@ -0,0 +1,5 @@
+# Command-line options for running exim
+EXIM_OPTS="-bd -q15m"
+
+# Additional flags passed to exim_tidydb upon start (e.g. -t 7d)
+TIDY_OPTS=""
diff --git a/mail-mta/exim/files/exim.logrotate b/mail-mta/exim/files/exim.logrotate
new file mode 100644
index 000000000000..f54f8c479af9
--- /dev/null
+++ b/mail-mta/exim/files/exim.logrotate
@@ -0,0 +1,9 @@
+/var/log/exim/exim*.log {
+ daily
+ missingok
+ rotate 28
+ compress
+ delaycompress
+ notifempty
+ create 640 mail mail
+}
diff --git a/mail-mta/exim/files/exim.rc10 b/mail-mta/exim/files/exim.rc10
new file mode 100644
index 000000000000..c44dba16ce2d
--- /dev/null
+++ b/mail-mta/exim/files/exim.rc10
@@ -0,0 +1,47 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+depend() {
+ need logger
+ use antivirus net
+ provide mta
+}
+
+tidy_dbs() {
+ local spooldir=$(/usr/sbin/exim -C /etc/exim/${SVCNAME}.conf -bP -n spool_directory)
+ local db
+ local ret=0
+ ebegin "Tidying hints databases in ${spooldir}/db"
+ for db in "${spooldir}"/db/* ; do
+ case "${db}" in
+ *".lockfile"|*"*") continue ;;
+ esac
+ /usr/sbin/exim_tidydb ${TIDY_OPTS} "${spooldir}" ${db##*/} > /dev/null
+ : $((ret += $?))
+ done
+ eend ${ret}
+}
+
+start() {
+ # if you use multiple instances, make sure you set spool_directory
+ # in the configfile
+ tidy_dbs
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/exim --pidfile /run/${SVCNAME}.pid -- -C /etc/exim/${SVCNAME}.conf ${EXIM_OPTS:--bd -q15m}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile /run/${SVCNAME}.pid --name exim
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile /run/${SVCNAME}.pid --name exim
+ eend $?
+}
diff --git a/mail-mta/exim/files/exim.service b/mail-mta/exim/files/exim.service
new file mode 100644
index 000000000000..c8a61cdc4a4a
--- /dev/null
+++ b/mail-mta/exim/files/exim.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Exim Mail Transport Agent
+After=network.target
+
+[Service]
+Environment=QUEUE=15m
+ExecStart=/usr/sbin/exim -bdf -q${QUEUE}
+ExecReload=/bin/kill -HUP $MAINPID
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-mta/exim/files/exim.socket b/mail-mta/exim/files/exim.socket
new file mode 100644
index 000000000000..36d28684f18a
--- /dev/null
+++ b/mail-mta/exim/files/exim.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Exim Mail Transfer Agent
+Conflicts=exim.service
+
+[Socket]
+ListenStream=25
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/mail-mta/exim/files/exim_at.service b/mail-mta/exim/files/exim_at.service
new file mode 100644
index 000000000000..19c07a51b063
--- /dev/null
+++ b/mail-mta/exim/files/exim_at.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Exim Mail Daemon per-connection server
+
+[Service]
+ExecStart=-/usr/bin/exim -bs
+StandardInput=socket
+StandardError=syslog
diff --git a/mail-mta/exim/metadata.xml b/mail-mta/exim/metadata.xml
new file mode 100644
index 000000000000..8a96bf761572
--- /dev/null
+++ b/mail-mta/exim/metadata.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grobian@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <longdescription>
+ Exim is a message transfer agent (MTA) developed at the University of
+ Cambridge for use on Unix systems connected to the Internet. It is
+ freely available under the terms of the GNU General Public Licence. In
+ style it is similar to Smail 3, but its facilities are more general.
+ There is a great deal of flexibility in the way mail can be routed, and
+ there are extensive facilities for checking incoming mail. Exim can be
+ installed in place of sendmail, although the configuration of exim is
+ quite different to that of sendmail.
+ </longdescription>
+ <use>
+ <flag name="dcc">Adds support for Distributed Checksum Clearinghouse
+ (DCC)</flag>
+ <flag name="dane">Adds support for DNS-based Authentication of Named Entities</flag>
+ <flag name="dkim">Adds support for DomainKeys Identified Mail
+ (DKIM)</flag>
+ <flag name="dnsdb">Adds support for a DNS search for a record whose
+ domain name is the supplied query</flag>
+ <flag name="dovecot-sasl">Adds support for Dovecot's
+ authentication</flag>
+ <flag name="dlfunc">Install local_scan.h header to compile separate
+ dlfunc libraries</flag>
+ <flag name="dmarc">Adds support for DMARC</flag>
+ <flag name="dsn">Adds support for Delivery Status Notifications
+ (DSN)</flag>
+ <flag name="exiscan-acl">Patch providing support for content
+ scanning</flag>
+ <flag name="lmtp">Adds support for lmtp</flag>
+ <flag name="mbx">Adds support for UW's mbx format</flag>
+ <flag name="spf">Adds support for Sender Policy Framework</flag>
+ <flag name="srs">Adds support for Sender Rewriting Scheme</flag>
+ <flag name="proxy">Add support for being behind a proxy, such as HAProxy</flag>
+ <flag name="pkcs11">Require pkcs11 support in <pkg>net-libs/gnutls</pkg> with USE=gnutls</flag>
+ <flag name="redis">Adds support for querying <pkg>dev-db/redis</pkg></flag>
+ <flag name="prdr">Adds support for Per-Recipient Data Response</flag>
+ <flag name="tpda">Adds support for Transport Post-Delivery Actions</flag>
+ </use>
+ <upstream>
+ <bugs-to>http://bugs.exim.org/</bugs-to>
+ <!-- stupid DTD doesn't allow this
+ <vcs>http://git.exim.org/exim.git</vcs>
+ -->
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/metadata.xml b/mail-mta/metadata.xml
new file mode 100644
index 000000000000..832ee68326ff
--- /dev/null
+++ b/mail-mta/metadata.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The mail-mta category contains mail transport agent packages.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie mail-mta enthält Mail Transport Agents wie z.B. Sendmail und Postfix.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría mail-mta contiene los paquetes de los agentes de transporte
+ de correo electrónico.
+ </longdescription>
+ <longdescription lang="ja">
+ mail-mtaカテゴリーにはメール・トランスポート・エージェントのパッケージが
+ 含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De mail-mta categorie bevat Mail Transport Agents, zoals sendmail &amp; postfix.
+ </longdescription>
+ <longdescription lang="sk">
+ Kategória mail-mta obsahuje serverové balíky pre prenos elektronickej pošty (MTA).
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm mail-mta chứa các mail server (Mail Transport Agent).
+ </longdescription>
+ <longdescription lang="it">
+ La categoria mail-mta contiene pacchetti di server per la posta elettronica
+ (Mail Transport Agent).
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria mail-mta contém pacotes de servidor dos agentes de
+ transporte de correio eletrônico (Mail Transport Agent).
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria mail-mta zawiera serwery przekazywania poczty.
+ </longdescription>
+</catmetadata>
diff --git a/mail-mta/mini-qmail/Manifest b/mail-mta/mini-qmail/Manifest
new file mode 100644
index 000000000000..3a632e3c492b
--- /dev/null
+++ b/mail-mta/mini-qmail/Manifest
@@ -0,0 +1,14 @@
+AUX 1.05-config-mini-help.patch 672 SHA256 bc27d21c7994dda71f12658e8489de28673838b74f255d3475f55b99d069cfec SHA512 441519ac63fe6f1380f276d3550fdb51f7ca258b809fe07f65a006fafa48f62a0eea051e325d5ae7823847078f0e07087410f45b82e82b6c5d678f9dc8d50231 WHIRLPOOL 6d241f42a142af68323db4f94a5936d3cb58dcb72662158d6281b10a0963f7b0692b583ae9c3ea8889fa093270209dfae799d7da9b80a8869dbc70dd757fc332
+AUX 1.06-headers.patch 640 SHA256 35e513cd2eb50a9ac5dd97f7f43379d59d0c251e7f65c3d7a6f8a89a0ef73936 SHA512 09e684fe5ffd53acd2324b3975e9bc9a950b551d8fdb7a4d42f05697af411ef37a0851140c45e2e882fc890cf0fd28a77b46faacb428fb98dce22c5b15ff0b99 WHIRLPOOL 91aa62ee5565ed34557f2b12a1402ff6a6c073316452c8c84543dacf7e25963b2dcc5d1d84cc4e5a4e8b13f487f269d5d3c70c9fb980917561a3f53d1605c5b5
+AUX 99qmail 84 SHA256 cd259c9003ec1962562ae7c32c24efbeae54b0baac3380adff59604dd1fd3648 SHA512 ef7c83996a8714114353e0e2f4ace04a1d82e5e5324afc14b3e51f92821d8e2c535431f0bfc4c843f548572b73e3993e204ef78a97a555aef039aeec941124d5 WHIRLPOOL 4d4c5f516f45c9104f933c9a20c062be1ee21d6ac64eab3d8dbd0c0f1bc93df66719539c7dc59035f687784a2fc7d1eb8841dea951f06453e1913af72ecfa7d9
+AUX config-mini 961 SHA256 2f6fed8f293a8d60cc04091d5684f581ff2253957256907085db3bceaf2f4384 SHA512 a98f18b0d705506e524d5959f296d9e47d44871b59cedb154cc0fb51283413f84ef2cf5db2786e3e4af7e1a80a55691437598b3ee8af014a4ae7ac8bccd60102 WHIRLPOOL 4b2d12f75c13f77a0cbebfdccef836a4b269516171ec3a61db16fd562dac845d519c4a2b3a6e956d108758c4e54aeb0527e236b0812f6f5e04b612a1729bf1af
+DIST genqmail-20080406.tar.bz2 10252 SHA256 501ca2120c7619569bd9ac3e0035cb0022bfd0cdc9c720b5c43c9e3a4eb07ce8 SHA512 744d0968307bfedebf0ca7bc0d5bd0780884326acaf5fea0a66fb91f8b0caf5ba52eb443c9cb2a7d6389622ca5c87100c3204ec3408aed8ef5fb1e7f80ff0d35 WHIRLPOOL b385cd2d5e88795f163a4f49dc81a2080d7076ec2016ee7d8154df4488effa7112caf0577c8dc8ff654665213aa4120a21de8223f3dd51056fa189546ace3cf5
+DIST mini-qmail-kit-0.52.tar.gz 6174 SHA256 8796d7ba7a6b1ff49df371491e2cebb1dca81169fa3d98d730f9d717067cf6d6 SHA512 d3d2acb008f48f71a1b3aeff7653a694b2ed2704705a229a3e7f7154704eae1b34238fb6c8a7cd3f4e44c23841e4c49910e3c0498815d836a6f37e73ed19bf3e WHIRLPOOL afebbbbb11ff88c3e337c114ef40032e54895c301fc957dfc160c17e2fe92a7180325e9082a0a4eb20a7c382a1d305636ca771d3e8e64e8821c440c86ba5ff54
+DIST netqmail-1.05.tar.gz 252264 SHA256 59788abf252e2da224542c1c8b727311335c61d990f24f4edf28f6eb5483f676 SHA512 9504e3ff98e5c9278000cd9dd12eecfa504a7604641ff5b2ed735d6bfacfbd0ae69a4b9c7287217320f15fd51e4e94fe6d85c927b9c7dc07f62fe7cccb7d7070 WHIRLPOOL 3af5e033eafd18b9911312ee37b95295878aecd35d98b2b4498d7060053ca9c0ff824eaef4194320b6e117ffaea146f29983e83a9c2a4d484acae5475ffe107b
+DIST netqmail-1.06.tar.gz 260941 SHA256 8e7d98d15211fc9f9c28109e942e2268f42a6672d68df92a42f2afa90ff00532 SHA512 de40a6d8fac502bd785010434d99b99f2c0524e10aea3d0f2a0d35c70fce91e991eb1fb8f20a1276eb56d7e73130ea5e2c178f6075d138af47b28d9ca6e6046b WHIRLPOOL 167bd5c290f13bf7d39daae0a6245afa1bcf760b01fd7ffcc88676f02a9ed1013c545c9f87c4d6e05ee7b073c838ee1613f97cb75ae3eab65106e32040d74712
+EBUILD mini-qmail-1.05-r1.ebuild 2661 SHA256 bbcfc316e8830fbf0c659ead5b44e6c67ced5c1050b383802a9765328c7a4039 SHA512 c2802a44be3c2e964aabdada97721d311e96438ca0cd328310f7498e782002a876d1f9601b4f40499fd1fbb6957215cd808eaa5f8b0917e261763df052febaf1 WHIRLPOOL 920928bc9005f46c8c68290124daf08ed0c6033471dea8b995ba457792dec1e34af437b2045e251064d16cb3e05887be2972a44d036b98e2aa07b9fa01bb34e4
+EBUILD mini-qmail-1.05.ebuild 2946 SHA256 1c60b5af810b9024ed24374974186af482a016ce8538027168ef861d44fc58e5 SHA512 da5d815f43c25435ae4eb4d12d76cd9f2c0eaeb85a03bfe9ed86347bda70499a82cd491d522f103ee2204e7eebba12fe91cb8da20caa40505c44bab5429abe07 WHIRLPOOL a9a6dae23c6817b6ab60f0e119c572c4e42f5dd87f0ba038f031ba8e40323b53b4b6574474c90f850476f328f6fb395d68b4fc6e9fb6943fa6c4b63766b8192b
+EBUILD mini-qmail-1.06.ebuild 1336 SHA256 16df3b326f416fd388bc089ba5b0f141fb0d62ed6efa1a0796371491b7894719 SHA512 0c89cd207b8b5fbe821729f027852b405ddb7c173f470d4d66388cd5e8284f1ec1b6bb0f4914232d83fed4aa91c64c15dda9a7941b3d06abe8ed83e2e2457733 WHIRLPOOL 16350c272406d82723054f3c21665ec329371f76fd84138c2ab229463393286c8b4b0c3de3ca44e533475bb90f7c603150130745df2a4fb42b07eb145fa3f467
+MISC ChangeLog 3154 SHA256 814f7e9dd0edb9c464ffda533b1567782c275cca7b6c52250bf0e5db8a3c5db0 SHA512 99eb2a6fbf43dea6c5ca74e033e3cf674cdcbc5c9716978150740205503b78619b23610d92bb72bb83e0bdc1baed2226e538650d95e6bac19caae66b0c456936 WHIRLPOOL 75438e33dac5d4c646bd1214dd04fedb15103b71d754c47bbfb9c89f836de636d85e0a2fa1eff0e7fc8316812dcf851950b03edea4947a52ced5a6c157831f85
+MISC ChangeLog-2015 3497 SHA256 d87f33b958a43afa50a8c3504aa38dba6ccd95764cac687dce1ce6fd2be5e524 SHA512 5b063df09d8dd31cef97925d8137b04065014ac83c023d7a009af157ea7f99cd830d65a721aaa85ccdf0ec42a74bf7f66b28c050527820ab995255acd79bf1cc WHIRLPOOL 6a9697d29f452fdab806aa66bfc0e7e3a2cc99b9f506243f9854e3f44ba0201fe6d6f56652ed6f6195786f670687124ebed1015e95c372cd69aee4a0a1417c42
+MISC metadata.xml 321 SHA256 2245632231fd5545710f0faecb81dec64a28904b03937f4464cb8a561282b9ed SHA512 5264e9ac28fad5adedc3560b99d8510cf9aabb873900f5c6cfff1df5a9aa0056cf88029821f6709c4e6e166e022f9eb846147d13bd22c5e7a5504a685cd9bb81 WHIRLPOOL cf0074ca5cf80f3eaed2db35c03e598cf5a52256da020311161fc55fee25573beff2cabde758a54e7a82567c22c103bb4b0789c90251caabf48e4c796c5641c6
diff --git a/mail-mta/mini-qmail/files/1.05-config-mini-help.patch b/mail-mta/mini-qmail/files/1.05-config-mini-help.patch
new file mode 100644
index 000000000000..1b217dc9636a
--- /dev/null
+++ b/mail-mta/mini-qmail/files/1.05-config-mini-help.patch
@@ -0,0 +1,16 @@
+--- config-mini.sh.orig 2004-05-05 23:24:23.468285864 -0400
++++ config-mini.sh 2004-05-05 23:27:00.622394808 -0400
+@@ -1,7 +1,12 @@
+
+ case $# in
+ 0|1|2|3|4)
+- echo 'config-mini: usage: config-mini me defaultdom plusdom idhost qmqpserver ...' 1>&2
++ echo 'usage: config-mini me defaultdom plusdom idhost qmqpserver [more qmqp servers]' 1>&2
++ echo ' me - copied from the QMQP server'
++ echo ' plusdom - copied from the QMQP server'
++ echo ' defaultdom - copied from the QMQP server'
++ echo ' idhost - hostname of QMPQ client'
++ echo ' qmqpserver - list of QMQP servers IP addresses to send mail through'
+ exit 100
+ ;;
+ esac
diff --git a/mail-mta/mini-qmail/files/1.06-headers.patch b/mail-mta/mini-qmail/files/1.06-headers.patch
new file mode 100644
index 000000000000..566babfa6290
--- /dev/null
+++ b/mail-mta/mini-qmail/files/1.06-headers.patch
@@ -0,0 +1,37 @@
+--- a/qmail-pw2u.c
++++ b/qmail-pw2u.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include "substdio.h"
+--- a/qmail-qmtpd.c
++++ b/qmail-qmtpd.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "stralloc.h"
+ #include "substdio.h"
+ #include "qmail.h"
+--- a/readwrite.h
++++ b/readwrite.h
+@@ -1,7 +1,7 @@
+ #ifndef READWRITE_H
+ #define READWRITE_H
+
+-extern int read();
+-extern int write();
++#include <fcntl.h>
++#include <unistd.h>
+
+ #endif
+--- a/substdio.h
++++ b/substdio.h
+@@ -1,6 +1,8 @@
+ #ifndef SUBSTDIO_H
+ #define SUBSTDIO_H
+
++#include <unistd.h>
++
+ typedef struct substdio {
+ char *x;
+ int p;
diff --git a/mail-mta/mini-qmail/files/99qmail b/mail-mta/mini-qmail/files/99qmail
new file mode 100644
index 000000000000..469553953a16
--- /dev/null
+++ b/mail-mta/mini-qmail/files/99qmail
@@ -0,0 +1,3 @@
+PATH="/var/qmail/bin"
+ROOTPATH="/var/qmail/bin"
+CONFIG_PROTECT="/var/qmail/control"
diff --git a/mail-mta/mini-qmail/files/config-mini b/mail-mta/mini-qmail/files/config-mini
new file mode 100644
index 000000000000..009026e2c091
--- /dev/null
+++ b/mail-mta/mini-qmail/files/config-mini
@@ -0,0 +1,38 @@
+
+case $# in
+ 0|1|2|3|4)
+ echo 'config-mini: usage: config-mini me defaultdom plusdom idhost qmqpserver ...' 1>&2
+ exit 100
+ ;;
+ esac
+
+me="$1"; shift
+defaultdomain="$1"; shift
+plusdomain="$1"; shift
+idhost="$1"; shift
+
+echo Putting "$me" into control/me...
+echo "$me" > QMAIL/control/me
+chmod 644 QMAIL/control/me
+
+echo Putting "$defaultdomain" into control/defaultdomain...
+echo "$defaultdomain" > QMAIL/control/defaultdomain
+chmod 644 QMAIL/control/defaultdomain
+
+echo Putting "$plusdomain" into control/plusdomain...
+echo "$plusdomain" > QMAIL/control/plusdomain
+chmod 644 QMAIL/control/plusdomain
+
+echo Putting "$idhost" into control/idhost...
+echo "$idhost" > QMAIL/control/idhost
+chmod 644 QMAIL/control/idhost
+
+cp /dev/null QMAIL/control/qmqpservers
+for qmqpserver in "$@"
+ do
+ echo Putting "$qmqpserver" into control/qmqpservers...
+ echo "$qmqpserver" >> QMAIL/control/qmqpservers
+ chmod 644 QMAIL/control/qmqpservers
+ done
+
+exit 0
diff --git a/mail-mta/mini-qmail/metadata.xml b/mail-mta/mini-qmail/metadata.xml
new file mode 100644
index 000000000000..281af61aee8b
--- /dev/null
+++ b/mail-mta/mini-qmail/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+<maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/mail-mta/mini-qmail/mini-qmail-1.05-r1.ebuild b/mail-mta/mini-qmail/mini-qmail-1.05-r1.ebuild
new file mode 100644
index 000000000000..1a588aec77e2
--- /dev/null
+++ b/mail-mta/mini-qmail/mini-qmail-1.05-r1.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils toolchain-funcs fixheadtails
+
+MINI_VER=0.52
+DESCRIPTION="a small null client that forwards mail via QMQP to a full qmail server"
+HOMEPAGE="http://www.qmail.org/ http://cr.yp.to/qmail/mini.html"
+SRC_URI="mirror://qmail/netqmail-${PV}.tar.gz
+ http://www.din.or.jp/~ushijima/mini-qmail-kit/mini-qmail-kit-${MINI_VER}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ~mips ppc x86"
+IUSE=""
+
+DEPEND="sys-apps/groff"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ !mail-mta/opensmtpd
+ "
+
+S=${WORKDIR}/mini-qmail-kit-${MINI_VER}
+
+src_unpack() {
+ unpack netqmail-${PV}.tar.gz
+ unpack mini-qmail-kit-${MINI_VER}.tar.gz
+
+ cd "${S}"
+ epatch "${FILESDIR}"/${PV}-config-mini-help.patch
+ sed -i \
+ -e "/^qmail=/s:=.*:=${WORKDIR}/netqmail-${PV}/netqmail-${PV}:" \
+ Makefile.mini || die
+
+ cd "${WORKDIR}"/netqmail-${PV}
+ ./collate.sh || die "patching failed"
+
+ cd netqmail-${PV}
+ echo -n "$(tc-getCC) ${CFLAGS}" > "${S}"/conf-cc
+ echo -n "$(tc-getCC) ${LDFLAGS}" > "${S}"/conf-ld
+ ht_fix_file Makefile
+}
+
+src_compile() {
+ emake -f Makefile.mini || die "mini prep failed"
+ emake mini || die "make mini failed"
+}
+
+src_install() {
+ einfo "Setting up directory hierarchy ..."
+ keepdir /var/mini-qmail/control
+
+ dodoc INSTALL README
+
+ exeinto /var/mini-qmail/bin
+ doexe qmail-qmqpc forward qmail-inject \
+ sendmail predate datemail mailsubj \
+ qmail-showctl maildirmake maildir2mbox \
+ maildirwatch qail elq pinq \
+ || die "doexe failed"
+ dosym qmail-qmqpc /var/mini-qmail/bin/qmail-queue
+ newexe config-mini.sh config-mini
+ dosed "s:QMAIL:/var/mini-qmail/:g" /var/mini-qmail/bin/config-mini
+
+ doman qmail-qmqpc.8 forward.1 qmail-inject.8 \
+ mailsubj.1 qmail-showctl.8 maildirmake.1 \
+ maildir2mbox.1 maildirwatch.1 qmail-queue.8 \
+ qmail.7
+
+ einfo "Adding env.d entry for qmail"
+ doenvd "${FILESDIR}"/99qmail
+
+ einfo "Creating sendmail replacement ..."
+ diropts -m 755
+ dodir /usr/sbin /usr/lib
+ dosym /var/mini-qmail/bin/sendmail /usr/sbin/sendmail
+ dosym /var/mini-qmail/bin/sendmail /usr/lib/sendmail
+}
+
+pkg_postinst() {
+ elog "In order for mini-qmail to work, you need to setup"
+ elog "the QMQP server information."
+ elog
+ elog "You can setup the values in /var/mini-qmail/control yourself,"
+ elog "or use the utility /var/mini-qmail/bin/config-mini"
+ elog "To find out what values to put in what files, see the install"
+ elog "section of http://cr.yp.to/qmail/mini.html"
+}
diff --git a/mail-mta/mini-qmail/mini-qmail-1.05.ebuild b/mail-mta/mini-qmail/mini-qmail-1.05.ebuild
new file mode 100644
index 000000000000..38a76490df60
--- /dev/null
+++ b/mail-mta/mini-qmail/mini-qmail-1.05.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils toolchain-funcs fixheadtails user
+
+DESCRIPTION="a small null client that forwards mail via QMQP to a full qmail server"
+HOMEPAGE="http://www.qmail.org/ http://cr.yp.to/qmail/mini.html"
+SRC_URI="mirror://qmail/netqmail-${PV}.tar.gz
+ http://www.din.or.jp/~ushijima/mini-qmail-kit/mini-qmail-kit-0.52.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ~mips ppc x86"
+IUSE=""
+
+DEPEND="sys-apps/groff"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ !mail-mta/opensmtpd
+ "
+
+S=${WORKDIR}/netqmail-${PV}/netqmail-${PV}
+
+pkg_setup() {
+ # keep in sync with qmail pkg
+ enewgroup qmail 201
+ enewuser alias 200 -1 /var/qmail/alias 200
+ enewuser qmaild 201 -1 /var/qmail 200
+ enewuser qmaill 202 -1 /var/qmail 200
+ enewuser qmailp 203 -1 /var/qmail 200
+ enewuser qmailq 204 -1 /var/qmail 201
+ enewuser qmailr 205 -1 /var/qmail 201
+ enewuser qmails 206 -1 /var/qmail 201
+}
+
+src_unpack() {
+ unpack netqmail-${PV}.tar.gz
+ unpack mini-qmail-kit-0.52.tar.gz
+
+ cd netqmail-${PV}
+ ./collate.sh || die "patching failed"
+ mv "${WORKDIR}"/mini-qmail-kit-0.52/* "${S}"/
+
+ cd "${S}"
+ echo -n "$(tc-getCC) ${CFLAGS}" > "${S}"/conf-cc
+ echo -n "$(tc-getCC) ${LDFLAGS}" > "${S}"/conf-ld
+ ht_fix_file "${S}"/Makefile
+
+ epatch "${FILESDIR}"/${PV}-config-mini-help.patch
+}
+
+src_compile() {
+ emake it man || die
+}
+
+src_install() {
+ einfo "Setting up directory hierarchy ..."
+ keepdir /var/mini-qmail/control
+
+ dodoc FAQ UPGRADE SENDMAIL INSTALL* TEST* REMOVE* PIC* SECURITY
+ dodoc SYSDEPS TARGETS THANKS THOUGHTS TODO VERSION README*
+
+ exeinto /var/mini-qmail/bin
+ doexe qmail-qmqpc forward qmail-inject \
+ sendmail predate datemail mailsubj \
+ qmail-showctl maildirmake maildir2mbox \
+ maildirwatch qail elq pinq \
+ || die "doexe failed"
+ dosym qmail-qmqpc /var/mini-qmail/bin/qmail-queue
+ newexe config-mini.sh config-mini
+ dosed "s:QMAIL:/var/mini-qmail/:g" /var/mini-qmail/bin/config-mini
+
+ doman qmail-qmqpc.8 forward.1 qmail-inject.8 \
+ mailsubj.1 qmail-showctl.8 maildirmake.1 \
+ maildir2mbox.1 maildirwatch.1 qmail-queue.8 \
+ qmail.7
+
+ einfo "Adding env.d entry for qmail"
+ doenvd "${FILESDIR}"/99qmail
+
+ einfo "Creating sendmail replacement ..."
+ diropts -m 755
+ dodir /usr/sbin /usr/lib
+ dosym /var/mini-qmail/bin/sendmail /usr/sbin/sendmail
+ dosym /var/mini-qmail/bin/sendmail /usr/lib/sendmail
+}
+
+pkg_postinst() {
+ elog "In order for mini-qmail to work, you need to setup"
+ elog "the QMQP server information."
+ elog
+ elog "You can setup the values in /var/mini-qmail/control yourself,"
+ elog "or use the utility /var/mini-qmail/bin/config-mini"
+ elog "To find out what values to put in what files, see the install"
+ elog "section of http://cr.yp.to/qmail/mini.html"
+}
diff --git a/mail-mta/mini-qmail/mini-qmail-1.06.ebuild b/mail-mta/mini-qmail/mini-qmail-1.06.ebuild
new file mode 100644
index 000000000000..ca6fc4b45254
--- /dev/null
+++ b/mail-mta/mini-qmail/mini-qmail-1.06.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+GENQMAIL_PV=20080406
+
+inherit eutils qmail
+
+DESCRIPTION="a small null client that forwards mail via QMQP to a full qmail server"
+HOMEPAGE="
+ http://netqmail.org/
+ http://cr.yp.to/qmail/mini.html
+ http://qmail.org/
+"
+SRC_URI="mirror://qmail/netqmail-${PV}.tar.gz
+ https://dev.gentoo.org/~hollow/distfiles/${GENQMAIL_F}"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ~mips ppc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/maildrop
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ !mail-mta/opensmtpd
+ ${DEPEND}
+ "
+
+S="${WORKDIR}"/netqmail-${PV}
+
+src_unpack() {
+ genqmail_src_unpack
+
+ unpack netqmail-${PV}.tar.gz
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PV}-headers.patch
+
+ qmail_src_postunpack
+}
+
+src_compile() {
+ MAKEOPTS="${MAKEOPTS} -j1" qmail_src_compile #398135
+}
+
+# make check is actually an install-check target, see bug #364955
+src_test() { :; }
+
+qmail_base_install_hook() {
+ dosym qmail-qmqpc "${QMAIL_HOME}"/bin/qmail-queue
+ exeinto "${QMAIL_HOME}"/bin
+ doexe "${FILESDIR}"/config-mini
+}
+
+src_install() {
+ qmail_base_install
+ qmail_man_install
+ qmail_sendmail_install
+}
diff --git a/mail-mta/msmtp/Manifest b/mail-mta/msmtp/Manifest
new file mode 100644
index 000000000000..a28dd290f7bf
--- /dev/null
+++ b/mail-mta/msmtp/Manifest
@@ -0,0 +1,5 @@
+DIST msmtp-1.6.6.tar.xz 283744 SHA256 da15db1f62bd0201fce5310adb89c86188be91cd745b7cb3b62b81a501e7fb5e SHA512 30f33648b66a6b230cd38d0eee4c916a631a51bddcc1a15c9f7b324305506cb83b9c95f95def9150d0b783d38000db409981331b3c6a756232f0ce49e9b343ab WHIRLPOOL 2b5d3faad7165c15dfca18bd1703fcf67065897d59ab57f11bcc1ce532ece97110affd269d923b070c275b7f92a68911355219b7a5619897bb01ee19b28b10ea
+EBUILD msmtp-1.6.6.ebuild 2954 SHA256 5db88a4b5c3042ee64d9038e5bbc77a556a4cc70dd5964cf29dd45e8a1f78dc1 SHA512 4dec764ab02dca34d7f4244fe082327dbe9c4e4fa00cc889ec5bf31a85f01c60e30a2a486ed852944f3b331efe8fd87e9ea078e24bcd35f8cbdd12a7e65c55a9 WHIRLPOOL 93d0abbdf422c9c1df6292989c9d984b4a3f2374113adbf783bbc6206f863fd48ab469952ef1912f5901e88bdeae2f7f27ee5a2a0f0fc1cce662a87a360e6895
+MISC ChangeLog 3749 SHA256 f92536b7882178eedf72f21f5b94bb4b44cf19013c6ba389662f8d58f93af54a SHA512 4d3007c30a5e4f8143f1fc95d7a8fa696f76ceff57ceb737a450dff9f85e99c186f9f78436888be3443374cb24ec8b1f9f209dd038af8dc2e2f660ff81937a7e WHIRLPOOL 4ff0fbca8abc77c5df19cb7aefd7a0eeec468f3bcee3eece6449f69f57dcdd7a412026ce407325d74de78a6e09d59cc8afe50551cdddaaa6cf78213b9c904d5f
+MISC ChangeLog-2015 23047 SHA256 52a960424c45a3358592636f18b86c0ee4675b2ab83ebb3788fb4d48ecfae8bc SHA512 c89a473ff49df78f25c06a4eee5807b4080cc00863ef48861395eb7a55c69c81d92b70fbe4dc187662f558b1504bca65d562fa72ac03181cdcafe5404a08cd6a WHIRLPOOL 198a50083969d131cf64eb3f5685558dc6029db2d79e19fbc8e9a51919051e71fe2be841b81f2f4891c6a1a638ff671e30e1763659dc28d927a7506b6b2b0cef
+MISC metadata.xml 486 SHA256 e19d8e65e36cf7772ac866dbe4c2a04042e571b9233a661e66bf50bbee0787f5 SHA512 d52248bba8e2702bb75568c239de59d57592d5957ef4724079c5b75ecfff1ad7e193fe85a6d98cd49a6d462178dae3adc43b41a3869169c122c95990b066c820 WHIRLPOOL 8904b6414ab75ada822724151579eeba6ba7cab2212ce740de8388f718c946745f0a9d83d84d4175d8b3fc23de10ecf63224b1eefa97b0afb6e8fd66011c28a1
diff --git a/mail-mta/msmtp/metadata.xml b/mail-mta/msmtp/metadata.xml
new file mode 100644
index 000000000000..423cd3ac03fb
--- /dev/null
+++ b/mail-mta/msmtp/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <use>
+ <flag name="mta">Enable this to install as system-wide MTA</flag>
+ <flag name="libsecret">Enable libsecret support to store login credentials</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">msmtp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/msmtp/msmtp-1.6.6.ebuild b/mail-mta/msmtp/msmtp-1.6.6.ebuild
new file mode 100644
index 000000000000..90854789913c
--- /dev/null
+++ b/mail-mta/msmtp/msmtp-1.6.6.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit multilib
+
+DESCRIPTION="An SMTP client and SMTP plugin for mail user agents such as Mutt"
+HOMEPAGE="http://msmtp.sourceforge.net/"
+SRC_URI="mirror://sourceforge/msmtp/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ia64 ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="doc gnutls idn libressl libsecret +mta nls sasl ssl vim-syntax"
+
+CDEPEND="
+ idn? ( net-dns/libidn )
+ libsecret? ( app-crypt/libsecret )
+ nls? ( virtual/libintl )
+ sasl? ( virtual/gsasl )
+ ssl? (
+ gnutls? ( net-libs/gnutls )
+ !gnutls? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
+ )
+"
+
+RDEPEND="${CDEPEND}
+ net-mail/mailbase
+ mta? (
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ )
+"
+
+DEPEND="${CDEPEND}
+ doc? ( virtual/texi2dvi )
+ nls? ( sys-devel/gettext )
+ virtual/pkgconfig
+"
+
+REQUIRED_USE="gnutls? ( ssl )"
+
+DOCS="AUTHORS ChangeLog NEWS README THANKS doc/msmtprc*"
+
+src_prepare() {
+ # Use default Gentoo location for mail aliases
+ sed -i 's:/etc/aliases:/etc/mail/aliases:' scripts/find_alias/find_alias_for_msmtp.sh || die
+
+ default
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_with ssl ssl $(usex gnutls gnutls openssl)) \
+ $(use_with sasl libgsasl) \
+ $(use_with idn libidn) \
+ $(use_with libsecret )
+}
+
+src_compile() {
+ default
+
+ if use doc ; then
+ cd doc || die
+ emake html pdf
+ fi
+}
+
+src_install() {
+ default
+
+ if use doc ; then
+ dohtml doc/msmtp.html
+ dodoc doc/msmtp.pdf
+ fi
+
+ if use mta ; then
+ dodir /usr/sbin
+ dosym /usr/bin/msmtp /usr/sbin/sendmail
+ dosym /usr/bin/msmtp /usr/bin/sendmail
+ dosym /usr/bin/msmtp /usr/$(get_libdir)/sendmail
+ fi
+
+ if use vim-syntax ; then
+ insinto /usr/share/vim/vimfiles/syntax
+ doins scripts/vim/msmtp.vim
+ fi
+
+ insinto /etc
+ newins doc/msmtprc-system.example msmtprc
+
+ src_install_contrib find_alias find_alias_for_msmtp.sh
+ src_install_contrib msmtpqueue "*.sh" "README ChangeLog"
+ src_install_contrib msmtpq "msmtpq msmtp-queue" README.msmtpq
+ src_install_contrib set_sendmail set_sendmail.sh set_sendmail.conf
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ einfo "Please edit ${ROOT}etc/msmtprc before first use."
+ einfo "In addition, per user configuration files can be placed"
+ einfo "as '~/.msmtprc'. See the msmtprc-user.example file under"
+ einfo "/usr/share/doc/${PF}/ for an example."
+ fi
+}
+
+src_install_contrib() {
+ subdir="$1"
+ bins="$2"
+ docs="$3"
+ local dir=/usr/share/${PN}/$subdir
+ insinto ${dir}
+ exeinto ${dir}
+ for i in $bins ; do
+ doexe scripts/$subdir/$i
+ done
+ for i in $docs ; do
+ newdoc scripts/$subdir/$i $subdir.$i
+ done
+}
diff --git a/mail-mta/netqmail/Manifest b/mail-mta/netqmail/Manifest
new file mode 100644
index 000000000000..a8e32b50b30f
--- /dev/null
+++ b/mail-mta/netqmail/Manifest
@@ -0,0 +1,23 @@
+AUX 1.06-exit.patch 551 SHA256 400ab4719d145e29b08d266b38766b80d894d5473e4c4f3b5e436916a36a4333 SHA512 9623d4c045d1399ca035ad49f82e50a344529edffaf7c0e2f1015fe0958dfaf8814462a70b944403203d84b86852e8a01f6a3c4688228b45443258dc908e9236 WHIRLPOOL 9e7df2a478efe792fb6b392429ce32e2920baeaa4a7082493a7ddb208927d344185ddab245e2b92ec05c5471c08c18d4b75f04f093849c2305d140f8cde13a83
+AUX 1.06-fbsd-utmpx.patch 1903 SHA256 dc21eb0ce3f199e346e50a51324120310a88a2f00f7e2c6d06b1b09e3c06a373 SHA512 b6e8ff4f6f582e0d6d69072547a68a3741345d08041e29285a3bf39c016b2b15231d5b0370123a95b35473d67f1780b69d19b61ddfbddae5f463709575344481 WHIRLPOOL c78df462488090e2656aa7a5a5918fbf8bf594eaced99fb6c51c5ccaffa8fa295563abee3e9ca56e7f9cce45686e3c304f9be27be4c33b446d159994a985ab50
+AUX 1.06-readwrite.patch 237 SHA256 71b60967ca83d9c8ac0ae041298ade87174930472f4eb2628a26e30665aafd35 SHA512 4cfb7991f2b30740d007a655743e77f5271ebefb4ed31ceb44d10ee53168eec713bbe64ff3616c372851c5fe1f04e57601dc83a27f1ce9cccdd0e2fbc942b550 WHIRLPOOL 34768aaa96a56b324755187b8edc64cbd84afa3562bd7f01cf136c4c8fd91999e351221d7bb5379977887c6128efeec581b20b34f7a8e597971c25e5e1cb84d9
+AUX genqmail-20080406-ldflags.patch 456 SHA256 595d1aa847ff678754245c292f64b87305f16a175ef1ec030d479c7fb5adcba8 SHA512 2e0061f135bafb6eba363c165e3282992d326a581adbeac5d790fb665b251ed2a2b5febed4987bafd39b33fe8275cc81a3523eb77418543c2bc7923647df1dd5 WHIRLPOOL 00ff535ef475f2d0ab894bce40d4cdfe20b32edb64227abac69a1827ec208c0018262c11b9fe00cb454920bda902e5dcce067e53cf8fa43ac7e2a6b75d1d67db
+AUX qmail-smtputf8.patch 6693 SHA256 cf3a802d439fe53e9cecbeb82a6ce6ff5c71b5fcd0b053eac5a19df918724cfa SHA512 8cafdf1a4f1fd41e6b11ee2abddac5c3da4a1d2ab17b5d3847433875a91f867a26eb358ae8c41791f1e77758e5a2c311134a286d888ccd23fbede6d9f0b475c4 WHIRLPOOL 36d2a822cf42efbe34e0e95da6e171a3394c049cfbcf2a3b68efe789b4199f00fcdb942d1e93268283a4eec15ad3ead7a58df31a327ade517c218fb18f8a7801
+AUX use-new-path-for-functions.sh.patch 410 SHA256 715ae19d940f49e106ac38427115ee717d32dff2484312cd7600e6a29a78bad4 SHA512 72f31612286d6869078f6546966cc005b6d413a154fbe20bda97da15851b81c309a6ee3e5ae8b03124ad6e20773dee393fb8a029b48b8d8a903e92fe224df565 WHIRLPOOL 50ccdfd95f7cd6f67f8f1049e4ea4fdc302df272157023185591d5862bd452ef1b503a7a8524d13708225cb16ad502cfe3f2776ee9846096c850ea844ac83fb3
+DIST big-todo.103.patch 5546 SHA256 afa0a249e3271badd442f0bdae39997d9fe536157d8a0d62b6706f3dfcd11a72 SHA512 fe6e19a94fb7dbe51f7164e38a91d8edb636251569d44ace1e146fe5f607b240edafb2884daaac481ff3219142ab553cfd5b01786e0dfc4662ef07336b789975 WHIRLPOOL ac9c2ce18e8c3bda85287c998661f2192c986daaad197bd358e1966cb97b4dbe0146bc0e334a251fc0ec3e42a7caa3f9a479a8c2c8e7777c790cb8af078d5d13
+DIST genqmail-20080406.tar.bz2 10252 SHA256 501ca2120c7619569bd9ac3e0035cb0022bfd0cdc9c720b5c43c9e3a4eb07ce8 SHA512 744d0968307bfedebf0ca7bc0d5bd0780884326acaf5fea0a66fb91f8b0caf5ba52eb443c9cb2a7d6389622ca5c87100c3204ec3408aed8ef5fb1e7f80ff0d35 WHIRLPOOL b385cd2d5e88795f163a4f49dc81a2080d7076ec2016ee7d8154df4488effa7112caf0577c8dc8ff654665213aa4120a21de8223f3dd51056fa189546ace3cf5
+DIST netqmail-1.05-tls-smtpauth-20070417.patch 67942 SHA256 573de07d57ac6941a42dda645079213cf36fcbb7f3a8c254b8447709e5e5cd60 SHA512 ce5fb50ae9a7683b708eeb65c68a0db47c5817eb3fc14457c4f7c5746916ca2734c647a2369bf6f1240477ee818e3e7d7870aec3edbad2eaace179cba6267e41 WHIRLPOOL a5bf8ecfcd6f0b76d9c10a318d93aecbf7778e59a1a88432f38e051859fc926a7e2a688d55e8326d6c58c1690f453025eeb1dd64b9b603f37b132c18d22fbcd8
+DIST netqmail-1.06.tar.gz 260941 SHA256 8e7d98d15211fc9f9c28109e942e2268f42a6672d68df92a42f2afa90ff00532 SHA512 de40a6d8fac502bd785010434d99b99f2c0524e10aea3d0f2a0d35c70fce91e991eb1fb8f20a1276eb56d7e73130ea5e2c178f6075d138af47b28d9ca6e6046b WHIRLPOOL 167bd5c290f13bf7d39daae0a6245afa1bcf760b01fd7ffcc88676f02a9ed1013c545c9f87c4d6e05ee7b073c838ee1613f97cb75ae3eab65106e32040d74712
+DIST qmail-103.patch 2104 SHA256 4cad53c7a6628a600c74c36bfee327db5052ca24c222d4013e4dfcd7f427653d SHA512 b81062bb0b0023f474c0b6af40601926e1c04ad395de480d114809e48a8060c06d99bdbdeb6f44d9e24ae1acedabb094b979193d305371aed958f18fc6eee354 WHIRLPOOL 5785684b98b9d9732ed14aa1b53910746bd09aa93514e0e6ef3d74831c3df8ed0a55f257057488f34a3d462e485b7a4417ed255f66abaff6dd63d881b9230063
+DIST qmail-smtputf8.patch 6693 SHA256 cf3a802d439fe53e9cecbeb82a6ce6ff5c71b5fcd0b053eac5a19df918724cfa SHA512 8cafdf1a4f1fd41e6b11ee2abddac5c3da4a1d2ab17b5d3847433875a91f867a26eb358ae8c41791f1e77758e5a2c311134a286d888ccd23fbede6d9f0b475c4 WHIRLPOOL 36d2a822cf42efbe34e0e95da6e171a3394c049cfbcf2a3b68efe789b4199f00fcdb942d1e93268283a4eec15ad3ead7a58df31a327ade517c218fb18f8a7801
+DIST qmail-spp-0.42.tar.gz 18689 SHA256 1518e7e82d10fbbb8ecc520f51daf503edeb9c3a9fb935be65a8185e7b53808d SHA512 03449862886a0ca20fbadab4c94b34b55d185f8df3261bd68aea99e9ded9edfab4477c6b38a8e0295e9b38b0045615da8b1a906a458f28745eadd3c4d882bcbf WHIRLPOOL 2f8525bb264fbec4b057bad6d92968e29085fdf10b8538b8e572d81ea8793e74c07c6093d0cc2a34de00b629e797b048007b30e3845dce76829037fdb44f527c
+DIST vu555316.patch 617 SHA256 cc7b2876ecb183fe55c280404c1c825a6bd1f6ccc87db67e7cfc8bc6336f9b0f SHA512 5d7810360e5eaa8e8ee141fe92c765d9458aa12198a8d0ac702e0630e08d060ad4a1d33690d434f20f5aff79eb200cd8173bebc334c411e340c0198b5d8d1a65 WHIRLPOOL 2564d5622576b89918e247de5dd830011e8ef18a50fd03e6f48e98ebf4a53db2f4994eb0fb22a76c4cd0cbb35b457ac2a5507e05159130a72685866137c5ebc1
+EBUILD netqmail-1.06-r1.ebuild 3690 SHA256 2fcd941b70bf694c9cf93162aba01441b757d822af58365a316312e7aa0469ec SHA512 f609b723de624a87863eb152739439a0ec9fe73ac0f451b3ba0d767e79c94264212db0c67fa6561c6760ef72fa840edca3ad4c3535423f7665ea0d62b3050dac WHIRLPOOL 3c5a654e2ccac13b463e6d8d4edb1c58df48308d34bdf79779ad09262da7c60f42b9ad6d913ab349eaf853f3dec7a31f781f0d40155fe9996645952c3ca0078a
+EBUILD netqmail-1.06-r2.ebuild 3953 SHA256 5e94d61facb4538f6d226c39289827e4acba31cd6cb02556c79d9015b5293274 SHA512 3cffc0efc1d4e2a0aa9c33a67db7c2f2afb000f2b87e87805d1b2a028e3664e49cbea0a03dcfc5903512bb82fddc50d3db6b2df30edd69a7648cc9ccfff7dafa WHIRLPOOL f1b7b7db0610b9bdfb15d4690880b30e50ddc9e9cae8f95ea49aaba47828a8893ad62abba364add9502e80a56b8a5ddffe56a75444553d898bab8dbb92f75123
+EBUILD netqmail-1.06-r3.ebuild 4027 SHA256 f7afb14cdcffc59ffa590417320e37164c3c7468f8bb528d310cedcb52f58c17 SHA512 aff0744852e34f905bdc6f8d2e43faff84af611b4406b823e6e41b6fcaf8336a099620ff766841341a588db7719505a379425b6ecb860b1ffec78732c0d095cd WHIRLPOOL 639199045fb437c3191623137c6014fb859ae4a747b4b5bfe9f20fb677f1aaaed59795931b5c521382a6c79ef68f011721ebb344f5059b72c6ac0fe0ff93fbd9
+EBUILD netqmail-1.06-r4.ebuild 4178 SHA256 ddc0587fbc16e9343d706e56f7c154658db948fc1042eeb17219fc5ab0a6c655 SHA512 e492ab72c3b29fc8ed3e6b14a5ce7cdecda279ad6d37e8dfa9af5f68fc054692a9680220509f984dc78e36e42b790987afb10a361df08b69b04ffc803feebaa0 WHIRLPOOL f428b836b921b6229235653258ac07f27e30247dc5943439881aa7ce8d9a0a65fca0b1b56b19bbc8fa2400e59515f86f792028b4c70aa351a4df3ee391a8cb68
+EBUILD netqmail-1.06-r5.ebuild 4308 SHA256 6bced3f2af4754003535b24fbd42a9d6b3d60ee278ab19f801d557071e3e9feb SHA512 83b4ada94ccd29c97ceb81c97b5f2e932fba156b6b534866853d8cc0cd15853c8e82faaf0ebc32dc535459ff0d3b6391c4660cb108b9165bfefccc8b67577375 WHIRLPOOL 48dada415315330a772cf7d33cdeab4e3eeeefaa8173a14d5e1ccbbee2295d655e740d498cb0b81a368fc20e9a7cc9a63dc6a583ff4de4d5df69680dbabce84a
+EBUILD netqmail-1.06.ebuild 3289 SHA256 92558ca27bd5a4aaab379a64e20702bed7e3e5f1c97117b23bacbe5b414fef52 SHA512 7bee6b14ef4d02650d7e502fcd1d4efbb61a40073ea0b4ded730f6fde4d8a309f24d489b5388b86854237b3d990a5a57d5792d57f2d88ada42492034d6d23d4a WHIRLPOOL 7f8998e6fc043fc52bafafe7a518b123af309bec2d3f25dadb0e1a643bda063ed664023830c835dfe25c764da728faa387d963901afbb4c7c621778326784547
+MISC ChangeLog 3885 SHA256 9d47b49eab81a9e7a3c62b44c4a63499b981cb0e68f59161c7804d1e6e125a1a SHA512 b67ae602ab16213ce98f41f2a2adba4df094214a68b1afae50a68e3c10d55eb8252cd36817dba3ac1c49cd9cdb1c67bcd1c5224721030b042527774c40d1425b WHIRLPOOL 2cc2e0de19a14e9af0bc0d6036db15f1c52c90f2e0ab2db3517a55732cdb7b1a74c7188789d4ace36c8fb0d1faff94fd811c98ec5f962aec1c28065f416728dc
+MISC ChangeLog-2015 11663 SHA256 9abd30bb8b56ccfcbe1a636b6320efc110689af18f2d324c8de36d62770d1d7e SHA512 85f07e8c8e79b4779ab099742fbbb76cb0f7f31a0c7c0ec55a28e6703ae86214a7f9cf950df4830e0d34bf346fc4f38e3964a7ec512b7aabbe080e64cee581a7 WHIRLPOOL 0026b621d7da8e3ea2bde86184a2f8a7f107c5a78d2d481bc80f5467a64c5f2cb27df25c053c501dae0c11331d558dacb6cc4e6a2dee5a963b01ad82dee2fd09
+MISC metadata.xml 555 SHA256 038169531a07406b31f808c87525167cd8e8fbfb32e26e05b3df516172341426 SHA512 dec725506e819558500bc86ce215370a6576bfe47baae06da3e12315fbd0395d2d8237d85e41996d6e5b11878bfe7ed2e1bbeb81061351b3bb9729749f702eba WHIRLPOOL 1ffae1b66096ad0e43a1e274f0c67d480214f39395d8dfb355da1f04df3692c92e017cdea13ea77a8f83c2c2ed9c67a95b986a2b4a1991e93229b6fe007e2c92
diff --git a/mail-mta/netqmail/files/1.06-exit.patch b/mail-mta/netqmail/files/1.06-exit.patch
new file mode 100644
index 000000000000..e0e7dea0f324
--- /dev/null
+++ b/mail-mta/netqmail/files/1.06-exit.patch
@@ -0,0 +1,18 @@
+Index: netqmail-1.06/qmail-pw2u.c
+===================================================================
+--- netqmail-1.06.orig/qmail-pw2u.c
++++ netqmail-1.06/qmail-pw2u.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include "substdio.h"
+Index: netqmail-1.06/qmail-qmtpd.c
+===================================================================
+--- netqmail-1.06.orig/qmail-qmtpd.c
++++ netqmail-1.06/qmail-qmtpd.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "stralloc.h"
+ #include "substdio.h"
+ #include "qmail.h"
diff --git a/mail-mta/netqmail/files/1.06-fbsd-utmpx.patch b/mail-mta/netqmail/files/1.06-fbsd-utmpx.patch
new file mode 100644
index 000000000000..8500eb53e3ee
--- /dev/null
+++ b/mail-mta/netqmail/files/1.06-fbsd-utmpx.patch
@@ -0,0 +1,64 @@
+--- qbiff.c.orig 2010-04-06 08:43:28.000000000 -0300
++++ qbiff.c 2010-04-06 08:44:35.000000000 -0300
+@@ -1,13 +1,6 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <utmp.h>
+-#ifndef UTMP_FILE
+-#ifdef _PATH_UTMP
+-#define UTMP_FILE _PATH_UTMP
+-#else
+-#define UTMP_FILE "/etc/utmp"
+-#endif
+-#endif
++#include <utmpx.h>
+ #include "readwrite.h"
+ #include "stralloc.h"
+ #include "substdio.h"
+@@ -21,15 +14,12 @@
+ #include "env.h"
+ #include "exit.h"
+
+-substdio ssutmp;
+-char bufutmp[sizeof(struct utmp) * 16];
+-int fdutmp;
+ substdio sstty;
+ char buftty[1024];
+ int fdtty;
+
+-struct utmp ut;
+-char line[sizeof(ut.ut_line) + 1];
++struct utmpx *ut;
++char line[sizeof(ut->ut_line) + 1];
+ stralloc woof = {0};
+ stralloc tofrom = {0};
+ stralloc text = {0};
+@@ -64,7 +54,7 @@
+ if (!(user = env_get("USER"))) _exit(0);
+ if (!(sender = env_get("SENDER"))) _exit(0);
+ if (!(userext = env_get("LOCAL"))) _exit(0);
+- if (str_len(user) > sizeof(ut.ut_name)) _exit(0);
++ if (str_len(user) > sizeof(ut->ut_user)) _exit(0);
+
+ if (!stralloc_copys(&tofrom,"*** TO <")) _exit(0);
+ if (!stralloc_cats(&tofrom,userext)) _exit(0);
+@@ -89,15 +79,11 @@
+ if (!stralloc_cat(&woof,&text)) _exit(0);
+ if (!stralloc_cats(&woof,"\015\n")) _exit(0);
+
+- fdutmp = open_read(UTMP_FILE);
+- if (fdutmp == -1) _exit(0);
+- substdio_fdbuf(&ssutmp,read,fdutmp,bufutmp,sizeof(bufutmp));
+-
+- while (substdio_get(&ssutmp,&ut,sizeof(ut)) == sizeof(ut))
+- if (!str_diffn(ut.ut_name,user,sizeof(ut.ut_name)))
++ while ((ut = getutxent()) != NULL)
++ if (ut->ut_type == USER_PROCESS && !str_diffn(ut->ut_user,user,sizeof(ut->ut_user)))
+ {
+- byte_copy(line,sizeof(ut.ut_line),ut.ut_line);
+- line[sizeof(ut.ut_line)] = 0;
++ byte_copy(line,sizeof(ut->ut_line),ut->ut_line);
++ line[sizeof(ut->ut_line)] = 0;
+ if (line[0] == '/') continue;
+ if (!line[0]) continue;
+ if (line[str_chr(line,'.')]) continue;
diff --git a/mail-mta/netqmail/files/1.06-readwrite.patch b/mail-mta/netqmail/files/1.06-readwrite.patch
new file mode 100644
index 000000000000..a2fbe5fe695e
--- /dev/null
+++ b/mail-mta/netqmail/files/1.06-readwrite.patch
@@ -0,0 +1,13 @@
+diff --git a/readwrite.h b/readwrite.h
+index 2a64968..0a641a3 100644
+--- a/readwrite.h
++++ b/readwrite.h
+@@ -1,7 +1,4 @@
+ #ifndef READWRITE_H
+ #define READWRITE_H
+-
+-extern int read();
+-extern int write();
+-
++#include <unistd.h>
+ #endif
diff --git a/mail-mta/netqmail/files/genqmail-20080406-ldflags.patch b/mail-mta/netqmail/files/genqmail-20080406-ldflags.patch
new file mode 100644
index 000000000000..1eb334c259c1
--- /dev/null
+++ b/mail-mta/netqmail/files/genqmail-20080406-ldflags.patch
@@ -0,0 +1,13 @@
+diff -Nuar genqmail-20080406.orig/spp/Makefile genqmail-20080406/spp/Makefile
+--- genqmail-20080406.orig/spp/Makefile 2008-04-06 15:44:14.000000000 +0000
++++ genqmail-20080406/spp/Makefile 2013-05-27 00:37:58.687763457 +0000
+@@ -14,7 +14,7 @@
+ rm -f $(TARGETS)
+
+ $(RESOLV_OBJS):
+- $(CC) $(CFLAGS) -o $@ $@.c -lresolv
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $@.c -lresolv
+
+ $(SIMPLE_OBJS):
+- $(CC) $(CFLAGS) -o $@ $@.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $@.c
diff --git a/mail-mta/netqmail/files/qmail-smtputf8.patch b/mail-mta/netqmail/files/qmail-smtputf8.patch
new file mode 100644
index 000000000000..5b656b9dbd9d
--- /dev/null
+++ b/mail-mta/netqmail/files/qmail-smtputf8.patch
@@ -0,0 +1,242 @@
+This patch adds EAI support to qmail; EAI allows UTF8 almost everywhere in
+email.
+
+Thanks for CNNIC for sponsoring this work.
+
+--- /dev/null
++++ netqmail-1.06/Makefile
+@@ -1446,7 +1446,7 @@ substdio.a error.a str.a fs.a auto_qmail.o dns.lib socket.lib
+ timeoutwrite.o timeoutconn.o tcpto.o now.o dns.o ip.o \
+ ipalloc.o ipme.o quote.o ndelay.a case.a sig.a open.a \
+ lock.a seek.a getln.a stralloc.a alloc.a substdio.a error.a \
+- str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib`
++ str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib` -lidn2
+
+ qmail-remote.0: \
+ qmail-remote.8
+--- /dev/null
++++ netqmail-1.06/qmail-remote.c
+@@ -2,6 +2,7 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#include <idn2.h>
+ #include "sig.h"
+ #include "stralloc.h"
+ #include "substdio.h"
+@@ -42,6 +43,7 @@
+ stralloc routes = {0};
+ struct constmap maproutes;
+ stralloc host = {0};
++stralloc asciihost = {0};
+ stralloc sender = {0};
+
+ saa reciplist = {0};
+@@ -53,12 +55,13 @@
+ # include "tls.h"
+ # include "ssl_timeoutio.h"
+ # include <openssl/x509v3.h>
+-# define EHLO 1
+
+ int tls_init();
+ const char *ssl_err_str = 0;
+ #endif
+
++# define EHLO 1
++
+ void out(s) char *s; { if (substdio_puts(subfdoutsmall,s) == -1) _exit(0); }
+ void zero() { if (substdio_put(subfdoutsmall,"\0",1) == -1) _exit(0); }
+ void zerodie() { zero(); substdio_flush(subfdoutsmall); _exit(0); }
+@@ -156,6 +159,7 @@
+ substdio smtpfrom = SUBSTDIO_FDBUF(saferead,-1,smtpfrombuf,sizeof smtpfrombuf);
+
+ stralloc smtptext = {0};
++stralloc firstpart = {0};
+
+ void get(ch)
+ char *ch;
+@@ -308,6 +312,8 @@
+ int r;
+ char ch;
+
++ substdio_put(&smtpto,firstpart.s,firstpart.len);
++
+ for (;;) {
+ r = substdio_get(&ssin,&ch,1);
+ if (r == 0) break;
+@@ -518,6 +524,88 @@
+
+ stralloc recip = {0};
+
++int containsutf8(p, l) unsigned char * p; int l;
++{
++ int i = 0;
++ while (i<l)
++ if(p[i++] > 127) return 1;
++ return 0;
++}
++
++int utf8message;
++
++void checkutf8message()
++{
++ int pos;
++ int i;
++ int r;
++ char ch;
++ int state;
++
++ if (containsutf8(sender.s, sender.len)) { utf8message = 1; return; }
++ for (i = 0;i < reciplist.len;++i)
++ if (containsutf8(reciplist.sa[i].s, reciplist.sa[i].len)) {
++ utf8message = 1;
++ return;
++ }
++
++ state = 0;
++ pos = 0;
++ for (;;) {
++ r = substdio_get(&ssin,&ch,1);
++ if (r == 0) break;
++ if (r == -1) temp_read();
++
++ if (!stralloc_append(&firstpart,&ch)) temp_nomem();
++
++ if (ch == '\r')
++ continue;
++ if (ch == '\t')
++ ch = ' ';
++
++ switch (state) {
++ case 6: /* in Received, at LF but before WITH clause */
++ if (ch == ' ') { state = 3; pos = 1; continue; }
++ state = 0;
++ /* FALL THROUGH */
++
++ case 0: /* start of header field */
++ if (ch == '\n') return;
++ state = 1;
++ pos = 0;
++ /* FALL THROUGH */
++
++ case 1: /* partway through "Received:" */
++ if (ch != "RECEIVED:"[pos] && ch != "received:"[pos]) { state = 2; continue; }
++ if (++pos == 9) { state = 3; pos = 0; }
++ continue;
++
++ case 2: /* other header field */
++ if (ch == '\n') state = 0;
++ continue;
++
++ case 3: /* in Received, before WITH clause or partway though " with " */
++ if (ch == '\n') { state = 6; continue; }
++ if (ch != " WITH "[pos] && ch != " with "[pos]) { pos = 0; continue; }
++ if (++pos == 6) { state = 4; pos = 0; }
++ continue;
++
++ case 4: /* in Received, having seen with, before the argument */
++ if (pos == 0 && (ch == ' ' || ch == '\t')) continue;
++ if (ch != "UTF8"[pos] && ch != "utf8"[pos]) { state = 5; continue; }
++ if(++pos == 4) { utf8message = 1; state = 5; continue; }
++ continue;
++
++ case 5: /* after the RECEIVED WITH argument */
++ /* blast() assumes that it copies whole lines */
++ if (ch == '\n') return;
++ state = 1;
++ pos = 0;
++ continue;
++ }
++ }
++}
++
+ void smtp()
+ {
+ unsigned long code;
+@@ -571,9 +659,12 @@
+ }
+ #endif
+
++ checkutf8message();
+ substdio_puts(&smtpto,"MAIL FROM:<");
+ substdio_put(&smtpto,sender.s,sender.len);
+- substdio_puts(&smtpto,">\r\n");
++ substdio_puts(&smtpto,">");
++ if (utf8message) substdio_puts(&smtpto," SMTPUTF8");
++ substdio_puts(&smtpto,"\r\n");
+ substdio_flush(&smtpto);
+ code = smtpcode();
+ if (code >= 500) quit("DConnected to "," but sender was rejected");
+@@ -702,9 +793,17 @@
+ relayhost[i] = 0;
+ }
+ if (!stralloc_copys(&host,relayhost)) temp_nomem();
++ } else {
++ char * ascii = 0;
++ host.s[host.len] = '\0';
++ switch (idn2_lookup_u8(host.s, (uint8_t**)&ascii, IDN2_NFC_INPUT)) {
++ case IDN2_OK: break;
++ case IDN2_MALLOC: temp_nomem();
++ default: perm_dns();
++ }
++ if (!stralloc_copys(&asciihost, ascii)) temp_nomem();
+ }
+
+-
+ addrmangle(&sender,argv[2],&flagalias,0);
+
+ if (!saa_readyplus(&reciplist,0)) temp_nomem();
+@@ -723,7 +822,7 @@
+
+
+ random = now() + (getpid() << 16);
+- switch (relayhost ? dns_ip(&ip,&host) : dns_mxip(&ip,&host,random)) {
++ switch (relayhost ? dns_ip(&ip,&host) : dns_mxip(&ip,&asciihost,random)) {
+ case DNS_MEM: temp_nomem();
+ case DNS_SOFT: temp_dns();
+ case DNS_HARD: perm_dns();
+--- /dev/null
++++ netqmail-1.06/qmail-smtpd.c
+@@ -273,6 +273,7 @@
+ stralloc rcptto = {0};
+ stralloc fuser = {0};
+ stralloc mfparms = {0};
++int smtputf8 = 0;
+
+ int mailfrom_size(arg) char *arg;
+ {
+@@ -323,6 +324,7 @@
+ while (len) {
+ arg++; len--;
+ if (*arg == ' ' || *arg == '\0' ) {
++ if (case_starts(mfparms.s,"SMTPUTF8")) smtputf8 = 1;
+ if (case_starts(mfparms.s,"SIZE=")) if (mailfrom_size(mfparms.s+5)) { flagsize = 1; return; }
+ if (case_starts(mfparms.s,"AUTH=")) mailfrom_auth(mfparms.s+5,mfparms.len-5);
+ if (!stralloc_copys(&mfparms,"")) die_nomem;
+@@ -351,7 +353,7 @@
+ out("\r\n250-STARTTLS");
+ #endif
+ size[fmt_ulong(size,(unsigned int) databytes)] = 0;
+- out("\r\n250-PIPELINING\r\n250-8BITMIME\r\n");
++ out("\r\n250-PIPELINING\r\n250-SMTPUTF8\r\n250-8BITMIME\r\n");
+ out("250-SIZE "); out(size); out("\r\n");
+ #ifdef CRAM_MD5
+ out("250 AUTH LOGIN PLAIN CRAM-MD5\r\n");
+@@ -516,7 +518,15 @@
+ if (qmail_open(&qqt) == -1) { err_qqt(); return; }
+ qp = qmail_qp(&qqt);
+ out("354 go ahead\r\n");
+-
++
++ if (smtputf8) {
++ stralloc utf8proto = {0};
++ if ('E' == *protocol) protocol++;
++ if (!stralloc_copys(&utf8proto, "UTF8")) die_nomem();
++ if (!stralloc_cats(&utf8proto, protocol)) die_nomem();
++ utf8proto.s[utf8proto.len] = '\0';
++ protocol = utf8proto.s;
++ }
+ received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,fakehelo);
+ blast(&hops);
+ hops = (hops >= MAXHOPS);
+
diff --git a/mail-mta/netqmail/files/use-new-path-for-functions.sh.patch b/mail-mta/netqmail/files/use-new-path-for-functions.sh.patch
new file mode 100644
index 000000000000..52f3d8e9a957
--- /dev/null
+++ b/mail-mta/netqmail/files/use-new-path-for-functions.sh.patch
@@ -0,0 +1,11 @@
+--- genqmail-20080406.orig/ssl/mkservercert.orig 2015-10-18 12:46:40.082559295 -0200
++++ genqmail-20080406/ssl/mkservercert 2015-10-18 12:49:03.749576181 -0200
+@@ -5,7 +5,7 @@
+ # Based on mkimapdcert from courier-imap.
+
+ test -x /usr/bin/openssl || exit 0
+-source /etc/init.d/functions.sh || exit 1
++source /lib/gentoo/functions.sh || exit 1
+
+ filedir="/var/qmail/control"
+ pemfile="${filedir}/servercert.pem"
diff --git a/mail-mta/netqmail/metadata.xml b/mail-mta/netqmail/metadata.xml
new file mode 100644
index 000000000000..7a28acdda64f
--- /dev/null
+++ b/mail-mta/netqmail/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <use>
+ <flag name="authcram">Enable AUTHCRAM support</flag>
+ <flag name="gencertdaily">Generate SSL certificates daily instead of
+ hourly</flag>
+ <flag name="highvolume">Prepare netqmail for high volume servers</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">qmail-spp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/netqmail/netqmail-1.06-r1.ebuild b/mail-mta/netqmail/netqmail-1.06-r1.ebuild
new file mode 100644
index 000000000000..1ae9ddbc91b1
--- /dev/null
+++ b/mail-mta/netqmail/netqmail-1.06-r1.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+GENQMAIL_PV=20080406
+QMAIL_SPP_PV=0.42
+
+QMAIL_TLS_PV=20070417
+QMAIL_TLS_F=${PN}-1.05-tls-smtpauth-${QMAIL_TLS_PV}.patch
+
+QMAIL_BIGTODO_PV=103
+QMAIL_BIGTODO_F=big-todo.${QMAIL_BIGTODO_PV}.patch
+
+QMAIL_LARGE_DNS='qmail-103.patch'
+
+inherit eutils qmail
+
+DESCRIPTION="qmail -- a secure, reliable, efficient, simple message transfer agent"
+HOMEPAGE="
+ http://netqmail.org
+ http://cr.yp.to/qmail.html
+ http://qmail.org
+"
+SRC_URI="mirror://qmail/${P}.tar.gz
+ https://dev.gentoo.org/~hollow/distfiles/${GENQMAIL_F}
+ http://www.ckdhr.com/ckd/${QMAIL_LARGE_DNS}
+ !vanilla? (
+ highvolume? ( mirror://qmail/${QMAIL_BIGTODO_F} )
+ qmail-spp? ( mirror://sourceforge/qmail-spp/${QMAIL_SPP_F} )
+ ssl? ( http://shupp.org/patches/${QMAIL_TLS_F} )
+ )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="authcram gencertdaily highvolume qmail-spp ssl vanilla"
+REQUIRED_USE='vanilla? ( !ssl !qmail-spp !highvolume )'
+RESTRICT="test"
+
+DEPEND="
+ !mail-mta/qmail
+ net-mail/queue-repair
+ ssl? ( dev-libs/openssl )
+"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ >=sys-apps/ucspi-tcp-0.88-r17
+ ssl? ( >=sys-apps/ucspi-ssl-0.70-r1 )
+ virtual/daemontools
+ >=net-mail/dot-forward-0.71-r3
+ virtual/checkpassword
+ authcram? ( >=net-mail/cmd5checkpw-0.30 )
+ ${DEPEND}
+"
+
+pkg_setup() {
+ if [[ -n "${QMAIL_PATCH_DIR}" ]]; then
+ eerror
+ eerror "The QMAIL_PATCH_DIR variable for custom patches"
+ eerror "has been removed from ${PN}. If you need custom patches"
+ eerror "you should create a copy of this ebuild in an overlay."
+ eerror
+ die "QMAIL_PATCH_DIR is not supported anymore"
+ fi
+
+ qmail_create_users
+}
+
+src_unpack() {
+ genqmail_src_unpack
+ use qmail-spp && qmail_spp_src_unpack
+
+ unpack ${P}.tar.gz
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-exit.patch
+ epatch "${FILESDIR}"/${PV}-readwrite.patch
+ epatch "${DISTDIR}"/${QMAIL_LARGE_DNS}
+
+ ht_fix_file Makefile*
+
+ if ! use vanilla; then
+ # This patch contains relative paths and needs to be cleaned up.
+ sed 's~^--- ../../~--- ~g' \
+ <"${DISTDIR}"/${QMAIL_TLS_F} \
+ >"${T}"/${QMAIL_TLS_F}
+ use ssl && epatch "${T}"/${QMAIL_TLS_F}
+ use highvolume && epatch "${DISTDIR}"/${QMAIL_BIGTODO_F}
+
+ if use qmail-spp; then
+ if use ssl; then
+ epatch "${QMAIL_SPP_S}"/qmail-spp-smtpauth-tls-20060105.diff
+ else
+ epatch "${QMAIL_SPP_S}"/netqmail-spp.diff
+ fi
+ fi
+ fi
+
+ qmail_src_postunpack
+
+ # Fix bug #33818 but for netqmail (Bug 137015)
+ if ! use authcram; then
+ einfo "Disabled CRAM_MD5 support"
+ sed -e 's,^#define CRAM_MD5$,/*&*/,' -i "${S}"/qmail-smtpd.c
+ else
+ einfo "Enabled CRAM_MD5 support"
+ fi
+}
+
+src_compile() {
+ qmail_src_compile
+ use qmail-spp && qmail_spp_src_compile
+}
+
+src_install() {
+ qmail_src_install
+}
+
+pkg_postinst() {
+ qmail_queue_setup
+ qmail_rootmail_fixup
+ qmail_tcprules_build
+
+ qmail_config_notice
+ qmail_supervise_config_notice
+ elog
+ elog "If you are looking for documentation, check those links:"
+ elog "https://wiki.gentoo.org/wiki/Virtual_mail_hosting_with_qmail"
+ elog " -- qmail/vpopmail Virtual Mail Hosting System Guide"
+ elog "http://www.lifewithqmail.com/"
+ elog " -- Life with qmail"
+ elog
+}
+
+pkg_preinst() {
+ qmail_tcprules_fixup
+}
+
+pkg_config() {
+ # avoid some weird locale problems
+ export LC_ALL=C
+
+ qmail_config_fast
+ qmail_tcprules_config
+ qmail_tcprules_build
+
+ use ssl && qmail_ssl_generate
+}
diff --git a/mail-mta/netqmail/netqmail-1.06-r2.ebuild b/mail-mta/netqmail/netqmail-1.06-r2.ebuild
new file mode 100644
index 000000000000..77aa72ee1424
--- /dev/null
+++ b/mail-mta/netqmail/netqmail-1.06-r2.ebuild
@@ -0,0 +1,169 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+GENQMAIL_PV=20080406
+QMAIL_SPP_PV=0.42
+
+QMAIL_TLS_PV=20070417
+QMAIL_TLS_F=${PN}-1.05-tls-smtpauth-${QMAIL_TLS_PV}.patch
+QMAIL_TLS_CVE=vu555316.patch
+
+QMAIL_BIGTODO_PV=103
+QMAIL_BIGTODO_F=big-todo.${QMAIL_BIGTODO_PV}.patch
+
+QMAIL_LARGE_DNS='qmail-103.patch'
+
+inherit eutils qmail
+
+DESCRIPTION="qmail -- a secure, reliable, efficient, simple message transfer agent"
+HOMEPAGE="
+ http://netqmail.org
+ http://cr.yp.to/qmail.html
+ http://qmail.org
+"
+SRC_URI="mirror://qmail/${P}.tar.gz
+ https://dev.gentoo.org/~hollow/distfiles/${GENQMAIL_F}
+ http://www.ckdhr.com/ckd/${QMAIL_LARGE_DNS}
+ http://inoa.net/qmail-tls/${QMAIL_TLS_CVE}
+ !vanilla? (
+ highvolume? ( mirror://qmail/${QMAIL_BIGTODO_F} )
+ qmail-spp? ( mirror://sourceforge/qmail-spp/${QMAIL_SPP_F} )
+ ssl? ( http://shupp.org/patches/${QMAIL_TLS_F} )
+ )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="authcram gencertdaily highvolume qmail-spp ssl vanilla"
+REQUIRED_USE='vanilla? ( !ssl !qmail-spp !highvolume )'
+RESTRICT="test"
+
+DEPEND="
+ !mail-mta/qmail
+ net-mail/queue-repair
+ ssl? ( dev-libs/openssl )
+ sys-apps/groff
+"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ >=sys-apps/ucspi-tcp-0.88-r17
+ ssl? ( >=sys-apps/ucspi-ssl-0.70-r1 )
+ virtual/daemontools
+ >=net-mail/dot-forward-0.71-r3
+ virtual/checkpassword
+ authcram? ( >=net-mail/cmd5checkpw-0.30 )
+ ${DEPEND}
+"
+
+pkg_setup() {
+ if [[ -n "${QMAIL_PATCH_DIR}" ]]; then
+ eerror
+ eerror "The QMAIL_PATCH_DIR variable for custom patches"
+ eerror "has been removed from ${PN}. If you need custom patches"
+ eerror "you should create a copy of this ebuild in an overlay."
+ eerror
+ die "QMAIL_PATCH_DIR is not supported anymore"
+ fi
+
+ qmail_create_users
+}
+
+src_unpack() {
+ genqmail_src_unpack
+ use qmail-spp && qmail_spp_src_unpack
+
+ unpack ${P}.tar.gz
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-exit.patch
+ epatch "${FILESDIR}"/${PV}-readwrite.patch
+ epatch "${DISTDIR}"/${QMAIL_LARGE_DNS}
+ epatch "${FILESDIR}"/${PV}-fbsd-utmpx.patch
+
+ ht_fix_file Makefile*
+
+ if ! use vanilla; then
+ # This patch contains relative paths and needs to be cleaned up.
+ sed 's~^--- ../../~--- ~g' \
+ <"${DISTDIR}"/${QMAIL_TLS_F} \
+ >"${T}"/${QMAIL_TLS_F}
+ use ssl && epatch "${T}"/${QMAIL_TLS_F}
+ use ssl && epatch "${DISTDIR}"/${QMAIL_TLS_CVE}
+ use highvolume && epatch "${DISTDIR}"/${QMAIL_BIGTODO_F}
+
+ if use qmail-spp; then
+ if use ssl; then
+ epatch "${QMAIL_SPP_S}"/qmail-spp-smtpauth-tls-20060105.diff
+ else
+ epatch "${QMAIL_SPP_S}"/netqmail-spp.diff
+ fi
+ cd "${WORKDIR}"
+ epatch "${FILESDIR}"/genqmail-20080406-ldflags.patch
+ cd -
+ fi
+ fi
+
+ qmail_src_postunpack
+
+ # Fix bug #33818 but for netqmail (Bug 137015)
+ if ! use authcram; then
+ einfo "Disabled CRAM_MD5 support"
+ sed -e 's,^#define CRAM_MD5$,/*&*/,' -i "${S}"/qmail-smtpd.c
+ else
+ einfo "Enabled CRAM_MD5 support"
+ fi
+}
+
+src_compile() {
+ qmail_src_compile
+ use qmail-spp && qmail_spp_src_compile
+}
+
+src_install() {
+ qmail_src_install
+}
+
+pkg_postinst() {
+ qmail_queue_setup
+ qmail_rootmail_fixup
+ qmail_tcprules_build
+
+ qmail_config_notice
+ qmail_supervise_config_notice
+ elog
+ elog "If you are looking for documentation, check those links:"
+ elog "https://wiki.gentoo.org/wiki/Virtual_mail_hosting_with_qmail"
+ elog " -- qmail/vpopmail Virtual Mail Hosting System Guide"
+ elog "http://www.lifewithqmail.com/"
+ elog " -- Life with qmail"
+ elog
+}
+
+pkg_preinst() {
+ qmail_tcprules_fixup
+}
+
+pkg_config() {
+ # avoid some weird locale problems
+ export LC_ALL=C
+
+ qmail_config_fast
+ qmail_tcprules_config
+ qmail_tcprules_build
+
+ use ssl && qmail_ssl_generate
+}
diff --git a/mail-mta/netqmail/netqmail-1.06-r3.ebuild b/mail-mta/netqmail/netqmail-1.06-r3.ebuild
new file mode 100644
index 000000000000..d939d63049c3
--- /dev/null
+++ b/mail-mta/netqmail/netqmail-1.06-r3.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+GENQMAIL_PV=20080406
+QMAIL_SPP_PV=0.42
+
+QMAIL_TLS_PV=20070417
+QMAIL_TLS_F=${PN}-1.05-tls-smtpauth-${QMAIL_TLS_PV}.patch
+QMAIL_TLS_CVE=vu555316.patch
+
+QMAIL_BIGTODO_PV=103
+QMAIL_BIGTODO_F=big-todo.${QMAIL_BIGTODO_PV}.patch
+
+QMAIL_LARGE_DNS='qmail-103.patch'
+
+inherit eutils qmail
+
+DESCRIPTION="qmail -- a secure, reliable, efficient, simple message transfer agent"
+HOMEPAGE="
+ http://netqmail.org
+ http://cr.yp.to/qmail.html
+ http://qmail.org
+"
+SRC_URI="mirror://qmail/${P}.tar.gz
+ https://dev.gentoo.org/~hollow/distfiles/${GENQMAIL_F}
+ http://www.ckdhr.com/ckd/${QMAIL_LARGE_DNS}
+ http://inoa.net/qmail-tls/${QMAIL_TLS_CVE}
+ !vanilla? (
+ highvolume? ( mirror://qmail/${QMAIL_BIGTODO_F} )
+ qmail-spp? ( mirror://sourceforge/qmail-spp/${QMAIL_SPP_F} )
+ ssl? ( http://shupp.org/patches/${QMAIL_TLS_F} )
+ )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="authcram gencertdaily highvolume libressl qmail-spp ssl vanilla"
+REQUIRED_USE='vanilla? ( !ssl !qmail-spp !highvolume )'
+RESTRICT="test"
+
+DEPEND="
+ !mail-mta/qmail
+ net-mail/queue-repair
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )
+ sys-apps/groff
+"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ >=sys-apps/ucspi-tcp-0.88-r17
+ ssl? ( >=sys-apps/ucspi-ssl-0.70-r1 )
+ virtual/daemontools
+ >=net-mail/dot-forward-0.71-r3
+ virtual/checkpassword
+ authcram? ( >=net-mail/cmd5checkpw-0.30 )
+ ${DEPEND}
+"
+
+pkg_setup() {
+ if [[ -n "${QMAIL_PATCH_DIR}" ]]; then
+ eerror
+ eerror "The QMAIL_PATCH_DIR variable for custom patches"
+ eerror "has been removed from ${PN}. If you need custom patches"
+ eerror "you should create a copy of this ebuild in an overlay."
+ eerror
+ die "QMAIL_PATCH_DIR is not supported anymore"
+ fi
+
+ qmail_create_users
+}
+
+src_unpack() {
+ genqmail_src_unpack
+ use qmail-spp && qmail_spp_src_unpack
+
+ unpack ${P}.tar.gz
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-exit.patch
+ epatch "${FILESDIR}"/${PV}-readwrite.patch
+ epatch "${DISTDIR}"/${QMAIL_LARGE_DNS}
+ epatch "${FILESDIR}"/${PV}-fbsd-utmpx.patch
+
+ ht_fix_file Makefile*
+
+ if ! use vanilla; then
+ # This patch contains relative paths and needs to be cleaned up.
+ sed 's~^--- ../../~--- ~g' \
+ <"${DISTDIR}"/${QMAIL_TLS_F} \
+ >"${T}"/${QMAIL_TLS_F}
+ use ssl && epatch "${T}"/${QMAIL_TLS_F}
+ use ssl && epatch "${DISTDIR}"/${QMAIL_TLS_CVE}
+ use highvolume && epatch "${DISTDIR}"/${QMAIL_BIGTODO_F}
+
+ if use qmail-spp; then
+ if use ssl; then
+ epatch "${QMAIL_SPP_S}"/qmail-spp-smtpauth-tls-20060105.diff
+ else
+ epatch "${QMAIL_SPP_S}"/netqmail-spp.diff
+ fi
+ cd "${WORKDIR}"
+ epatch "${FILESDIR}"/genqmail-20080406-ldflags.patch
+ cd -
+ fi
+ fi
+
+ qmail_src_postunpack
+
+ # Fix bug #33818 but for netqmail (Bug 137015)
+ if ! use authcram; then
+ einfo "Disabled CRAM_MD5 support"
+ sed -e 's,^#define CRAM_MD5$,/*&*/,' -i "${S}"/qmail-smtpd.c
+ else
+ einfo "Enabled CRAM_MD5 support"
+ fi
+}
+
+src_compile() {
+ qmail_src_compile
+ use qmail-spp && qmail_spp_src_compile
+}
+
+src_install() {
+ qmail_src_install
+}
+
+pkg_postinst() {
+ qmail_queue_setup
+ qmail_rootmail_fixup
+ qmail_tcprules_build
+
+ qmail_config_notice
+ qmail_supervise_config_notice
+ elog
+ elog "If you are looking for documentation, check those links:"
+ elog "https://wiki.gentoo.org/wiki/Virtual_mail_hosting_with_qmail"
+ elog " -- qmail/vpopmail Virtual Mail Hosting System Guide"
+ elog "http://www.lifewithqmail.com/"
+ elog " -- Life with qmail"
+ elog
+}
+
+pkg_preinst() {
+ qmail_tcprules_fixup
+}
+
+pkg_config() {
+ # avoid some weird locale problems
+ export LC_ALL=C
+
+ qmail_config_fast
+ qmail_tcprules_config
+ qmail_tcprules_build
+
+ use ssl && qmail_ssl_generate
+}
diff --git a/mail-mta/netqmail/netqmail-1.06-r4.ebuild b/mail-mta/netqmail/netqmail-1.06-r4.ebuild
new file mode 100644
index 000000000000..7ccc3f851fa5
--- /dev/null
+++ b/mail-mta/netqmail/netqmail-1.06-r4.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+GENQMAIL_PV=20080406
+QMAIL_SPP_PV=0.42
+
+QMAIL_TLS_PV=20070417
+QMAIL_TLS_F=${PN}-1.05-tls-smtpauth-${QMAIL_TLS_PV}.patch
+QMAIL_TLS_CVE=vu555316.patch
+
+QMAIL_BIGTODO_PV=103
+QMAIL_BIGTODO_F=big-todo.${QMAIL_BIGTODO_PV}.patch
+
+QMAIL_LARGE_DNS='qmail-103.patch'
+
+inherit eutils qmail
+
+DESCRIPTION="qmail -- a secure, reliable, efficient, simple message transfer agent"
+HOMEPAGE="
+ http://netqmail.org
+ http://cr.yp.to/qmail.html
+ http://qmail.org
+"
+SRC_URI="mirror://qmail/${P}.tar.gz
+ https://dev.gentoo.org/~hollow/distfiles/${GENQMAIL_F}
+ http://www.ckdhr.com/ckd/${QMAIL_LARGE_DNS}
+ http://inoa.net/qmail-tls/${QMAIL_TLS_CVE}
+ !vanilla? (
+ highvolume? ( mirror://qmail/${QMAIL_BIGTODO_F} )
+ qmail-spp? ( mirror://sourceforge/qmail-spp/${QMAIL_SPP_F} )
+ ssl? ( http://shupp.org/patches/${QMAIL_TLS_F} )
+ )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="authcram gencertdaily highvolume libressl qmail-spp ssl vanilla"
+REQUIRED_USE='vanilla? ( !ssl !qmail-spp !highvolume )'
+RESTRICT="test"
+
+DEPEND="
+ !mail-mta/qmail
+ net-mail/queue-repair
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )
+ sys-apps/gentoo-functions
+ sys-apps/groff
+"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ >=sys-apps/ucspi-tcp-0.88-r17
+ ssl? ( >=sys-apps/ucspi-ssl-0.70-r1 )
+ virtual/daemontools
+ >=net-mail/dot-forward-0.71-r3
+ virtual/checkpassword
+ authcram? ( >=net-mail/cmd5checkpw-0.30 )
+ ${DEPEND}
+"
+
+pkg_setup() {
+ if [[ -n "${QMAIL_PATCH_DIR}" ]]; then
+ eerror
+ eerror "The QMAIL_PATCH_DIR variable for custom patches"
+ eerror "has been removed from ${PN}. If you need custom patches"
+ eerror "you should create a copy of this ebuild in an overlay."
+ eerror
+ die "QMAIL_PATCH_DIR is not supported anymore"
+ fi
+
+ qmail_create_users
+}
+
+src_unpack() {
+ genqmail_src_unpack
+ use qmail-spp && qmail_spp_src_unpack
+
+ unpack ${P}.tar.gz
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-exit.patch
+ epatch "${FILESDIR}"/${PV}-readwrite.patch
+ epatch "${DISTDIR}"/${QMAIL_LARGE_DNS}
+ epatch "${FILESDIR}"/${PV}-fbsd-utmpx.patch
+
+ ht_fix_file Makefile*
+
+ if ! use vanilla; then
+ # This patch contains relative paths and needs to be cleaned up.
+ sed 's~^--- ../../~--- ~g' \
+ <"${DISTDIR}"/${QMAIL_TLS_F} \
+ >"${T}"/${QMAIL_TLS_F} || die
+ use ssl && epatch "${T}"/${QMAIL_TLS_F}
+ use ssl && epatch "${DISTDIR}"/${QMAIL_TLS_CVE}
+ use highvolume && epatch "${DISTDIR}"/${QMAIL_BIGTODO_F}
+
+ if use qmail-spp; then
+ if use ssl; then
+ epatch "${QMAIL_SPP_S}"/qmail-spp-smtpauth-tls-20060105.diff
+ else
+ epatch "${QMAIL_SPP_S}"/netqmail-spp.diff
+ fi
+ cd "${WORKDIR}" || die
+ epatch "${FILESDIR}"/genqmail-20080406-ldflags.patch
+ cd - || die
+ fi
+ fi
+
+ cd "${WORKDIR}" || die
+ epatch "${FILESDIR}"/use-new-path-for-functions.sh.patch
+ cd - || die
+
+ qmail_src_postunpack
+
+ # Fix bug #33818 but for netqmail (Bug 137015)
+ if ! use authcram; then
+ einfo "Disabled CRAM_MD5 support"
+ sed -e 's,^#define CRAM_MD5$,/*&*/,' -i "${S}"/qmail-smtpd.c || die
+ else
+ einfo "Enabled CRAM_MD5 support"
+ fi
+}
+
+src_compile() {
+ qmail_src_compile
+ use qmail-spp && qmail_spp_src_compile
+}
+
+src_install() {
+ qmail_src_install
+}
+
+pkg_postinst() {
+ qmail_queue_setup
+ qmail_rootmail_fixup
+ qmail_tcprules_build
+
+ qmail_config_notice
+ qmail_supervise_config_notice
+ elog
+ elog "If you are looking for documentation, check those links:"
+ elog "https://wiki.gentoo.org/wiki/Virtual_mail_hosting_with_qmail"
+ elog " -- qmail/vpopmail Virtual Mail Hosting System Guide"
+ elog "http://www.lifewithqmail.com/"
+ elog " -- Life with qmail"
+ elog
+}
+
+pkg_preinst() {
+ qmail_tcprules_fixup
+}
+
+pkg_config() {
+ # avoid some weird locale problems
+ export LC_ALL=C
+
+ qmail_config_fast
+ qmail_tcprules_config
+ qmail_tcprules_build
+
+ use ssl && qmail_ssl_generate
+}
diff --git a/mail-mta/netqmail/netqmail-1.06-r5.ebuild b/mail-mta/netqmail/netqmail-1.06-r5.ebuild
new file mode 100644
index 000000000000..54751d00c833
--- /dev/null
+++ b/mail-mta/netqmail/netqmail-1.06-r5.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+GENQMAIL_PV=20080406
+QMAIL_SPP_PV=0.42
+
+QMAIL_TLS_PV=20070417
+QMAIL_TLS_F=${PN}-1.05-tls-smtpauth-${QMAIL_TLS_PV}.patch
+QMAIL_TLS_CVE=vu555316.patch
+
+QMAIL_BIGTODO_PV=103
+QMAIL_BIGTODO_F=big-todo.${QMAIL_BIGTODO_PV}.patch
+
+QMAIL_LARGE_DNS='qmail-103.patch'
+
+QMAIL_SMTPUTF8='qmail-smtputf8.patch'
+
+inherit eutils qmail
+
+DESCRIPTION="qmail -- a secure, reliable, efficient, simple message transfer agent"
+HOMEPAGE="
+ http://netqmail.org
+ http://cr.yp.to/qmail.html
+ http://qmail.org
+"
+SRC_URI="mirror://qmail/${P}.tar.gz
+ https://dev.gentoo.org/~hollow/distfiles/${GENQMAIL_F}
+ http://www.ckdhr.com/ckd/${QMAIL_LARGE_DNS}
+ http://inoa.net/qmail-tls/${QMAIL_TLS_CVE}
+ http://arnt.gulbrandsen.priv.no/qmail/qmail-smtputf8.patch
+ !vanilla? (
+ highvolume? ( mirror://qmail/${QMAIL_BIGTODO_F} )
+ qmail-spp? ( mirror://sourceforge/qmail-spp/${QMAIL_SPP_F} )
+ ssl? ( http://shupp.org/patches/${QMAIL_TLS_F} )
+ )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
+IUSE="authcram gencertdaily highvolume libressl qmail-spp ssl vanilla"
+REQUIRED_USE='vanilla? ( !ssl !qmail-spp !highvolume )'
+RESTRICT="test"
+
+DEPEND="
+ !mail-mta/qmail
+ net-mail/queue-repair
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )
+ sys-apps/gentoo-functions
+ sys-apps/groff
+ net-dns/libidn2
+"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ >=sys-apps/ucspi-tcp-0.88-r17
+ ssl? ( >=sys-apps/ucspi-ssl-0.70-r1 )
+ virtual/daemontools
+ >=net-mail/dot-forward-0.71-r3
+ virtual/checkpassword
+ authcram? ( >=net-mail/cmd5checkpw-0.30 )
+ ${DEPEND}
+"
+
+pkg_setup() {
+ if [[ -n "${QMAIL_PATCH_DIR}" ]]; then
+ eerror
+ eerror "The QMAIL_PATCH_DIR variable for custom patches"
+ eerror "has been removed from ${PN}. If you need custom patches"
+ eerror "you should create a copy of this ebuild in an overlay."
+ eerror
+ die "QMAIL_PATCH_DIR is not supported anymore"
+ fi
+
+ qmail_create_users
+}
+
+src_unpack() {
+ genqmail_src_unpack
+ use qmail-spp && qmail_spp_src_unpack
+
+ unpack ${P}.tar.gz
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-exit.patch
+ epatch "${FILESDIR}"/${PV}-readwrite.patch
+ epatch "${DISTDIR}"/${QMAIL_LARGE_DNS}
+ epatch "${FILESDIR}"/${PV}-fbsd-utmpx.patch
+
+ ht_fix_file Makefile*
+
+ if ! use vanilla; then
+ # This patch contains relative paths and needs to be cleaned up.
+ sed 's~^--- ../../~--- ~g' \
+ <"${DISTDIR}"/${QMAIL_TLS_F} \
+ >"${T}"/${QMAIL_TLS_F} || die
+ use ssl && epatch "${T}"/${QMAIL_TLS_F}
+ use ssl && epatch "${DISTDIR}"/${QMAIL_TLS_CVE}
+ use highvolume && epatch "${DISTDIR}"/${QMAIL_BIGTODO_F}
+
+ if use qmail-spp; then
+ if use ssl; then
+ epatch "${QMAIL_SPP_S}"/qmail-spp-smtpauth-tls-20060105.diff
+ else
+ epatch "${QMAIL_SPP_S}"/netqmail-spp.diff
+ fi
+ cd "${WORKDIR}" || die
+ epatch "${FILESDIR}"/genqmail-20080406-ldflags.patch
+ cd - || die
+ fi
+ fi
+
+ cd "${WORKDIR}" || die
+ epatch "${FILESDIR}"/use-new-path-for-functions.sh.patch
+ epatch "${FILESDIR}"/qmail-smtputf8.patch
+ cd - || die
+
+ qmail_src_postunpack
+
+ # Fix bug #33818 but for netqmail (Bug 137015)
+ if ! use authcram; then
+ einfo "Disabled CRAM_MD5 support"
+ sed -e 's,^#define CRAM_MD5$,/*&*/,' -i "${S}"/qmail-smtpd.c || die
+ else
+ einfo "Enabled CRAM_MD5 support"
+ fi
+}
+
+src_compile() {
+ qmail_src_compile
+ use qmail-spp && qmail_spp_src_compile
+}
+
+src_install() {
+ qmail_src_install
+}
+
+pkg_postinst() {
+ qmail_queue_setup
+ qmail_rootmail_fixup
+ qmail_tcprules_build
+
+ qmail_config_notice
+ qmail_supervise_config_notice
+ elog
+ elog "If you are looking for documentation, check those links:"
+ elog "https://wiki.gentoo.org/wiki/Virtual_mail_hosting_with_qmail"
+ elog " -- qmail/vpopmail Virtual Mail Hosting System Guide"
+ elog "http://www.lifewithqmail.com/"
+ elog " -- Life with qmail"
+ elog
+}
+
+pkg_preinst() {
+ qmail_tcprules_fixup
+}
+
+pkg_config() {
+ # avoid some weird locale problems
+ export LC_ALL=C
+
+ qmail_config_fast
+ qmail_tcprules_config
+ qmail_tcprules_build
+
+ use ssl && qmail_ssl_generate
+}
diff --git a/mail-mta/netqmail/netqmail-1.06.ebuild b/mail-mta/netqmail/netqmail-1.06.ebuild
new file mode 100644
index 000000000000..9860351a1fa0
--- /dev/null
+++ b/mail-mta/netqmail/netqmail-1.06.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+GENQMAIL_PV=20080406
+QMAIL_SPP_PV=0.42
+
+QMAIL_TLS_PV=20070417
+QMAIL_TLS_F=${PN}-1.05-tls-smtpauth-${QMAIL_TLS_PV}.patch
+
+QMAIL_BIGTODO_PV=103
+QMAIL_BIGTODO_F=big-todo.${QMAIL_BIGTODO_PV}.patch
+
+inherit eutils qmail
+
+DESCRIPTION="qmail -- a secure, reliable, efficient, simple message transfer agent"
+HOMEPAGE="
+ http://netqmail.org
+ http://cr.yp.to/qmail.html
+ http://qmail.org
+"
+SRC_URI="mirror://qmail/${P}.tar.gz
+ https://dev.gentoo.org/~hollow/distfiles/${GENQMAIL_F}
+ !vanilla? (
+ highvolume? ( mirror://qmail/${QMAIL_BIGTODO_F} )
+ qmail-spp? ( mirror://sourceforge/qmail-spp/${QMAIL_SPP_F} )
+ ssl? ( http://shupp.org/patches/${QMAIL_TLS_F} )
+ )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="authcram gencertdaily highvolume qmail-spp ssl vanilla"
+RESTRICT="test"
+
+DEPEND="
+ !mail-mta/qmail
+ net-mail/queue-repair
+ ssl? ( dev-libs/openssl )
+"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp
+ >=sys-apps/ucspi-tcp-0.88-r17
+ ssl? ( >=sys-apps/ucspi-ssl-0.70-r1 )
+ virtual/daemontools
+ >=net-mail/dot-forward-0.71-r3
+ virtual/checkpassword
+ authcram? ( >=net-mail/cmd5checkpw-0.30 )
+ ${DEPEND}
+"
+
+pkg_setup() {
+ if [[ -n "${QMAIL_PATCH_DIR}" ]]; then
+ eerror
+ eerror "The QMAIL_PATCH_DIR variable for custom patches"
+ eerror "has been removed from ${PN}. If you need custom patches"
+ eerror "you should create a copy of this ebuild in an overlay."
+ eerror
+ die "QMAIL_PATCH_DIR is not supported anymore"
+ fi
+
+ qmail_create_users
+}
+
+src_unpack() {
+ genqmail_src_unpack
+ use qmail-spp && qmail_spp_src_unpack
+
+ unpack ${P}.tar.gz
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PV}-exit.patch
+ epatch "${FILESDIR}"/${PV}-readwrite.patch
+
+ ht_fix_file Makefile*
+
+ if ! use vanilla; then
+ use ssl && epatch "${DISTDIR}"/${QMAIL_TLS_F}
+ use highvolume && epatch "${DISTDIR}"/${QMAIL_BIGTODO_F}
+
+ if use qmail-spp; then
+ if use ssl; then
+ epatch "${QMAIL_SPP_S}"/qmail-spp-smtpauth-tls-20060105.diff
+ else
+ epatch "${QMAIL_SPP_S}"/netqmail-spp.diff
+ fi
+ fi
+ fi
+
+ qmail_src_postunpack
+
+ # Fix bug #33818 but for netqmail (Bug 137015)
+ if ! use authcram; then
+ einfo "Disabled CRAM_MD5 support"
+ sed -e 's,^#define CRAM_MD5$,/*&*/,' -i "${S}"/qmail-smtpd.c
+ else
+ einfo "Enabled CRAM_MD5 support"
+ fi
+}
+
+src_compile() {
+ qmail_src_compile
+ use qmail-spp && qmail_spp_src_compile
+}
+
+src_install() {
+ qmail_src_install
+}
+
+pkg_postinst() {
+ qmail_queue_setup
+ qmail_rootmail_fixup
+ qmail_tcprules_build
+
+ qmail_config_notice
+ qmail_supervise_config_notice
+ elog
+ elog "If you are looking for documentation, check those links:"
+ elog "https://wiki.gentoo.org/wiki/Virtual_mail_hosting_with_qmail"
+ elog " -- qmail/vpopmail Virtual Mail Hosting System Guide"
+ elog "http://www.lifewithqmail.com/"
+ elog " -- Life with qmail"
+ elog
+}
+
+pkg_preinst() {
+ qmail_tcprules_fixup
+}
+
+pkg_config() {
+ # avoid some weird locale problems
+ export LC_ALL=C
+
+ qmail_config_fast
+ qmail_tcprules_config
+ qmail_tcprules_build
+
+ use ssl && qmail_ssl_generate
+}
diff --git a/mail-mta/nullmailer/Manifest b/mail-mta/nullmailer/Manifest
new file mode 100644
index 000000000000..17f269e1ba04
--- /dev/null
+++ b/mail-mta/nullmailer/Manifest
@@ -0,0 +1,17 @@
+AUX init.d-nullmailer-r4 976 SHA256 f69179b0ba7339726f7d96a42c2c44b540917acad21ff59e6525f1a67113a667 SHA512 e08847554d483e2feb69296747b267585d7960b057ae12f4440a452cb9c1954b5c54bb0d0c4884563b31d83b252a11897cc599a47ec782ea740fc282e9f6c512 WHIRLPOOL 8620220be7402ddfa7a87ad078ffeb52a9d3d9c161a6ec270b136cda9ade04013c63db40f6e757d8d44d0b8c6ceb2aa964047bdccbac4bdb27a9303286c3f60f
+AUX init.d-nullmailer-r5 1132 SHA256 443ad68c5369d44b50e98645617a12841851cc659fef2d0867cfebad6de47f33 SHA512 34a31a53f5f7f1bec4b5cc25bd50e2928cd658360d8430256a5a80a87609a3858a2f2252fce0e5258ac85f1957286c9b449fb1ddb14ace2cfc0dc75cb53aefb9 WHIRLPOOL 567a640ebf7b1cd5fbb58523d79f318d72b6d5ee4c475090320afdaee47948b9dcf908dbf5993cc14ba0e4268d699b66b915c8d57d24e680507157ed3685cb40
+AUX init.d-nullmailer-r6 1180 SHA256 d344491dd6e4164f2b402b3e223e3d52e5457ad858a63f4824060c691713315b SHA512 951313ba50dacfbfef440ad32bb4196e276bbe9fb636f05d8e311bd7bfea8e89f135a8e48c9df797031517125c848421dddb41215553144e384d98587c74be8d WHIRLPOOL 48a135b3e0df04ea7585ded78fdf14d962ab7ac9890056f30bd926a9e4e7ab3080e555d2b88a0f8c2a3431befeb5c461b1e404b3567703d531aec8c4a821513b
+AUX nullmailer-1.13-unistd.h.patch 867 SHA256 bf35fe287b014b75f4eb42d744597a806d40b80b712fb8318ea4408fb6e8219c SHA512 0a46f6a10a380a3b5b1527d60eef768f2e1b94b2848c4d866bf3088f9b1592b3fc464c69d2559309adfae6fc8f46f3897585d736b37947239106090c3449aaf3 WHIRLPOOL eb65af25f5dca3f8aba7dc15c96b3ca5e93472d63d8abb6f1a8c7b570b10bf8deb86c7a690bcacb4cb4300477c5a546caa0625338a42ef31f0acd0ca30914691
+AUX nullmailer.service 401 SHA256 2fe58518b9a024c2136bd6b20cd7bd9458a37f32bc3e6be1203cb5711e8b8ba5 SHA512 5aebb237972a7ff20a34d40d53d8d3146966c8f12b20695aa718831a6b32ecf4a0cc9d5af41067952c454166d02d52226fcb397b48310907b81deaa2d874adb7 WHIRLPOOL f81a87473ce5c4f4717aba023ce62cfb72b6b964b6c34aa7dc25f5826cf5ab41eeeed3d3de329cc6abc662fbd4436a1b5bbb744b09dff4be75cca84e8cf062e0
+AUX remotes.sample-1.13 969 SHA256 0981de9804451f1f66356bd7d48dff637d4732333bf7604fb151aaa9cb5b3485 SHA512 379d307dc28b60e759ebe701d43508b45bc66560879ba2baa30c11c0a57ff67e55151624b5dd67962cb72b22702d14c309f6b6be59a5dd2d030576cb691bcbc6 WHIRLPOOL ef78e7d186f9e4cb43cda4ccc73b6746059805f538f41014f78ebf08caf8a5e0a0cf6f0ebea836c71bd5d59cc5cd9def921b75204bb1566857404fe8b9ac8255
+AUX remotes.sample-2.0 920 SHA256 9a53cfab6326729f6eb29d18ed37b25e1c6f4294f3acb91582fe09d2f38da592 SHA512 21694c7cceb3bdd743e30e2241b5e3293a3ad0fcdc4345d200f2e81c26b72b8a53c6cc3912a4e5f1de6411658a2144803746b44b59d48024cb3de33d72238354 WHIRLPOOL 561da8e776e5a9de1126637edf5bb2f6ede65f63197b7a62869a4dafa544d092a908d9dad42bd2bf5c2b227ce084a56073ad26b4642de1c0b60d905f0357ed2a
+DIST nullmailer-1.13.tar.gz 205431 SHA256 3f8861ebb1b46cea0a1caf1e6236e1e0d2a5a91def19551b7cad12eab676277d SHA512 96dcb3ddecde77a73e5ca1afa5167d35f965d04999f02cc2ef60b54ea7eb7a006e5cf5678fc34a54d4be4f9fd71bd0f784a8671aca40c70dbc307666c548e1d7 WHIRLPOOL b041f7cc33a257fad11c5f4c9bf74f8d849d9c45f0dc19be28268462b9d029c07e1d5802698e647a4208d5f66cac2177a1d12e49a03caac51e0244c3f9a0599c
+DIST nullmailer-2.0.tar.gz 249538 SHA256 d70f4cc4a0c1ff2630d9e2c54c967700d641d06035dd8998a43e616469834f84 SHA512 2a7c914c5effcf796f987256ac68836f0ba875cc7f2da1aeb8f23767e15a556da168b8da5cc52d9f800986883bbdbcd49a9610ae220f463164a906c1d82fbce6 WHIRLPOOL c6ed5dcf5669beff4d440b1862a8155bc414c202382de0d998e76c0d241b7974c255bbfebcee2853ca7997cd239c44b5d472d15a913aa7cd0646bdda9f1797c9
+DIST nullmailer-patches-1.13.tar.xz 8384 SHA256 8685dfbf23e9dc15269b1a0d14f700c4ef990cf49d4e6e830c0217289e8f4733 SHA512 393531e39a92b0978bccbcdf123e05b2cdad1ec8e600825cc24177ba414c1f615995c0344291ebb664f42b384a160c0359fec5ba3308cc14cbc9ceb8577d799c WHIRLPOOL 84f523be7963ceb7fbafd3f5632571e7bc12085b1b4bce5bb5c63871fd6c7ed1367a49ddf5ed66acad7055e28856b23fb1dcb59e60158fed26447128edd0a4fa
+EBUILD nullmailer-1.13-r5.ebuild 4737 SHA256 56bff1acf2a471e476e6c1d53f33639fa4c33f66e1dcf3e00793b8ec1378feae SHA512 e675c290a7d7033afd3cd2f32bac2dc24d87fba0f8deae0ed8ad424930c394c7de0c7ad2a3f5b57a016f071265659ce96c5e7924ab4e5b605a1b86da8d4e611a WHIRLPOOL 74e47b7e554f921e8ed0cb488bb79604a5c948380087b221f3d92c49da983cd2cdabfba04b2cd3ba0405d56b1652a52f058576dd0befc4fbcb70cd608eac4af4
+EBUILD nullmailer-2.0-r1.ebuild 3641 SHA256 b3f02b0141a5b0833b0c19fe8a76fa182d85c11eaaadee307459388e948eff27 SHA512 bd858bf7830066e10c2ef859d8489a0ab124cb7873e327b14d011d286ab5cae94f4e80d86e64dfd13f1204580e6a57bf0495387f6dd361082a874db655bb69f6 WHIRLPOOL 63f1aed05042881f06bc8b065ed8d998ce899aa543aca34d57253b7d12d1edf9e4e7ad446cdeeafa0b251715186b6112f53528674a4a36b9b071c1b721a9ad17
+EBUILD nullmailer-2.0-r2.ebuild 3709 SHA256 d6c195b11cab89ed9f0ffdf1d8a3f60a8cd43cf74a46ba04e6a0810d184f76a8 SHA512 49a5f12cb2810f1d21dbd0cad4d92995a06a32b9e15ab1a341cad12f3afa924a2a47416d8bcf65df3f535b93343c35841386652b315a3ac4d73ab2d427c2ce16 WHIRLPOOL d920137e777906d5038eba130787dfa6d2e954995475e120dffdc94c6ab79bd0c18654cac8a3bf9b5afcf5e7587afecae91a8b9cf56820f5a6b8ecd1f067e68c
+EBUILD nullmailer-2.0.ebuild 3644 SHA256 78b4ab6c86704cad4b280465818dbd055544747c0b1bfd31d2c31f1815d5a249 SHA512 5ac17ea2d17a2967399bdfc87b749d1b152741191b801f6e4fec4a1f6ad1977a2cea9dbabf19a8f62e17a7a32c9d90271fbaa93cd68532a8e6ae41ba126af903 WHIRLPOOL 89d3d36396f0e4fdffd3fa8bf213648923f7d9800eb64fcd47d92563f6e500b647e58fd91cd18866a6e17f3e8e841a0f03805244a2283e43994ccabbd9d6618e
+MISC ChangeLog 4511 SHA256 3e2089086fbcd5dad1df60f101a5cb7e29566d34cf0f5fe1d9f2672d112491e4 SHA512 ba13d38d715c5e8e12a59f64e306a707fd858b957d4fa1a6ceebc5d0392cc853541db35cef0d9926ac3032bfc157202f05d6338957223ec993c16d31dd421c2f WHIRLPOOL 4fd9ff9d37049e03458538447004ee104c799779fb2079ba057c29fe4d86e77195c054c90fb861ae365cb6b43e8bbb540aebc0c224446a9f0f3b3445653c80e6
+MISC ChangeLog-2015 16483 SHA256 aa8fb779e3daec4f15b6a2da59a714a0e2cf79e697b1b3f4d015de0abe54d7e7 SHA512 bae3827e01e05c1de3534a8ea92ac696b3b427b7c0cbab67420ddd368c05ab53e492efd58ada0af4b019e802bafa9591c8f6c3dd73133bbee490f5aea8bcd525 WHIRLPOOL f8cbd937a479acf45707cf8a8c01948f341af6e26e0cc778c066b06ea9a9aa3956d1c80758ff08aac0ff6fc6e0d6daab7d53866d0a4f917ca5d3340b70ccadd6
+MISC metadata.xml 453 SHA256 6cb7eed6b173fc4e2f943bceda73bc62ebcf3e6703c6512a5b28a9c939d80322 SHA512 4e2a68ce12e2297f2853cc378d307771fe930ab8d6178c277504ccb308aa8c680822c90218ea43a6ce953b87b314faf4f51b1897aade664b6ec0915906227ea3 WHIRLPOOL 2679d564605ff495705fa6f80ed73273c0b3f9c69766040b3fee361b5aa0b09c650570e40a0490cbbcefeebd5f33cd607b3783e5eee217206d6c78aee6d9e71a
diff --git a/mail-mta/nullmailer/files/init.d-nullmailer-r4 b/mail-mta/nullmailer/files/init.d-nullmailer-r4
new file mode 100644
index 000000000000..3a6e049f8257
--- /dev/null
+++ b/mail-mta/nullmailer/files/init.d-nullmailer-r4
@@ -0,0 +1,50 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+command="/usr/sbin/nullmailer-send"
+
+start_stop_daemon_args="--chdir /var/nullmailer --user nullmail:nullmail"
+
+required_dirs="/var/nullmailer"
+pidfile="/run/nullmailer.pid"
+command_background="true"
+command_args="-s"
+
+depend() {
+ use net logger
+}
+
+checkconfig() {
+ local error=0
+ local f=/etc/nullmailer/me
+ if [ ! -s ${f} ]; then
+ eerror "${f} does not exist"
+ error=1
+ fi
+ f=/etc/nullmailer/defaultdomain
+ if [ ! -s ${f} ]; then
+ eerror "${f} does not exist"
+ error=1
+ fi
+ if [ ${error} -eq 1 ]; then
+ einfo "You need to run 'emerge --config nullmailer'!"
+ fi
+ if [ -e /service/nullmailer ]; then
+ eerror "Nullmailer is already running under svscan!"
+ error=2
+ fi
+ if [ ${error} -ne 0 ]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+start_pre() {
+ checkconfig
+}
+
+stop_pre() {
+ checkconfig # to avoid init.d stopping svscan instance
+}
diff --git a/mail-mta/nullmailer/files/init.d-nullmailer-r5 b/mail-mta/nullmailer/files/init.d-nullmailer-r5
new file mode 100644
index 000000000000..38ab1319df52
--- /dev/null
+++ b/mail-mta/nullmailer/files/init.d-nullmailer-r5
@@ -0,0 +1,51 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+command="/usr/sbin/nullmailer-send"
+
+start_stop_daemon_args="--chdir /var/spool/nullmailer --user nullmail:nullmail"
+start_stop_daemon_args+=" --stdout /var/log/nullmailer/nullmailer.log"
+start_stop_daemon_args+=" --stderr /var/log/nullmailer/nullmailer.log"
+
+required_dirs="/var/spool/nullmailer /var/log/nullmailer"
+pidfile="/run/nullmailer.pid"
+command_background="true"
+
+depend() {
+ use net logger
+}
+
+checkconfig() {
+ local error=0
+ local f=/etc/nullmailer/me
+ if [ ! -s ${f} ]; then
+ eerror "${f} does not exist"
+ error=1
+ fi
+ f=/etc/nullmailer/defaultdomain
+ if [ ! -s ${f} ]; then
+ eerror "${f} does not exist"
+ error=1
+ fi
+ if [ ${error} -eq 1 ]; then
+ einfo "You need to run 'emerge --config nullmailer'!"
+ fi
+ if [ -e /service/nullmailer ]; then
+ eerror "Nullmailer is already running under svscan!"
+ error=2
+ fi
+ if [ ${error} -ne 0 ]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+start_pre() {
+ checkconfig
+}
+
+stop_pre() {
+ checkconfig # to avoid init.d stopping svscan instance
+}
diff --git a/mail-mta/nullmailer/files/init.d-nullmailer-r6 b/mail-mta/nullmailer/files/init.d-nullmailer-r6
new file mode 100644
index 000000000000..2c24f7e0e228
--- /dev/null
+++ b/mail-mta/nullmailer/files/init.d-nullmailer-r6
@@ -0,0 +1,51 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+command="/usr/sbin/nullmailer-send"
+
+start_stop_daemon_args="--chdir /var/spool/nullmailer --user nullmail:nullmail"
+start_stop_daemon_args="${start_stop_daemon_args} --stdout /var/log/nullmailer/nullmailer.log"
+start_stop_daemon_args="${start_stop_daemon_args} --stderr /var/log/nullmailer/nullmailer.log"
+
+required_dirs="/var/spool/nullmailer /var/log/nullmailer"
+pidfile="/run/nullmailer.pid"
+command_background="true"
+
+depend() {
+ use net logger
+}
+
+checkconfig() {
+ local error=0
+ local f=/etc/nullmailer/me
+ if [ ! -s ${f} ]; then
+ eerror "${f} does not exist"
+ error=1
+ fi
+ f=/etc/nullmailer/defaultdomain
+ if [ ! -s ${f} ]; then
+ eerror "${f} does not exist"
+ error=1
+ fi
+ if [ ${error} -eq 1 ]; then
+ einfo "You need to run 'emerge --config nullmailer'!"
+ fi
+ if [ -e /service/nullmailer ]; then
+ eerror "Nullmailer is already running under svscan!"
+ error=2
+ fi
+ if [ ${error} -ne 0 ]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+start_pre() {
+ checkconfig
+}
+
+stop_pre() {
+ checkconfig # to avoid init.d stopping svscan instance
+}
diff --git a/mail-mta/nullmailer/files/nullmailer-1.13-unistd.h.patch b/mail-mta/nullmailer/files/nullmailer-1.13-unistd.h.patch
new file mode 100644
index 000000000000..8199b9627f47
--- /dev/null
+++ b/mail-mta/nullmailer/files/nullmailer-1.13-unistd.h.patch
@@ -0,0 +1,28 @@
+From 5e9316c669e752fcd9058b28952919bccd967640 Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sat, 31 Jan 2015 23:55:48 +0000
+Subject: [PATCH] lib/fdbuf/fdbuf.h: include <unistd.h>
+
+class fdobuf in lib/fdbuf/fdobuf.h makes use of uid_t and gid_t,
+but these are defined in <unistd.h> according to POSIX. With libc's
+that adhere strictly to standards, like musl, this breaks the build.
+
+We add <unistd.h> to fdbuf.h which is included by fdbuf.h.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+---
+ lib/fdbuf/fdbuf.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/fdbuf/fdbuf.h b/lib/fdbuf/fdbuf.h
+index 4b0e9cb..0054b01 100644
+--- a/lib/fdbuf/fdbuf.h
++++ b/lib/fdbuf/fdbuf.h
+@@ -20,6 +20,7 @@
+ #include "config.h"
+ #include <string.h>
+ #include <fcntl.h>
++#include <unistd.h>
+
+ #ifdef _REENTRANT
+ #include <pthread.h>
diff --git a/mail-mta/nullmailer/files/nullmailer.service b/mail-mta/nullmailer/files/nullmailer.service
new file mode 100644
index 000000000000..8aae6c996d13
--- /dev/null
+++ b/mail-mta/nullmailer/files/nullmailer.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Nullmailer relay-only MTA
+Requires=network.target
+After=local-fs.target syslog.target
+ConditionPathExists=/var/nullmailer/queue
+ConditionPathExists=/etc/nullmailer/defaultdomain
+ConditionPathExists=/etc/nullmailer/me
+
+[Service]
+WorkingDirectory=/var/nullmailer
+ExecStart=/usr/sbin/nullmailer-send -s
+User=nullmail
+Group=nullmail
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-mta/nullmailer/files/remotes.sample-1.13 b/mail-mta/nullmailer/files/remotes.sample-1.13
new file mode 100644
index 000000000000..d04aee24ecb6
--- /dev/null
+++ b/mail-mta/nullmailer/files/remotes.sample-1.13
@@ -0,0 +1,29 @@
+# Format is: HOST PROTOCOL [OPTIONS]
+# HOST = IP or DNS
+# PROTOCOL = smtp | qmtp
+# OPTIONS = [--port=NUMBER] [--user] [--pass] [--starttls | --ssl [--insecure] ]
+#
+# Examples:
+# A standard SMTP server:
+# somesendmailserver.domain.com smtp
+#
+# A qmail server with QMQP setup:
+# someqmailserver.domain.com qmqp
+#
+# A nonstandard SMTP server setup:
+# someotherserver.domain.com smtp --port=2525
+#
+# SMTP server supporting AUTH PLAIN
+# mailserver smtp --user=<user> --pass=<pass>
+#
+# SMTP server supporting AUTH LOGIN
+# mailserver smtp --user=<user> --pass=<pass> --auth-login
+#
+# SMTP server with smtps (legacy - use starttls instead)
+# mailserver smtp --user=<user> --pass=<pass> --port=465 --ssl
+#
+# SMTP server on submission port with starttls
+# mailserver smtp --user=<user> --pass=<pass> --port=587 --starttls
+#
+# SMTP server on submission port with starttls and self-signed certificate
+# mailserver smtp --user=<user> --pass=<pass> --port=587 --starttls --insecure
diff --git a/mail-mta/nullmailer/files/remotes.sample-2.0 b/mail-mta/nullmailer/files/remotes.sample-2.0
new file mode 100644
index 000000000000..59535d691034
--- /dev/null
+++ b/mail-mta/nullmailer/files/remotes.sample-2.0
@@ -0,0 +1,30 @@
+# Format is: HOST PROTOCOL [OPTIONS]
+# HOST = IP or DNS
+# PROTOCOL = smtp | qmtp
+# OPTIONS = [port=NUMBER] [user] [pass] [starttls | ssl [insecure] ]
+#
+# Examples:
+# A standard SMTP server:
+# somesendmailserver.domain.com smtp
+#
+# A qmail server with QMQP setup:
+# someqmailserver.domain.com qmqp
+#
+# A nonstandard SMTP server setup:
+# someotherserver.domain.com smtp port=2525
+#
+# SMTP server supporting AUTH PLAIN
+# mailserver smtp user=<user> pass=<pass>
+#
+# SMTP server supporting AUTH LOGIN
+# mailserver smtp user=<user> pass=<pass> auth-login
+#
+# SMTP server with smtps (legacy - use starttls instead)
+# mailserver smtp user=<user> pass=<pass> port=465 ssl
+#
+# SMTP server on submission port with starttls
+# mailserver smtp user=<user> pass=<pass> port=587 starttls
+#
+# SMTP server on submission port with starttls and self-signed certificate
+# mailserver smtp user=<user> pass=<pass> port=587 starttls insecure
+
diff --git a/mail-mta/nullmailer/metadata.xml b/mail-mta/nullmailer/metadata.xml
new file mode 100644
index 000000000000..43c9702a40b8
--- /dev/null
+++ b/mail-mta/nullmailer/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ <name>Robin H. Johnson</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">bruceg/nullmailer</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/nullmailer/nullmailer-1.13-r5.ebuild b/mail-mta/nullmailer/nullmailer-1.13-r5.ebuild
new file mode 100644
index 000000000000..d43f02ea92b3
--- /dev/null
+++ b/mail-mta/nullmailer/nullmailer-1.13-r5.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic multilib systemd user
+
+MY_P="${P/_rc/RC}"
+
+DEBIAN_PV=1.11
+DEBIAN_PR="2"
+DEBIAN_P="${PN}-${DEBIAN_PV}"
+DEBIAN_PF="${DEBIAN_P/-/_}-${DEBIAN_PR}"
+DEBIAN_SRC="${DEBIAN_PF}.debian.tar.gz"
+
+DESCRIPTION="Simple relay-only local mail transport agent"
+HOMEPAGE="http://untroubled.org/nullmailer/"
+SRC_URI="
+ http://untroubled.org/${PN}/archive/${MY_P}.tar.gz
+ https://dev.gentoo.org/~jlec/distfiles/${PN}-patches-${PV}.tar.xz"
+# mirror://debian/pool/main/n/${PN}/${DEBIAN_SRC}"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 ppc x86"
+IUSE="ssl"
+
+DEPEND="
+ sys-apps/groff
+ ssl? ( net-libs/gnutls )"
+RDEPEND="
+ virtual/logger
+ virtual/shadow
+ ssl? ( net-libs/gnutls )
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !mail-mta/ssmtp"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewgroup nullmail 88
+ enewuser nullmail 88 -1 /var/nullmailer nullmail
+}
+
+src_prepare() {
+# sed -i -e 's/nullmailer-1.10/nullmailer-1.11/g' \
+# "${WORKDIR}"/debian/patches/*.diff || die
+# EPATCH_OPTS="-d ${S} -p1" \
+# epatch "${DISTDIR}"/${DEBIAN_SRC}
+ # why revert? Ask Robin when he is back!
+# EPATCH_OPTS="-d ${WORKDIR} -p0 -R" \
+# epatch "${WORKDIR}"/debian/patches/02_ipv6.diff
+ # this fixes the debian daemon/syslog to actually compile
+
+ # old debian patches from 1.11
+ # DO NOT APPLY patch 0009... It breaks
+ epatch "${WORKDIR}"/patches/000{1..8}*patch
+
+ epatch "${FILESDIR}"/${P}-unistd.h.patch
+
+ sed -i.orig \
+ -e '/^nullmailer_send_LDADD/s, =, = ../lib/cli++/libcli++.a,' \
+ "${S}"/src/Makefile.am || die "Sed failed"
+ sed -i.orig \
+ -e '/\$(localstatedir)\/trigger/d' \
+ "${S}"/Makefile.am || die "Sed failed"
+ sed \
+ -e "s:^AC_PROG_RANLIB:AC_CHECK_TOOL(AR, ar, false)\nAC_PROG_RANLIB:g" \
+ -i configure.in || die
+ sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.in || die
+ eautoreconf
+}
+
+src_configure() {
+ # Note that we pass a different directory below due to bugs in the makefile!
+ econf \
+ --localstatedir=/var \
+ $(use_enable ssl tls)
+}
+
+src_install () {
+ emake DESTDIR="${D}" localstatedir=/var/nullmailer install
+
+ dodoc AUTHORS BUGS HOWTO INSTALL ChangeLog NEWS README TODO
+
+ # A small bit of sample config
+ insinto /etc/nullmailer
+ newins "${FILESDIR}"/remotes.sample-${PV} remotes
+
+ # This contains passwords, so should be secure
+ fperms 0640 /etc/nullmailer/remotes
+ fowners root:nullmail /etc/nullmailer/remotes
+
+ # daemontools stuff
+ dodir /var/nullmailer/service{,/log}
+
+ insinto /var/nullmailer/service
+ newins scripts/nullmailer.run run
+ fperms 700 /var/nullmailer/service/run
+
+ insinto /var/nullmailer/service/log
+ newins scripts/nullmailer-log.run run
+ fperms 700 /var/nullmailer/service/log/run
+
+ # usability
+ dosym /usr/sbin/sendmail usr/$(get_libdir)/sendmail
+
+ # permissions stuff
+ keepdir /var/log/nullmailer /var/nullmailer/{tmp,queue}
+ fperms 770 /var/log/nullmailer /var/nullmailer/{tmp,queue}
+ fowners nullmail:nullmail /usr/sbin/nullmailer-queue /usr/bin/mailq
+ fperms 4711 /usr/sbin/nullmailer-queue /usr/bin/mailq
+
+ newinitd "${FILESDIR}"/init.d-nullmailer-r4 nullmailer
+ systemd_dounit "${FILESDIR}"/${PN}.service
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}"/var/nullmailer/trigger ]; then
+ mkfifo "${ROOT}"/var/nullmailer/trigger
+ fi
+ chown nullmail:nullmail \
+ "${ROOT}"/var/log/nullmailer "${ROOT}"/var/nullmailer/{tmp,queue,trigger} || die
+ chmod 770 "${ROOT}"/var/log/nullmailer "${ROOT}"/var/nullmailer/{tmp,queue} || die
+ chmod 660 "${ROOT}"/var/nullmailer/trigger || die
+
+ # This contains passwords, so should be secure
+ chmod 0640 "${ROOT}"/etc/nullmailer/remotes || die
+ chown root:nullmail "${ROOT}"/etc/nullmailer/remotes || die
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "To create an initial setup, please do:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ fi
+ #echo
+ #elog "To start nullmailer at boot you may use either the nullmailer init.d"
+ #elog "script, or emerge sys-process/supervise-scripts, enable the"
+ #elog "svscan init.d script and create the following link:"
+ #elog "ln -fs /var/nullmailer/service /service/nullmailer"
+ #echo
+}
+
+pkg_postrm() {
+ if [[ -e "${ROOT}"/var/nullmailer/trigger ]]; then
+ rm "${ROOT}"/var/nullmailer/trigger || die
+ fi
+}
+
+pkg_config() {
+ if [ ! -s "${ROOT}"/etc/nullmailer/me ]; then
+ einfo "Setting /etc/nullmailer/me"
+ /bin/hostname --fqdn > "${ROOT}"/etc/nullmailer/me
+ fi
+ if [ ! -s "${ROOT}"/etc/nullmailer/defaultdomain ]; then
+ einfo "Setting /etc/nullmailer/defaultdomain"
+ /bin/hostname --domain > "${ROOT}"/etc/nullmailer/defaultdomain
+ fi
+}
diff --git a/mail-mta/nullmailer/nullmailer-2.0-r1.ebuild b/mail-mta/nullmailer/nullmailer-2.0-r1.ebuild
new file mode 100644
index 000000000000..e13abd28dd3f
--- /dev/null
+++ b/mail-mta/nullmailer/nullmailer-2.0-r1.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic multilib systemd user
+
+DESCRIPTION="Simple relay-only local mail transport agent"
+HOMEPAGE="http://untroubled.org/nullmailer/ https://github.com/bruceg/nullmailer"
+SRC_URI="http://untroubled.org/${PN}/archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="ssl"
+
+DEPEND="
+ sys-apps/groff
+ ssl? ( net-libs/gnutls:0= )"
+RDEPEND="
+ virtual/logger
+ virtual/shadow
+ ssl? ( net-libs/gnutls:0= )
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !mail-mta/ssmtp"
+
+pkg_setup() {
+ enewgroup nullmail 88
+ enewuser nullmail 88 -1 /var/spool/nullmailer nullmail
+}
+
+src_prepare() {
+ default
+ sed -i.orig \
+ -e '/\$(localstatedir)\/trigger/d' \
+ "${S}"/Makefile.am || die "Sed failed"
+ sed \
+ -e "s:^AC_PROG_RANLIB:AC_CHECK_TOOL(AR, ar, false)\nAC_PROG_RANLIB:g" \
+ -i configure.ac || die
+ sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
+ sed \
+ -e "s#/usr/lib#\0exec#" -e "s#/usr/local#/usr#" \
+ -e 's:/usr/etc/:/etc/:g' \
+ -i doc/nullmailer-send.8 || die
+ eautoreconf
+}
+
+src_configure() {
+ # https://github.com/bruceg/nullmailer/pull/31/commits
+ append-lfs-flags #471102
+ econf \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable ssl tls)
+}
+
+src_install() {
+ default
+
+ # A small bit of sample config
+ insinto /etc/nullmailer
+ newins "${FILESDIR}"/remotes.sample-${PV} remotes
+
+ # This contains passwords, so should be secure
+ fperms 0640 /etc/nullmailer/remotes
+ fowners root:nullmail /etc/nullmailer/remotes
+
+ # daemontools stuff
+ dodir /var/spool/nullmailer/service{,/log}
+
+ insinto /var/spool/nullmailer/service
+ newins scripts/nullmailer.run run
+ fperms 700 /var/spool/nullmailer/service/run
+
+ insinto /var/spool/nullmailer/service/log
+ newins scripts/nullmailer-log.run run
+ fperms 700 /var/spool/nullmailer/service/log/run
+
+ # usability
+ dosym /usr/sbin/sendmail usr/$(get_libdir)/sendmail
+
+ # permissions stuff
+ keepdir /var/log/nullmailer /var/spool/nullmailer/{tmp,queue}
+ fperms 770 /var/log/nullmailer
+ fowners nullmail:nullmail /usr/sbin/nullmailer-queue /usr/bin/mailq
+ fperms 4711 /usr/sbin/nullmailer-queue /usr/bin/mailq
+
+ newinitd "${FILESDIR}"/init.d-nullmailer-r6 nullmailer
+ systemd_dounit scripts/${PN}.service
+}
+
+pkg_postinst() {
+ if [ ! -e "${EROOT}var/spool/nullmailer/trigger" ]; then
+ mkfifo "${EROOT}var/spool/nullmailer/trigger" || die
+ fi
+ chown nullmail:nullmail \
+ "${EROOT}"var/log/nullmailer \
+ "${EROOT}"var/spool/nullmailer/{tmp,queue,trigger} || die
+ chmod 770 \
+ "${EROOT}"var/log/nullmailer \
+ "${EROOT}"var/spool/nullmailer/{tmp,queue} || die
+ chmod 660 "${EROOT}"var/spool/nullmailer/trigger || die
+
+ # This contains passwords, so should be secure
+ chmod 0640 "${EROOT}"etc/nullmailer/remotes || die
+ chown root:nullmail "${EROOT}"etc/nullmailer/remotes || die
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "To create an initial setup, please do:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -e "${EROOT}var/spool/nullmailer/trigger" ]]; then
+ rm "${EROOT}var/spool/nullmailer/trigger" || die
+ fi
+}
+
+pkg_config() {
+ if [ ! -s "${EROOT}etc/nullmailer/me" ]; then
+ einfo "Setting /etc/nullmailer/me"
+ hostname --fqdn > "${EROOT}etc/nullmailer/me"
+ fi
+ if [ ! -s "${EROOT}etc/nullmailer/defaultdomain" ]; then
+ einfo "Setting /etc/nullmailer/defaultdomain"
+ hostname --domain > "${EROOT}etc/nullmailer/defaultdomain"
+ fi
+}
diff --git a/mail-mta/nullmailer/nullmailer-2.0-r2.ebuild b/mail-mta/nullmailer/nullmailer-2.0-r2.ebuild
new file mode 100644
index 000000000000..8da57096407f
--- /dev/null
+++ b/mail-mta/nullmailer/nullmailer-2.0-r2.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic multilib systemd user
+
+DESCRIPTION="Simple relay-only local mail transport agent"
+HOMEPAGE="http://untroubled.org/nullmailer/ https://github.com/bruceg/nullmailer"
+SRC_URI="http://untroubled.org/${PN}/archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="ssl test"
+
+DEPEND="
+ sys-apps/groff
+ ssl? ( net-libs/gnutls:0= )
+ test? ( sys-apps/ucspi-tcp[ipv6] sys-process/daemontools )"
+RDEPEND="
+ virtual/logger
+ virtual/shadow
+ ssl? ( net-libs/gnutls:0= )
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !mail-mta/ssmtp"
+
+pkg_setup() {
+ enewgroup nullmail 88
+ enewuser nullmail 88 -1 /var/spool/nullmailer nullmail
+}
+
+src_prepare() {
+ default
+ sed -i.orig \
+ -e '/\$(localstatedir)\/trigger/d' \
+ "${S}"/Makefile.am || die "Sed failed"
+ sed \
+ -e "s:^AC_PROG_RANLIB:AC_CHECK_TOOL(AR, ar, false)\nAC_PROG_RANLIB:g" \
+ -i configure.ac || die
+ sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
+ sed \
+ -e "s#/usr/lib#\0exec#" -e "s#/usr/local#/usr#" \
+ -e 's:/usr/etc/:/etc/:g' \
+ -i doc/nullmailer-send.8 || die
+ eautoreconf
+}
+
+src_configure() {
+ # https://github.com/bruceg/nullmailer/pull/31/commits
+ append-lfs-flags #471102
+ econf \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable ssl tls)
+}
+
+src_install() {
+ default
+
+ # A small bit of sample config
+ insinto /etc/nullmailer
+ newins "${FILESDIR}"/remotes.sample-${PV} remotes
+
+ # This contains passwords, so should be secure
+ fperms 0640 /etc/nullmailer/remotes
+ fowners root:nullmail /etc/nullmailer/remotes
+
+ # daemontools stuff
+ dodir /var/spool/nullmailer/service{,/log}
+
+ insinto /var/spool/nullmailer/service
+ newins scripts/nullmailer.run run
+ fperms 700 /var/spool/nullmailer/service/run
+
+ insinto /var/spool/nullmailer/service/log
+ newins scripts/nullmailer-log.run run
+ fperms 700 /var/spool/nullmailer/service/log/run
+
+ # usability
+ dosym /usr/sbin/sendmail usr/$(get_libdir)/sendmail
+
+ # permissions stuff
+ keepdir /var/log/nullmailer /var/spool/nullmailer/{tmp,queue}
+ fperms 770 /var/log/nullmailer
+ fowners nullmail:nullmail /usr/sbin/nullmailer-queue /usr/bin/mailq
+ fperms 4711 /usr/sbin/nullmailer-queue /usr/bin/mailq
+
+ newinitd "${FILESDIR}"/init.d-nullmailer-r6 nullmailer
+ systemd_dounit scripts/${PN}.service
+}
+
+pkg_postinst() {
+ if [ ! -e "${EROOT}var/spool/nullmailer/trigger" ]; then
+ mkfifo "${EROOT}var/spool/nullmailer/trigger" || die
+ fi
+ chown nullmail:nullmail \
+ "${EROOT}"var/log/nullmailer \
+ "${EROOT}"var/spool/nullmailer/{tmp,queue,trigger} || die
+ chmod 770 \
+ "${EROOT}"var/log/nullmailer \
+ "${EROOT}"var/spool/nullmailer/{tmp,queue} || die
+ chmod 660 "${EROOT}"var/spool/nullmailer/trigger || die
+
+ # This contains passwords, so should be secure
+ chmod 0640 "${EROOT}"etc/nullmailer/remotes || die
+ chown root:nullmail "${EROOT}"etc/nullmailer/remotes || die
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "To create an initial setup, please do:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -e "${EROOT}var/spool/nullmailer/trigger" ]]; then
+ rm "${EROOT}var/spool/nullmailer/trigger" || die
+ fi
+}
+
+pkg_config() {
+ if [ ! -s "${EROOT}etc/nullmailer/me" ]; then
+ einfo "Setting /etc/nullmailer/me"
+ hostname --fqdn > "${EROOT}etc/nullmailer/me"
+ fi
+ if [ ! -s "${EROOT}etc/nullmailer/defaultdomain" ]; then
+ einfo "Setting /etc/nullmailer/defaultdomain"
+ hostname --domain > "${EROOT}etc/nullmailer/defaultdomain"
+ fi
+}
diff --git a/mail-mta/nullmailer/nullmailer-2.0.ebuild b/mail-mta/nullmailer/nullmailer-2.0.ebuild
new file mode 100644
index 000000000000..9fe5b1675081
--- /dev/null
+++ b/mail-mta/nullmailer/nullmailer-2.0.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic multilib systemd user
+
+DESCRIPTION="Simple relay-only local mail transport agent"
+HOMEPAGE="http://untroubled.org/nullmailer/ https://github.com/bruceg/nullmailer"
+SRC_URI="http://untroubled.org/${PN}/archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="ssl"
+
+DEPEND="
+ sys-apps/groff
+ ssl? ( net-libs/gnutls:0= )"
+RDEPEND="
+ virtual/logger
+ virtual/shadow
+ ssl? ( net-libs/gnutls:0= )
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !mail-mta/ssmtp"
+
+pkg_setup() {
+ enewgroup nullmail 88
+ enewuser nullmail 88 -1 /var/spool/nullmailer nullmail
+}
+
+src_prepare() {
+ default
+ sed -i.orig \
+ -e '/\$(localstatedir)\/trigger/d' \
+ "${S}"/Makefile.am || die "Sed failed"
+ sed \
+ -e "s:^AC_PROG_RANLIB:AC_CHECK_TOOL(AR, ar, false)\nAC_PROG_RANLIB:g" \
+ -i configure.ac || die
+ sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
+ sed \
+ -e "s#/usr/lib#\0exec#" -e "s#/usr/local#/usr#" \
+ -e 's:/usr/etc/:/etc/:g' \
+ -i doc/nullmailer-send.8 || die
+ eautoreconf
+}
+
+src_configure() {
+ # https://github.com/bruceg/nullmailer/pull/31/commits
+ append-lfs-flags #471102
+ econf \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable ssl tls)
+}
+
+src_install() {
+ default
+
+ # A small bit of sample config
+ insinto /etc/nullmailer
+ newins "${FILESDIR}"/remotes.sample-${PV} remotes
+
+ # This contains passwords, so should be secure
+ fperms 0640 /etc/nullmailer/remotes
+ fowners root:nullmail /etc/nullmailer/remotes
+
+ # daemontools stuff
+ dodir /var/spool/nullmailer/service{,/log}
+
+ insinto /var/spool/nullmailer/service
+ newins scripts/nullmailer.run run
+ fperms 700 /var/spool/nullmailer/service/run
+
+ insinto /var/spool/nullmailer/service/log
+ newins scripts/nullmailer-log.run run
+ fperms 700 /var/spool/nullmailer/service/log/run
+
+ # usability
+ dosym /usr/sbin/sendmail usr/$(get_libdir)/sendmail
+
+ # permissions stuff
+ keepdir /var/log/nullmailer /var/spool/nullmailer/{tmp,queue}
+ fperms 770 /var/log/nullmailer
+ fowners nullmail:nullmail /usr/sbin/nullmailer-queue /usr/bin/mailq
+ fperms 4711 /usr/sbin/nullmailer-queue /usr/bin/mailq
+
+ newinitd "${FILESDIR}"/init.d-nullmailer-r5 nullmailer
+ systemd_dounit scripts/${PN}.service
+}
+
+pkg_postinst() {
+ if [ ! -e "${EROOT}var/spool/nullmailer/trigger" ]; then
+ mkfifo "${EROOT}var/spool/nullmailer/trigger" || die
+ fi
+ chown nullmail:nullmail \
+ "${EROOT}"var/log/nullmailer \
+ "${EROOT}"var/spool/nullmailer/{tmp,queue,trigger} || die
+ chmod 770 \
+ "${EROOT}"var/log/nullmailer \
+ "${EROOT}"var/spool/nullmailer/{tmp,queue} || die
+ chmod 660 "${EROOT}"var/spool/nullmailer/trigger || die
+
+ # This contains passwords, so should be secure
+ chmod 0640 "${EROOT}"etc/nullmailer/remotes || die
+ chown root:nullmail "${EROOT}"etc/nullmailer/remotes || die
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "To create an initial setup, please do:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -e "${EROOT}var/spool/nullmailer/trigger" ]]; then
+ rm "${EROOT}var/spool/nullmailer/trigger" || die
+ fi
+}
+
+pkg_config() {
+ if [ ! -s "${EROOT}etc/nullmailer/me" ]; then
+ einfo "Setting /etc/nullmailer/me"
+ hostname --fqdn > "${EROOT}etc/nullmailer/me"
+ fi
+ if [ ! -s "${EROOT}etc/nullmailer/defaultdomain" ]; then
+ einfo "Setting /etc/nullmailer/defaultdomain"
+ hostname --domain > "${EROOT}etc/nullmailer/defaultdomain"
+ fi
+}
diff --git a/mail-mta/opensmtpd/Manifest b/mail-mta/opensmtpd/Manifest
new file mode 100644
index 000000000000..6cf7dd9c5ce3
--- /dev/null
+++ b/mail-mta/opensmtpd/Manifest
@@ -0,0 +1,14 @@
+AUX opensmtpd-6.0.2_p1-autoconf.patch 1465 SHA256 32b7554e4a225d61e835e480126a5f19709df87bc28e387c201dd88dfae19874 SHA512 7d8d30c089d72a2581fb65044a1b81140067ee67311cc23e08dd4cf4a9bfe437689c41bac08ab46ae6ca78637ddac29804cdc42c8b94f549d666138d04ae38fd WHIRLPOOL 820b430ceab7c7bac0502c0039946a47e51adad664837b4e16b6cf8e01a338af63355d2841f73fe266fd38c6119fc2dc88ad63a7cf4f5f48a437e67d79188739
+AUX opensmtpd-6.0.2_p1-libressl.patch 3283 SHA256 c7400d7a9d590d8e3814db74a05c3ef3cada1be444ce44a50971202247bac026 SHA512 67b5bb221f10e014749592d24f7681bea6872785fa4a70e4e4b978f94859b527c4999aabb489586f7c19fac182acca450bdfa01af3ebc52c009f723830212058 WHIRLPOOL 88b436fe97b83f2a5cc43647303135a9c2e51babf6874617162c0f4b28a73aa5a648c8f269308d3fdc72fc110ac6444fa0d0768f97aeb1d1533e2007951fd2dd
+AUX opensmtpd-6.0.2_p1-musl.patch 1373 SHA256 fd7d7c89c97f8dc6104eb5ecf0dfe2f2a0e08fd57d60203390a9f9f9ab780099 SHA512 217e7212345f4202bf7e136b2d5b347a9967ea10d15ef50a216bfcd8e4a522076e4ee2044d18a606baf670c0fe6a339951b6381cdb9047730e06987ab7796790 WHIRLPOOL 0b9204ddf862133c58206390d311ef99025d2c337d6c6f5a90d705d49e6efbbe1740e7b44bb9b5cc2ab5dce4bd3aeb88366ccee14f54bd782783d2b03ed6bfba
+AUX smtpd.initd 231 SHA256 b1fb458314e08e16320aba09aa6a41c2c838050bfeefb63a8d428c015352e969 SHA512 e4c8386bd7e8d8171172aa181305a55ca67cba6d4c82d77d8846e1bd3301dd9d118bb39dad6c144677f050194de813e4d83e06ea6dd591d4f07da8c4a1edde37 WHIRLPOOL 30d6d206940c521b07d46550c59fcc90396332cfcfd46dfc2554c782acefb64f17f2c465c4244a6b583be6f4210b0d4c236a995bf15b333e9908e21ee83f5b82
+AUX smtpd.pam 147 SHA256 d8edae7ceb5f5574426127aaa16fa00985f070065407b9de03e1963e9f7aaa58 SHA512 d0574cc732138fefffe3ca78da2d689f0849de70dfd65204c99a98a58b2165eb46b23a1c32b356ea2eaf8abd56a4929c7419b29cec1d6b284e344680bab24086 WHIRLPOOL cb84894bb7c0f8348ad895568dd65864b15190f8f915f4501c0dd8c595fc32cd3430e5616e93286880f61d35b2c3120c731d1d091e69d77e92aeaed8817c169d
+AUX smtpd.service 138 SHA256 928e59e45324677ca44420dd27ce334ba607d78fce1ddd9617b1eeafd9e105af SHA512 b70b173ac275b871d78bac0e55b2e0c8d8a6538c7f2c4dc86fe67fb37a1ee942e0442353b338b286759618299f51b144396251db13f82c9afa035dcaae11a258 WHIRLPOOL ae4d4a67bf038e8af1b4f44f81add190599f775356fc0de1bbfb61a63a41be28b68d8922463d47b61b0a3b4cab2883b867f93137b23ea9fa7e5efbce78d432ad
+AUX smtpd.socket 114 SHA256 0d4e598dcee849b9baf9a35f42c91e49545ffd611cfa425958d159ca3b482785 SHA512 fbbccb4aab80a4a4612609e590965940642321119a65359cf2490530f81d55706a0105309d321a624d40348f12776724d2cf6b8bf29ea24391e60ef8b8bc8ba2 WHIRLPOOL c42d22ef8b6793bdef82e9ac39977e6269676c420c3d2b014426b469bf25f81070023ad62f2d1efaa9e6fa91035e7023cabfca585e10e3ef953671620aa87231
+DIST opensmtpd-6.0.2p1.tar.gz 695513 SHA256 2af9b6d08784c7e546bf124bb61e311a6aa0c9835507710a76f5c242383190ac SHA512 1e4275795dd2c43174ffa268398a0d9864ce4cb7d370330f7b8c55a9b40e757616bbd280919a409ebde403769e3dea62047857dc2ff98d7ecce660b459c7ff1c WHIRLPOOL 105f12d9875e2d4822e71d9c8082b3c7b0e530a05ad762a2175c37afa917268b050dc48ed6bcaf3d708252dd65d432dbe7372669329fe2b5204783499cd2875b
+EBUILD opensmtpd-6.0.2_p1-r1.ebuild 2368 SHA256 332d9b759734eacbc2fbcc90d07448319b70951eb162e7d97cb4252c4586c622 SHA512 101e9ed755711fd5e62621b7db93671d3e0e58ab517eff198fc796dd10f6a07ccdb9e0dbb7633585cb826807718f73f32eb30cf054627c7c39c0a28644c883b0 WHIRLPOOL 0a042935432c596f7024b78fce5ff638ec565342000305676307f0fd59a5c7775a98c43f0781719a6f2e1a2c3bd8e336e8c4927eb38c044586e1815e9baf008d
+EBUILD opensmtpd-6.0.2_p1-r2.ebuild 2539 SHA256 dfce65fe1220a1566ad311737a4be1fb044627d7692def9286d4412ce2f30604 SHA512 f33d00267b27fb722a67f2c18183599eb7e104e72f61dcb40c37ffdf851390316aabbe5cb585ffcb25f769535a4836d1ad7c7a6cc3afda30b6e5b2e446e5dfaf WHIRLPOOL 7797ab58e2dc23a694677d204e1cd10ef4cd30c5fc539620281f5ee307210daab4f34440849d1dcdf82f8cabb931ca35539a2f87057d1cd5badf6dba4a65e30e
+EBUILD opensmtpd-6.0.2_p1.ebuild 2303 SHA256 226ad9b1cd79335724c82fa2b35269bc32ef2ffd8d455f3dc1f1ddc9ddcc173c SHA512 d65f52fc5013bce0a3245f3904261c5e6699c24888140875e177a2c6155172eb78c24abee7ce52fbaca7e238429b115d7871fb40efe292838445d8e213bd0938 WHIRLPOOL 3deaee03932b6fcbc656e922cfca07318135fac32854607e375547084e188a58c150a87ca6daef709af237879849f13510878b4e4ed53eb04c0eb98532635537
+MISC ChangeLog 8369 SHA256 43529e17a993918dfeb0e2b22d8994590c4a20ffec4ee6346d1b24963fdc9be5 SHA512 fa5bf84dbb2ffead55bb283143fb0ffbd3f4f1a7471fb3e474721386c9e2c93caf6be730c8fced254752eb18b7ac3393a6e0cb0075c148fce9e968b941c1ecc7 WHIRLPOOL 5170a1b79ae29de3832d9d45f973d1753c5929d4f7f3e4a5755783119f4efa15a85ee37af8c0013f4e68bd835565a2d6b033b0e9f62e5e6018b3e8296c25a439
+MISC ChangeLog-2015 15548 SHA256 19b97544dc0f0e0852efd7650b90db9a0bc749378c070d742ff54d638a3c7225 SHA512 eb97bae2f989b5a38b24422c4bdcdfa1367e2fe49ba04c7f9a1201380708c17a81aed19be24d173569217c61d8c53af49b294e836c15be8fd1d8183366a1e602 WHIRLPOOL b4355111c00306e8f0a447dcc57a2eaa1cba049301f4be03fd184aef022a0ca509b5ede01abc71023f8207681b59aae1f7b6bc1f5e1efb7afff110a141f7accc
+MISC metadata.xml 595 SHA256 a59caf9a5baa8c23b0a120f0c89c7c4eaae44f8bc9c2f5e25b569c3ce6f28872 SHA512 aa7344806cd011cec6c7afa277345eb2988f11970ea3038d969efa50d5b1f485f199f15a1b632197700791c2242ed8f712ff3cc382b1491e44c14ee94075a1d5 WHIRLPOOL e5705abd19f84b00c63c9011165321b99f62cfe3f09d8b0fb9fa96bf470811374cf8f086d686e8377bf4eba841eceec9f81b02cb88e82ae0b873a313b6ba13f7
diff --git a/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-autoconf.patch b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-autoconf.patch
new file mode 100644
index 000000000000..d490a9029191
--- /dev/null
+++ b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-autoconf.patch
@@ -0,0 +1,46 @@
+From 9370e962bfa1032ab16c48c79977536eae665d75 Mon Sep 17 00:00:00 2001
+From: Freddy DISSAUX <dsx@pouet.bsdsx.fr>
+Date: Sat, 17 Sep 2016 08:50:14 +0200
+Subject: [PATCH] Fix expression, as explain in
+
+https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Generic-Declarations.html#Generic-Declarations
+
+"Unlike the other `AC_CHECK_*S' macros, when a symbol is not
+declared, HAVE_DECL_symbol is defined to `0' instead of
+leaving HAVE_DECL_symbol undeclared."
+---
+ openbsd-compat/defines.h | 2 +-
+ openbsd-compat/openbsd-compat.h | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/openbsd-compat/defines.h b/openbsd-compat/defines.h
+index 0a94d76..bda39e9 100644
+--- a/openbsd-compat/defines.h
++++ b/openbsd-compat/defines.h
+@@ -85,7 +85,7 @@
+ # define STDERR_FILENO 2
+ #endif
+
+-#if defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK == 0
++#if !HAVE_DECL_O_NONBLOCK
+ # define O_NONBLOCK 00004 /* Non Blocking Open */
+ #endif
+
+diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
+index fd931d0..1ef2925 100644
+--- a/openbsd-compat/openbsd-compat.h
++++ b/openbsd-compat/openbsd-compat.h
+@@ -212,11 +212,11 @@ void errc(int, int, const char *, ...);
+ #define pledge(promises, paths) 0
+ #endif
+
+-#ifndef HAVE_DECL_AF_LOCAL
++#if !HAVE_DECL_AF_LOCAL
+ #define AF_LOCAL AF_UNIX
+ #endif
+
+-#ifndef HAVE_DECL_WAIT_MYPGRP
++#if !HAVE_DECL_WAIT_MYPGRP
+ #define WAIT_MYPGRP 0
+ #endif
+
diff --git a/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-libressl.patch b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-libressl.patch
new file mode 100644
index 000000000000..e1656b94040c
--- /dev/null
+++ b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-libressl.patch
@@ -0,0 +1,101 @@
+From f948b923873a93472dea9b786cf60a3472b0ddc8 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Wed, 11 Jan 2017 17:35:29 -0600
+Subject: [PATCH] fix compatibility with libressl
+
+These functions are exported by libcrypto from libressl, due to its
+similar OpenBSD compatibility layer, but they are not present in any
+header files. Thus, while we can use the existing compiled function,
+and do not need to provide our own, we do need to provide the prototype
+for it.
+
+This avoids implicit function declarations and the resulting crashes due
+to pointer truncation.
+
+The patch is based on an equivalent patch for OpenSSH from
+https://bugzilla.mindrot.org/show_bug.cgi?id=2465
+Also see
+https://github.com/libressl-portable/portable/issues/109
+
+Fixes #691
+---
+ openbsd-compat/defines.h | 9 ---------
+ openbsd-compat/openbsd-compat.h | 25 +++++++++++++++----------
+ 2 files changed, 15 insertions(+), 19 deletions(-)
+
+diff --git a/openbsd-compat/defines.h b/openbsd-compat/defines.h
+index 2cbfbca..3ffcc81 100644
+--- a/openbsd-compat/defines.h
++++ b/openbsd-compat/defines.h
+@@ -422,15 +422,6 @@ typedef uint16_t in_port_t;
+ #define INET6_ADDRSTRLEN 46
+ #endif
+
+-/*
+- * Platforms that have arc4random_uniform() and not arc4random_stir()
+- * shouldn't need the latter.
+- */
+-#if defined(HAVE_ARC4RANDOM) && defined(HAVE_ARC4RANDOM_UNIFORM) && \
+- !defined(HAVE_ARC4RANDOM_STIR)
+-# define arc4random_stir()
+-#endif
+-
+ #ifndef HAVE_VA_COPY
+ # ifdef HAVE___VA_COPY
+ # define va_copy(dest, src) __va_copy(dest, src)
+diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
+index a51385b..51f33bb 100644
+--- a/openbsd-compat/openbsd-compat.h
++++ b/openbsd-compat/openbsd-compat.h
+@@ -119,20 +119,25 @@ int BSDoptind; /* index into parent argv vector */
+ int getpeereid(int , uid_t *, gid_t *);
+ #endif
+
+-#ifdef HAVE_ARC4RANDOM
+-# ifndef HAVE_ARC4RANDOM_STIR
+-# define arc4random_stir()
+-# endif
+-#else
++#if !defined(HAVE_ARC4RANDOM) || defined(LIBRESSL_VERSION_NUMBER)
+ unsigned int arc4random(void);
++#endif
++
++#if defined(HAVE_ARC4RANDOM_STIR)
+ void arc4random_stir(void);
+-#endif /* !HAVE_ARC4RANDOM */
++#elif defined(HAVE_ARC4RANDOM) || defined(LIBRESSL_VERSION_NUMBER)
++/* Recent system/libressl implementation; no need for explicit stir */
++# define arc4random_stir()
++#else
++/* openbsd-compat/arc4random.c provides arc4random_stir() */
++void arc4random_stir(void);
++#endif
+
+-#ifndef HAVE_ARC4RANDOM_BUF
++#if !defined(HAVE_ARC4RANDOM_BUF) || defined(LIBRESSL_VERSION_NUMBER)
+ void arc4random_buf(void *, size_t);
+ #endif
+
+-#ifndef HAVE_ARC4RANDOM_UNIFORM
++#if !defined(HAVE_ARC4RANDOM_UNIFORM) || defined(LIBRESSL_VERSION_NUMBER)
+ uint32_t arc4random_uniform(uint32_t);
+ #endif
+
+@@ -174,7 +179,7 @@ int vasprintf(char **, const char *, va_list);
+ int vsnprintf(char *, size_t, const char *, va_list);
+ #endif
+
+-#ifndef HAVE_EXPLICIT_BZERO
++#if !defined(HAVE_EXPLICIT_BZERO) || defined(LIBRESSL_VERSION_NUMBER)
+ void explicit_bzero(void *p, size_t n);
+ #endif
+
+@@ -200,7 +205,7 @@ int pidfile(const char *basename);
+ struct passwd *pw_dup(const struct passwd *);
+ #endif
+
+-#ifndef HAVE_REALLOCARRAY
++#if !defined(HAVE_REALLOCARRAY) || defined(LIBRESSL_VERSION_NUMBER)
+ void *reallocarray(void *, size_t, size_t);
+ #endif
+
diff --git a/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-musl.patch b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-musl.patch
new file mode 100644
index 000000000000..065fbcdbe1a6
--- /dev/null
+++ b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-musl.patch
@@ -0,0 +1,51 @@
+From 2ab442623e689532910b34ff0dbbc2167da02330 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Wed, 11 Jan 2017 17:39:07 -0600
+Subject: [PATCH] fix musl compatibility (missing function prototypes)
+
+inet_net_pton is already compiled, but no prototype is provided.
+res_hnok is provided by the compatibility layer in libasr.
+
+These fixes avoid warnings about implicit function declaration.
+
+Fixes #758
+---
+ configure.ac | 1 +
+ openbsd-compat/openbsd-compat.h | 8 ++++++++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 42e092f..e27c514 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -594,6 +594,7 @@ AC_CHECK_FUNCS([ \
+ pledge \
+ pw_dup \
+ reallocarray \
++ res_hnok \
+ setenv \
+ setlinebuf \
+ setproctitle \
+diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
+index a51385b..5d2e2c2 100644
+--- a/openbsd-compat/openbsd-compat.h
++++ b/openbsd-compat/openbsd-compat.h
+@@ -208,10 +208,18 @@ void *reallocarray(void *, size_t, size_t);
+ void errc(int, int, const char *, ...);
+ #endif
+
++#ifndef HAVE_INET_NET_PTON
++int inet_net_pton(int, const char *, void *, size_t);
++#endif
++
+ #ifndef HAVE_PLEDGE
+ #define pledge(promises, paths) 0
+ #endif
+
++#ifndef HAVE_RES_HNOK
++int res_hnok(const char *);
++#endif
++
+ #if !HAVE_DECL_AF_LOCAL
+ #define AF_LOCAL AF_UNIX
+ #endif
diff --git a/mail-mta/opensmtpd/files/smtpd.initd b/mail-mta/opensmtpd/files/smtpd.initd
new file mode 100644
index 000000000000..cf205a8ea737
--- /dev/null
+++ b/mail-mta/opensmtpd/files/smtpd.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="smtpd"
+pidfile="/run/smtpd.pid"
+description="SMTP daemon from OpenBSD"
+
+depend() {
+ need net
+}
diff --git a/mail-mta/opensmtpd/files/smtpd.pam b/mail-mta/opensmtpd/files/smtpd.pam
new file mode 100644
index 000000000000..a85aeae1e8b3
--- /dev/null
+++ b/mail-mta/opensmtpd/files/smtpd.pam
@@ -0,0 +1,4 @@
+auth required pam_nologin.so
+auth include system-auth
+account include system-auth
+session include system-auth
diff --git a/mail-mta/opensmtpd/files/smtpd.service b/mail-mta/opensmtpd/files/smtpd.service
new file mode 100644
index 000000000000..fd2a65010604
--- /dev/null
+++ b/mail-mta/opensmtpd/files/smtpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=OpenSMTPD
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/smtpd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-mta/opensmtpd/files/smtpd.socket b/mail-mta/opensmtpd/files/smtpd.socket
new file mode 100644
index 000000000000..fb42f8557323
--- /dev/null
+++ b/mail-mta/opensmtpd/files/smtpd.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=OpenSMTPD Socket
+
+[Socket]
+ListenStream=/var/run/smtpd.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/mail-mta/opensmtpd/metadata.xml b/mail-mta/opensmtpd/metadata.xml
new file mode 100644
index 000000000000..4a9db506441f
--- /dev/null
+++ b/mail-mta/opensmtpd/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<longdescription lang="en">
+OpenSMTPD is an implementation of the server-side SMTP protocol as defined by RFC 5321, with some additional standard extensions. It allows ordinary machines to exchange e-mails with other systems speaking the SMTP protocol.
+</longdescription>
+<maintainer type="person">
+<email>zx2c4@gentoo.org</email>
+<name>Jason A. Donenfeld</name>
+</maintainer>
+<use>
+<flag name="mta">Enable this to install as system-wide MTA</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r1.ebuild b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r1.ebuild
new file mode 100644
index 000000000000..a94d5313614c
--- /dev/null
+++ b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib user flag-o-matic eutils pam toolchain-funcs autotools systemd versionator
+
+DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
+HOMEPAGE="http://www.opensmtpd.org/"
+MY_P="${P}"
+if [ $(get_last_version_component_index) -eq 4 ]; then
+ MY_P="${PN}-$(get_version_component_range 4-)"
+fi
+SRC_URI="https://www.opensmtpd.org/archives/${MY_P/_}.tar.gz"
+
+LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="libressl pam +mta"
+
+DEPEND="!libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ sys-libs/zlib
+ pam? ( virtual/pam )
+ sys-libs/db:=
+ dev-libs/libevent
+ app-misc/ca-certificates
+ net-mail/mailbase
+ net-libs/libasr
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp[mta]
+"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P/_}
+
+src_prepare() {
+ # Use /run instead of /var/run
+ sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ tc-export AR
+ AR="$(which "$AR")" econf \
+ --with-table-db \
+ --with-user-smtpd=smtpd \
+ --with-user-queue=smtpq \
+ --with-group-queue=smtpq \
+ --with-path-socket=/run \
+ --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
+ --sysconfdir=/etc/opensmtpd \
+ $(use_with pam auth-pam)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/smtpd.initd smtpd
+ systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
+ use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
+ dosym /usr/sbin/smtpctl /usr/sbin/makemap
+ dosym /usr/sbin/smtpctl /usr/sbin/newaliases
+ if use mta ; then
+ dodir /usr/sbin
+ dosym /usr/sbin/smtpctl /usr/sbin/sendmail
+ dosym /usr/sbin/smtpctl /usr/bin/sendmail
+ dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail
+ fi
+}
+
+pkg_preinst() {
+ enewgroup smtpd 25
+ enewuser smtpd 25 -1 /var/empty smtpd
+ enewgroup smtpq 252
+ enewuser smtpq 252 -1 /var/empty smtpq
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps,"
+ einfo "Redis, and many other useful addons and filters are"
+ einfo "available in the mail-filter/opensmtpd-extras package."
+ einfo
+}
diff --git a/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r2.ebuild b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r2.ebuild
new file mode 100644
index 000000000000..8cd791b1153f
--- /dev/null
+++ b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r2.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib user flag-o-matic eutils pam toolchain-funcs autotools systemd versionator
+
+DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
+HOMEPAGE="http://www.opensmtpd.org/"
+MY_P="${P}"
+if [ $(get_last_version_component_index) -eq 4 ]; then
+ MY_P="${PN}-$(get_version_component_range 4-)"
+fi
+SRC_URI="https://www.opensmtpd.org/archives/${MY_P/_}.tar.gz"
+
+LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="libressl pam +mta"
+
+DEPEND="!libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ elibc_musl? ( sys-libs/fts-standalone )
+ sys-libs/zlib
+ pam? ( virtual/pam )
+ sys-libs/db:=
+ dev-libs/libevent
+ app-misc/ca-certificates
+ net-mail/mailbase
+ net-libs/libasr
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp[mta]
+"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P/_}
+
+src_prepare() {
+ # Use /run instead of /var/run
+ sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
+ epatch "${FILESDIR}"/${P}-autoconf.patch
+ epatch "${FILESDIR}"/${P}-libressl.patch
+ epatch "${FILESDIR}"/${P}-musl.patch
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ tc-export AR
+ AR="$(which "$AR")" econf \
+ --with-table-db \
+ --with-user-smtpd=smtpd \
+ --with-user-queue=smtpq \
+ --with-group-queue=smtpq \
+ --with-path-socket=/run \
+ --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
+ --sysconfdir=/etc/opensmtpd \
+ $(use_with pam auth-pam)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/smtpd.initd smtpd
+ systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
+ use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
+ dosym /usr/sbin/smtpctl /usr/sbin/makemap
+ dosym /usr/sbin/smtpctl /usr/sbin/newaliases
+ if use mta ; then
+ dodir /usr/sbin
+ dosym /usr/sbin/smtpctl /usr/sbin/sendmail
+ dosym /usr/sbin/smtpctl /usr/bin/sendmail
+ dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail
+ fi
+}
+
+pkg_preinst() {
+ enewgroup smtpd 25
+ enewuser smtpd 25 -1 /var/empty smtpd
+ enewgroup smtpq 252
+ enewuser smtpq 252 -1 /var/empty smtpq
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps,"
+ einfo "Redis, and many other useful addons and filters are"
+ einfo "available in the mail-filter/opensmtpd-extras package."
+ einfo
+}
diff --git a/mail-mta/opensmtpd/opensmtpd-6.0.2_p1.ebuild b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1.ebuild
new file mode 100644
index 000000000000..562115d95258
--- /dev/null
+++ b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib user flag-o-matic eutils pam toolchain-funcs autotools systemd versionator
+
+DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
+HOMEPAGE="http://www.opensmtpd.org/"
+MY_P="${P}"
+if [ $(get_last_version_component_index) -eq 4 ]; then
+ MY_P="${PN}-$(get_version_component_range 4-)"
+fi
+SRC_URI="https://www.opensmtpd.org/archives/${MY_P/_}.tar.gz"
+
+LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="pam +mta"
+
+DEPEND="dev-libs/openssl:0
+ sys-libs/zlib
+ pam? ( virtual/pam )
+ sys-libs/db:=
+ dev-libs/libevent
+ app-misc/ca-certificates
+ net-mail/mailbase
+ net-libs/libasr
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp[mta]
+"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P/_}
+
+src_prepare() {
+ # Use /run instead of /var/run
+ sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ tc-export AR
+ AR="$(which "$AR")" econf \
+ --with-table-db \
+ --with-user-smtpd=smtpd \
+ --with-user-queue=smtpq \
+ --with-group-queue=smtpq \
+ --with-path-socket=/run \
+ --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
+ --sysconfdir=/etc/opensmtpd \
+ $(use_with pam auth-pam)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/smtpd.initd smtpd
+ systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
+ use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
+ dosym /usr/sbin/smtpctl /usr/sbin/makemap
+ dosym /usr/sbin/smtpctl /usr/sbin/newaliases
+ if use mta ; then
+ dodir /usr/sbin
+ dosym /usr/sbin/smtpctl /usr/sbin/sendmail
+ dosym /usr/sbin/smtpctl /usr/bin/sendmail
+ dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail
+ fi
+}
+
+pkg_preinst() {
+ enewgroup smtpd 25
+ enewuser smtpd 25 -1 /var/empty smtpd
+ enewgroup smtpq 252
+ enewuser smtpq 252 -1 /var/empty smtpq
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps,"
+ einfo "Redis, and many other useful addons and filters are"
+ einfo "available in the mail-filter/opensmtpd-extras package."
+ einfo
+}
diff --git a/mail-mta/postfix/Manifest b/mail-mta/postfix/Manifest
new file mode 100644
index 000000000000..257c70b851c9
--- /dev/null
+++ b/mail-mta/postfix/Manifest
@@ -0,0 +1,24 @@
+AUX postfix-2.11.1-db6.patch 699 SHA256 90356024954a624306f2f5c8859e6a2a69965f83ca5e0d3d1005c9205bf41181 SHA512 9a6f00ae2d31b732be929ce647c222871704db02c09af659e260cf1a995bbde7f2045c59b9c33520070f427d4a2b377f6193bf6f9971087bf8df7f0c95d6d824 WHIRLPOOL 025a95e18942daf7d8a84a6ab9d17f14800aa34fc29bb5a8694f6667d1215553fe33375ef7e831937362b4b5129f6957ef3d8fd781508b554bfe841971524e15
+AUX postfix-libressl-runtime.patch 3603 SHA256 7bcbb79f5ae01a02c1b438e27c7d982fcd198e77506b82041fd306f1025154c8 SHA512 cdafeff6b47659a6c2ba242550cfe1733cfff2e9d2b03970695e68170d62b3b55b6846b59023f501a2c5b0bb5818b8c0fb8eda63953edcbf35d3bca010d6d88a WHIRLPOOL 0abcdedde85cda3a400dcbca38038a389027f7d726d9fdb0eb67018f5c879b353537f67d53b6cee42bc53ab8757ddca783b6d369ef23750e4a3997e960e0556a
+AUX postfix-libressl.patch 659 SHA256 4228bb29d3f07cabc2a10c72824cf83953e2e6b62aa504caafc6fcb5f0cf89d1 SHA512 fe8aba872f557257c44d14be0eb624414d8dbe172c33e08d8edec5a06c52f0332d7384c9ce588faa49c6c766a1ffc1a6455dee8ef6ee6008f18fa2150407d15e WHIRLPOOL a48659134912bc675a6c6ab1087373d1255434b2e3e82d842ca1ce1722446b5c3f9a4a288433946994bede968f45660b17b4931e0ba729a1e5b7036cc30d522c
+AUX postfix.rc6.2.7 2107 SHA256 34cb4ef8067b9001005931c30ab87be41f47c20ef1185a3afbc86d3d6f01996e SHA512 2ad1b053bbb51d4f480dbf5a01252e8e99a82ec14a75ff49336b2b190ea55bc02400542b109fa0cc4ebfe6b42eaabbc45f70f2ea581f1eb9c4189c439b825592 WHIRLPOOL 8be6f87fa85bee404c0b6cc185773b60a1a8abb36ac6a30a9d73cd819f95e0b7af63cce6956f6d11e171c40e6dbdec30c00f55b5bd617b30fda2acd958d72cfe
+AUX postfix.service 662 SHA256 60e79c0b189d48f341313af55e345014cd4ae5ddf3ed04b2881149f54d0c4e9b SHA512 04b475040b153f488a9358567ff9ee2eb8f263c619dadc23c837d17c19106041296e3652bcaded2be0c7c8b9eee7fd5f2ad55bed3e7f9b3a4bf9655f4762d563 WHIRLPOOL 2861f2b0418c8b7598e8a24f5131fedb9e5d5b8cb280b5dd7f5f620834738cf5cd895aad7cb813ee3f0107a658a2e89edd6b8eade541b57897777157a5410464
+AUX smtp.pass 29 SHA256 21e672c3c46410d713b359d79126961a12d54ceab309fd2c94c5b4f531206167 SHA512 a8a940099a77ea0547004daf5392a6efc0cd643f10072803d65e37763012464ad25b1b925ae9e32bffb3c3e8a5d4b2d3bb5619a174d58fdc4ea5d4090db0d365 WHIRLPOOL 912d0d1b91a88d1e079f8efdab4cc231a0497907c83ad07f22bb90c5479fcf59bc28694a808c1f23dc67fec8fab5e03f28f0fa40106801dabd2da06e0210fb57
+AUX smtp.sasl 42 SHA256 41637ac35a85827e193564b7dbcaa94eafd0206af8ebcd41bcfc48a314416376 SHA512 a48e2bd173c4443dd2c389f6973a541dbcba4223b52b42b409a68d934a7fc82a98d4027267befcd5db6ec628cce6a9dffdf044e6fbd774b6e748f07f4106db47 WHIRLPOOL 0d3132798fbfaa047a3be5b8b1f0a99c2fa22514cdef4908ca7f670210789f432247b4668e063bfe581ad17a4f5ba180e31c5c1e5ed9a0a9ca6417dd14ebd067
+DIST postfix-2.10.9.tar.gz 3820525 SHA256 e47eb56db2d238b9c5a5147a516fa406ab6afb102cedb4bd08273e979ae95d82 SHA512 c77df7ccc051bd72271dc5298da0ca4e45397b1ba96fc8be31e095f5b15cd30ebc0b29cf638e76efc65503cb241efd937f2d64aaa97243402c35e2927b7a7b91 WHIRLPOOL 3a7acb90ae03366e2ed24dfbd2e07619f0694abe098a621c6f9202e4d43a968376b5a52f2a65223634cf921af0a7156b0272ca15ad188a1b61fe4fb9cc97cab7
+DIST postfix-3.1.2.tar.gz 4337569 SHA256 1ab9b4ee6bf9eb37d2467a63244132aab22ac23b91a72f327334e236b0d30f6b SHA512 58493d1890c3235d74a18365294ca764bd3b3f278b9825da931005165af60250342c6cf477c3b3575e50858d99cd3ee40f22bece094eb61e9be6c3cf0313d571 WHIRLPOOL 37e90ef6275a7f2dc8f712bb05348861098697438f274a5c5b69f50b31d55574af262a658657863c93f77fdeba2d37bf7b30dc43bf1629615f496ede19a89c00
+DIST postfix-3.1.6.tar.gz 4341308 SHA256 e5eb005fd133c6a32ca03e796e0192945eb877be8eb727f30d25547c997c5aa6 SHA512 646317393d33fcec99bef7f3dc142a847591927bc034c0c71e578baedad1875040cfeabdaa3436312f60485cb69bbdb31197aa9e7526a457946d7749b781099b WHIRLPOOL 66a087da3b33353a22176b9162fe0679f8ff35e48ae693a3315d52232e662638d48b8827648c0b0368e018161e1ade6a671773c109208ded9659cca26b1b5ea1
+DIST postfix-3.2.2.tar.gz 4390318 SHA256 d06849418d119d09366997b2b481bb23f737629769b4e4a52da42fb3ad8b0576 SHA512 9432fa8b181db99b8e2d72b2a0f640d1456b10c42615f0a002638f7f788d748b8bb55cd36409a368ac4f6d22033d1d059728fa33980fb93d465b6dfd5ae26418 WHIRLPOOL 7681299ffb747316f1366350f5fac5cf5f156ed9681a26ec6ed5dca0ab42a6a95f93e943bd6ccaccac259c2f7dd1cd1ba441a8968a8988d59ac2208fdbb2f480
+DIST postfix-3.2.3.tar.gz 4390567 SHA256 5b0b975d075ea7561028d4109c581549b794aa92d733429ea6d9fa57751140bf SHA512 99ea74a5a0620e739668e55d620a0370b72c4802983a8a4cf4d6c51c6f8f5573128f2d6869386cedadba66b3f741df2f18867a059facd94092ac95f6da3a600c WHIRLPOOL d77c3490b81a43dcb54c7d72c88a62f1d632f00bd37be6969aa16def98877c4761c35cba53672a3aec701b14931d2a4c20c2ed4e4fff4876b1c74d4ac03f4b8d
+DIST postfix-3.3-20170924.tar.gz 4397375 SHA256 b9b8a2dd43cf1ae0002d815946d1f765b775a983ccf3bfbe7c2cae43e3677032 SHA512 10a400fcf2aa8a64f6952e7f66a2076ff6c507d59be015e4e08c1a6d234adb2909ba13bb4323109e5e98a1deea6690b6a0aaba934f47233bccec56de372d484a WHIRLPOOL bb51197c3706061fbb88d8635003e8d37a4070ca2778c4b5a56c5d531a98ed2db837c9c05ee5318dfeee5372263732b30de3792b645a681840c7dd94a01ba023
+DIST postfix-vda-v13-2.10.0.patch 55701 SHA256 6208021eb0b37ac6482e334e538ed5700cc22c4d4dd66ed9e975ae5f20bf935f SHA512 0b4b53a8cd28abf56eee3b2ed63ca1814251b60816e6ca1143249d25fd6ef7f905bec3134125ac6e851af685db8aae878012113693261529ae2ddbcf1bd93e62 WHIRLPOOL d98b7d2177b8b69738086880fd08c336fa60b99ff7413624e628fd5f17be2064f2ccaa37c047d3013ed41c0ff1bcb76e7962f8390c4179f28ab11733dd3b59d3
+EBUILD postfix-2.10.9.ebuild 8736 SHA256 302ad9f6743a3c50d182a719aeeaa98f3fca34e4e1a19cce2aef0e8443bbfc18 SHA512 09a64554311b5b5c7395770329eb44cf80d3f3e9197adefbb304214feb9ff3d4df9e3d3376b3b4e87f329281e1fb4e03bfb7b3bbfbae463384031b3810e011d0 WHIRLPOOL 06645fdb9da24848cd50241cb67ebfc06d2164c9257d2f665ffc3bba1fb07eb54d9062e0b7c09053a45b6c66c1b2562f07cba0d7d7e6800a1dd5358d7925ee70
+EBUILD postfix-3.1.2-r2.ebuild 8661 SHA256 510503309cf92b68251f60d1291c52374146b8dd6d1fa854aab9913241fb6a4c SHA512 6174266e057ca6110d39c76f6bd6d11fa24f40641599a90c143aa9396822d1cc2b3e72b7de94e849c913c5d34bf3dd081f29feedb41b2bfc349a6e567381550d WHIRLPOOL 77088bc694eed3f4fb385c8322d8dd2b64dccfe53e3ee092a04c0928772937aa1597ec4d05bc64ed8dc1551b7ebf5914af1558ca1f49c67f7861df8189b61ef1
+EBUILD postfix-3.1.6.ebuild 8661 SHA256 510503309cf92b68251f60d1291c52374146b8dd6d1fa854aab9913241fb6a4c SHA512 6174266e057ca6110d39c76f6bd6d11fa24f40641599a90c143aa9396822d1cc2b3e72b7de94e849c913c5d34bf3dd081f29feedb41b2bfc349a6e567381550d WHIRLPOOL 77088bc694eed3f4fb385c8322d8dd2b64dccfe53e3ee092a04c0928772937aa1597ec4d05bc64ed8dc1551b7ebf5914af1558ca1f49c67f7861df8189b61ef1
+EBUILD postfix-3.2.2.ebuild 8669 SHA256 9687e72b0923ccceb2e83d9112b4924072d36fe5eae780a9dd5fabefa257e2c3 SHA512 094bd11212903bfcbf678698765da8f72ed3b34562aca398d47e90d3a2ae7ef252bc29eead3bb92eebe46a7dc2aa4e615dc3b85ec192c6d6872c2370fe99a11a WHIRLPOOL 59edd5b583c3fd6a98d60fe2a6f3dfa0bd0fb924f5721a6c2577a03820c8debf3552f26f75e1b04cbc3c69c605af249e4010824270e6cbf0d1538b44dfaa84fd
+EBUILD postfix-3.2.3.ebuild 8669 SHA256 9687e72b0923ccceb2e83d9112b4924072d36fe5eae780a9dd5fabefa257e2c3 SHA512 094bd11212903bfcbf678698765da8f72ed3b34562aca398d47e90d3a2ae7ef252bc29eead3bb92eebe46a7dc2aa4e615dc3b85ec192c6d6872c2370fe99a11a WHIRLPOOL 59edd5b583c3fd6a98d60fe2a6f3dfa0bd0fb924f5721a6c2577a03820c8debf3552f26f75e1b04cbc3c69c605af249e4010824270e6cbf0d1538b44dfaa84fd
+EBUILD postfix-3.3_pre20170924.ebuild 8764 SHA256 2a1c92f279a0f032c8c6c4aeee1cb29cb24fd899c2ac8b190ffd2c2cb832515d SHA512 7dc624549c5bec88a509372e63256604ce3e899a093508fff914afe7d4a698a0e9c941f9b8fe97fa162eec197d9b3488c4a665822689cc5cfa1686b20ba918f7 WHIRLPOOL a88e2afdffb1469a70149a0702b7bd0dc5512d56128cf61628afa4d6078da26531ff46bd60fe919432bb2b7cb897035f3cf7a556a39ac4ee170b4b24e9dbc7f7
+MISC ChangeLog 19025 SHA256 5001d12e2ccd9bfe9527f6a1c745def53e8cabe9ad88e123ad8d0501d9eb7b35 SHA512 cd9dd569368918afd225460e7a2302677144e622f3c7ee0a919f136828f0038bd19e527e102ca6a0fc8592a199a816048fa47f98820b51bb5c465b5bb00abcd6 WHIRLPOOL a69a4c66a2d2360b93c86c7fb96cd2e72baf982ee7e14a9f24283fdd162263517064bcbd4364c978614fe80abe5389c8836504e3dfa2f0a48dfaa5b109f01f58
+MISC ChangeLog-2013 100301 SHA256 439e93c3f6ea08471888157d2347da51181aa9031d4bfdeef2197a6b26680246 SHA512 c678433163e86def50d59e47d7a1a0e8f4c4af860f80932255a7c95544e1f5b55a70b68905b02a417b2332bcf3aaa59281814d8504d70085f0874a23faa2bf02 WHIRLPOOL 15a12897a576cf98d856c551157b72b47aa45fd61d05c6ed55033ce37ce247045c6bcc8143b7ccce4666900d85e0a04087c977a311e31c20f554a991bec74fbc
+MISC ChangeLog-2015 17803 SHA256 262aa42c56ee443bd557a915e2d5d94f40ab8d674fa7c29e95694f92914bbb43 SHA512 e3985cce53eb10bb6d01494215e37be851b52db3cea7b62db1dd238b793f52f96b302e89b965cd98ae6cea020d1a6c5624d57e98cbd5fc2195faec1b9942d851 WHIRLPOOL ddeab5f49397ddf6d1e48febbcac95a5b5103fbdcd4059a40edd9e9737158aa731073961d058fcc592c3e54ce82941361aeaf6fe4ec8e8557d9a02b1295ecde3
+MISC metadata.xml 903 SHA256 85c9f9a8918c810aeeaea22c6a684ddd1092b68487e419749df37cc5eac50183 SHA512 3159041e80f1b045d9beda6f517be0acd5a5eaca4b979e7ae2d27f6d7cc07ad83ba55a9e78b718689c9d6fff780e77d9b0c8275a1dec96bd84d2cd184d86662d WHIRLPOOL da9f216ced9632d5267ae3125a26804f492cec55bbb9505d0e75ca8cad9b0c02dd0a90c46283caa52017abbce321ea39f4e7930d657199ce0f21bfb3ed29c9b4
diff --git a/mail-mta/postfix/files/postfix-2.11.1-db6.patch b/mail-mta/postfix/files/postfix-2.11.1-db6.patch
new file mode 100644
index 000000000000..5f5cad406b0c
--- /dev/null
+++ b/mail-mta/postfix/files/postfix-2.11.1-db6.patch
@@ -0,0 +1,12 @@
+--- src/util/dict_db.c 2012-01-25 00:41:08.000000000 +0000
++++ src/util/dict_db.c 2014-06-25 18:56:10.000000000 +0000
+@@ -693,7 +688,8 @@
+ msg_fatal("set DB cache size %d: %m", dict_db_cache_size);
+ if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
+ msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM);
+-#if DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0)
++#if DB_VERSION_MAJOR == 6 || DB_VERSION_MAJOR == 5 || \
++ (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0)
+ if ((errno = db->open(db, 0, db_path, 0, type, db_flags, 0644)) != 0)
+ FREE_RETURN(dict_surrogate(class, path, open_flags, dict_flags,
+ "open database %s: %m", db_path));
diff --git a/mail-mta/postfix/files/postfix-libressl-runtime.patch b/mail-mta/postfix/files/postfix-libressl-runtime.patch
new file mode 100644
index 000000000000..814088610a8d
--- /dev/null
+++ b/mail-mta/postfix/files/postfix-libressl-runtime.patch
@@ -0,0 +1,102 @@
+--- src/posttls-finger/posttls-finger.c.orig 2016-08-27 20:27:50 UTC
++++ src/posttls-finger/posttls-finger.c
+@@ -1511,7 +1511,8 @@ static int finger(STATE *state)
+ return (0);
+ }
+
+-#if defined(USE_TLS) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(USE_TLS) && \
++ ( OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) )
+
+ /* ssl_cleanup - free memory allocated in the OpenSSL library */
+
+@@ -1958,7 +1959,8 @@ int main(int argc, char *argv[])
+ cleanup(&state);
+
+ /* OpenSSL 1.1.0 and later (de)initialization is implicit */
+-#if defined(USE_TLS) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(USE_TLS) && \
++ ( OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) )
+ ssl_cleanup();
+ #endif
+
+--- src/tls/tls_client.c.orig 2016-08-27 20:27:50 UTC
++++ src/tls/tls_client.c
+@@ -299,7 +299,7 @@ TLS_APPL_STATE *tls_client_init(const TL
+ */
+ tls_check_version();
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ /*
+ * Initialize the OpenSSL library by the book! To start with, we must
+@@ -441,7 +441,7 @@ TLS_APPL_STATE *tls_client_init(const TL
+ /*
+ * 2015-12-05: Ephemeral RSA removed from OpenSSL 1.1.0-dev
+ */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ /*
+ * According to the OpenSSL documentation, temporary RSA key is needed
+--- src/tls/tls_dane.c.orig 2016-08-27 20:27:50 UTC
++++ src/tls/tls_dane.c
+@@ -2163,7 +2163,7 @@ static SSL_CTX *ctx_init(const char *CAf
+ tls_param_init();
+ tls_check_version();
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ SSL_load_error_strings();
+ SSL_library_init();
+ #endif
+--- src/tls/tls_rsa.c.orig 2016-01-03 14:49:51 UTC
++++ src/tls/tls_rsa.c
+@@ -57,7 +57,7 @@
+ /*
+ * 2015-12-05: Ephemeral RSA removed from OpenSSL 1.1.0-dev
+ */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ /* tls_tmp_rsa_cb - call-back to generate ephemeral RSA key */
+
+@@ -109,7 +109,7 @@ int main(int unused_argc, char *cons
+ /*
+ * 2015-12-05: Ephemeral RSA removed from OpenSSL 1.1.0-dev
+ */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ RSA *rsa;
+
+ msg_vstream_init(argv[0], VSTREAM_ERR);
+--- src/tls/tls_server.c.orig 2016-08-27 20:27:50 UTC
++++ src/tls/tls_server.c
+@@ -174,7 +174,7 @@ static const char server_session_id_cont
+ #endif /* OPENSSL_VERSION_NUMBER */
+
+ /* OpenSSL 1.1.0 bitrot */
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ typedef const unsigned char *session_id_t;
+
+ #else
+@@ -377,7 +377,7 @@ TLS_APPL_STATE *tls_server_init(const TL
+ */
+ tls_check_version();
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ /*
+ * Initialize the OpenSSL library by the book! To start with, we must
+@@ -588,7 +588,7 @@ TLS_APPL_STATE *tls_server_init(const TL
+ /*
+ * 2015-12-05: Ephemeral RSA removed from OpenSSL 1.1.0-dev
+ */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ /*
+ * According to OpenSSL documentation, a temporary RSA key is needed when
diff --git a/mail-mta/postfix/files/postfix-libressl.patch b/mail-mta/postfix/files/postfix-libressl.patch
new file mode 100644
index 000000000000..ce047b760399
--- /dev/null
+++ b/mail-mta/postfix/files/postfix-libressl.patch
@@ -0,0 +1,17 @@
+OpenBSD patch at:
+http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/mail/postfix/snapshot/patches/patch-src_tls_tls_h
+$OpenBSD: patch-src_tls_tls_h,v 1.2 2016/02/25 09:39:49 sthen Exp $
+
+Fix building with LibreSSL
+
+--- src/tls/tls.h.orig Sat Feb 6 15:09:41 2016
++++ src/tls/tls.h Sun Feb 14 19:54:38 2016
+@@ -89,7 +89,7 @@ extern const char *str_tls_level(int);
+ #endif
+
+ /* Backwards compatibility with OpenSSL < 1.1.0 */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #define OpenSSL_version_num SSLeay
+ #define OpenSSL_version SSLeay_version
+ #define OPENSSL_VERSION SSLEAY_VERSION
diff --git a/mail-mta/postfix/files/postfix.rc6.2.7 b/mail-mta/postfix/files/postfix.rc6.2.7
new file mode 100644
index 000000000000..9a1c1e21de9b
--- /dev/null
+++ b/mail-mta/postfix/files/postfix.rc6.2.7
@@ -0,0 +1,85 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload abort flush"
+
+description_reload="Re-read configuration files. Running processes terminate at their earliest convenience."
+description_abort="Stop the Postfix mail system abruptly. Running processes are signaled to stop immediately."
+description_flush="Force delivery: attempt to deliver every message in the deferred mail queue."
+
+# Please read http://www.postfix.org/MULTI_INSTANCE_README.html for multi instance support
+CONF_DIR="/etc/postfix"
+CONF_OPT="${SVCNAME##*.}"
+if [ -n ${CONF_OPT} -a ${SVCNAME} != "postfix" ]; then
+ CONF_DIR="${CONF_DIR}.${CONF_OPT}"
+fi
+if [ "${CONF_DIR}" = "/etc/postfix" ]; then
+ CONF_PARAM=""
+ CONF_MESSAGE=""
+else
+ CONF_PARAM="-c ${CONF_DIR}"
+ CONF_MESSAGE="(${CONF_DIR})"
+fi
+
+depend() {
+ use logger dns ypbind amavisd antivirus postfix_greylist net saslauthd
+ if [ "${SVCNAME}" = "postfix" ]; then
+ provide mta
+ fi
+}
+
+start() {
+ if [ ! -z "${CONF_PARAM}" ]; then
+ einfo "Please consider updating your config for postmulti support."
+ fi
+ ebegin "Starting postfix ${CONF_MESSAGE}"
+ if [ ! -d ${CONF_DIR} ]; then
+ eend 1 "${CONF_DIR} does not exist"
+ return 1
+ fi
+ /usr/sbin/postfix ${CONF_PARAM} start >/dev/null 2>&1
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping postfix ${CONF_MESSAGE}"
+ /usr/sbin/postfix ${CONF_PARAM} stop >/dev/null 2>&1
+ eend
+}
+
+status() {
+ local _retval
+ einfon ""
+ /usr/sbin/postfix ${CONF_PARAM} status
+ _retval=$?
+ if [ x${_retval} = 'x0' ]; then
+ mark_service_started "${SVCNAME}"
+ eend 0
+ else
+ mark_service_stopped "${SVCNAME}"
+ eend 3
+ fi
+}
+
+reload() {
+ ebegin "Reloading postfix ${CONF_MESSAGE}"
+ /usr/sbin/postfix ${CONF_PARAM} reload >/dev/null 2>&1
+ eend $?
+}
+
+abort() {
+ ebegin "Aborting postfix ${CONF_MESSAGE}"
+
+ if service_started "${SVCNAME}"; then
+ mark_service_stopped "${SVCNAME}"
+ fi
+ /usr/sbin/postfix ${CONF_PARAM} abort >/dev/null 2>&1
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing postfix ${CONF_MESSAGE}"
+ /usr/sbin/postfix ${CONF_PARAM} flush >/dev/null 2>&1
+ eend $?
+}
diff --git a/mail-mta/postfix/files/postfix.service b/mail-mta/postfix/files/postfix.service
new file mode 100644
index 000000000000..db585b3e29db
--- /dev/null
+++ b/mail-mta/postfix/files/postfix.service
@@ -0,0 +1,26 @@
+[Unit]
+Description=Postfix Mail Transport Agent
+After=network.target
+
+[Service]
+Type=forking
+ExecStartPre=-/usr/bin/newaliases
+ExecStart=/usr/sbin/postfix start
+ExecStop=/usr/sbin/postfix stop
+ExecReload=/usr/sbin/postfix reload
+# Hardening
+PrivateTmp=yes
+PrivateDevices=yes
+ProtectSystem=full
+ReadWritePaths=-/etc/mail/aliases.db
+CapabilityBoundingSet=~ CAP_NET_ADMIN CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_MODULE
+MemoryDenyWriteExecute=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectControlGroups=true
+RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
+RestrictNamespaces=true
+RestrictRealtime=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-mta/postfix/files/smtp.pass b/mail-mta/postfix/files/smtp.pass
new file mode 100644
index 000000000000..f9b5120d64e8
--- /dev/null
+++ b/mail-mta/postfix/files/smtp.pass
@@ -0,0 +1,2 @@
+#
+# remotehost user:password
diff --git a/mail-mta/postfix/files/smtp.sasl b/mail-mta/postfix/files/smtp.sasl
new file mode 100644
index 000000000000..82f29457bc01
--- /dev/null
+++ b/mail-mta/postfix/files/smtp.sasl
@@ -0,0 +1,2 @@
+pwcheck_method:saslauthd
+mech_list: PLAIN
diff --git a/mail-mta/postfix/metadata.xml b/mail-mta/postfix/metadata.xml
new file mode 100644
index 000000000000..6e056425f72c
--- /dev/null
+++ b/mail-mta/postfix/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <use>
+ <flag name="dovecot-sasl">Enable <pkg>net-mail/dovecot</pkg> protocol
+ version 1 (server only) SASL implementation</flag>
+ <flag name="eai">Add support for SMTPUTF8</flag>
+ <flag name="ldap-bind">Add support for binding to LDAP backend
+ using <pkg>dev-libs/cyrus-sasl</pkg></flag>
+ <flag name="memcached">Add support for using <pkg>net-misc/memcached</pkg>
+ for lookup tables</flag>
+ <flag name="lmdb">Add support for using <pkg>dev-db/lmdb</pkg>
+ for lookup tables</flag>
+ <flag name="vda">Add support for virtual delivery agent quota
+ enforcing</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">vda</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/postfix/postfix-2.10.9.ebuild b/mail-mta/postfix/postfix-2.10.9.ebuild
new file mode 100644
index 000000000000..dbecba2eb635
--- /dev/null
+++ b/mail-mta/postfix/postfix-2.10.9.ebuild
@@ -0,0 +1,298 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic pam user versionator systemd
+
+MY_PV="${PV/_pre/-}"
+MY_SRC="${PN}-${MY_PV}"
+MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
+VDA_PV="2.10.0"
+VDA_P="${PN}-vda-v13-${VDA_PV}"
+RC_VER="2.7"
+
+DESCRIPTION="A fast and secure drop-in replacement for sendmail"
+HOMEPAGE="http://www.postfix.org/"
+SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
+ vda? ( http://vda.sourceforge.net/VDA/${VDA_P}.patch ) "
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~mips ~s390"
+IUSE="+berkdb cdb doc dovecot-sasl hardened ldap ldap-bind memcached mbox mysql nis pam postgres sasl selinux sqlite ssl vda"
+
+DEPEND=">=dev-libs/libpcre-3.4
+ dev-lang/perl
+ berkdb? ( >=sys-libs/db-3.2:* )
+ cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r1 ) )
+ ldap? ( net-nds/openldap )
+ ldap-bind? ( net-nds/openldap[sasl] )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql:* )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? ( dev-libs/openssl:0 )"
+
+RDEPEND="${DEPEND}
+ dovecot-sasl? ( net-mail/dovecot )
+ memcached? ( net-misc/memcached )
+ net-mail/mailbase
+ selinux? ( sec-policy/selinux-postfix )
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/fastforward"
+
+REQUIRED_USE="ldap-bind? ( ldap sasl )"
+
+S="${WORKDIR}/${MY_SRC}"
+
+pkg_setup() {
+ # Add postfix, postdrop user/group (bug #77565)
+ enewgroup postfix 207
+ enewgroup postdrop 208
+ enewuser postfix 207 -1 /var/spool/postfix postfix,mail
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.11.1-db6.patch"
+ if use vda; then
+ epatch "${DISTDIR}"/${VDA_P}.patch
+ fi
+
+ sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
+ src/util/sys_defs.h || die "sed failed"
+
+ # change default paths to better comply with portage standard paths
+ sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
+}
+
+src_configure() {
+ # Make sure LDFLAGS get passed down to the executables.
+ local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -lpcre -lcrypt -lpthread"
+
+ use pam && mylibs="${mylibs} -lpam"
+
+ if use ldap; then
+ mycc="${mycc} -DHAS_LDAP"
+ mylibs="${mylibs} -lldap -llber"
+ fi
+
+ if use mysql; then
+ mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
+ mylibs="${mylibs} $(mysql_config --libs)"
+ fi
+
+ if use postgres; then
+ mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
+ mylibs="${mylibs} -lpq -L$(pg_config --libdir)"
+ fi
+
+ if use sqlite; then
+ mycc="${mycc} -DHAS_SQLITE"
+ mylibs="${mylibs} -lsqlite3"
+ fi
+
+ if use ssl; then
+ mycc="${mycc} -DUSE_TLS"
+ mylibs="${mylibs} -lssl -lcrypto"
+ fi
+
+ # broken. and "in other words, not supported" by upstream.
+ # Use inet_protocols setting in main.cf
+ #if ! use ipv6; then
+ # mycc="${mycc} -DNO_IPV6"
+ #fi
+
+ if use sasl; then
+ if use dovecot-sasl; then
+ # Set dovecot as default.
+ mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
+ fi
+ if use ldap-bind; then
+ mycc="${mycc} -DUSE_LDAP_SASL"
+ fi
+ mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
+ mylibs="${mylibs} -lsasl2"
+ elif use dovecot-sasl; then
+ mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
+ fi
+
+ if ! use nis; then
+ sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \
+ src/util/sys_defs.h || die "sed failed"
+ fi
+
+ if ! use berkdb; then
+ mycc="${mycc} -DNO_DB"
+ if use cdb; then
+ # change default hash format from Berkeley DB to cdb
+ sed -i -e "s/hash/cdb/" src/util/sys_defs.h || die
+ fi
+ fi
+
+ if use cdb; then
+ mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
+ CDB_LIBS=""
+ # Tinycdb is preferred.
+ if has_version dev-db/tinycdb ; then
+ einfo "Building with dev-db/tinycdb"
+ CDB_LIBS="-lcdb"
+ else
+ einfo "Building with dev-db/cdb"
+ CDB_PATH="/usr/$(get_libdir)"
+ for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
+ CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}"
+ done
+ fi
+ mylibs="${mylibs} ${CDB_LIBS}"
+ fi
+
+ # Robin H. Johnson <robbat2@gentoo.org> 17/Nov/2006
+ # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
+ mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+ filter-lfs-flags
+
+ # Workaround for bug #76512
+ if use hardened; then
+ [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
+ fi
+
+ # Remove annoying C++ comment style warnings - bug #378099
+ append-flags -Wno-comment
+
+ sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
+ sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
+ emake DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" makefiles
+}
+
+src_install () {
+ local myconf
+ use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
+ html_directory=\"/usr/share/doc/${PF}/html\""
+
+ /bin/sh postfix-install \
+ -non-interactive \
+ install_root="${D}" \
+ config_directory="/etc/postfix" \
+ manpage_directory="/usr/share/man" \
+ command_directory="/usr/sbin" \
+ mailq_path="/usr/bin/mailq" \
+ newaliases_path="/usr/bin/newaliases" \
+ sendmail_path="/usr/sbin/sendmail" \
+ ${myconf} \
+ || die "postfix-install failed"
+
+ # Fix spool removal on upgrade
+ rm -Rf "${D}"/var
+ keepdir /var/spool/postfix
+
+ # Install rmail for UUCP, closes bug #19127
+ dobin auxiliary/rmail/rmail
+
+ # Provide another link for legacy FSH
+ dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
+
+ # Install qshape tool
+ dobin auxiliary/qshape/qshape.pl
+ doman man/man1/qshape.1
+
+ # Performance tuning tools and their manuals
+ dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
+ doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
+
+ # Set proper permissions on required files/directories
+ dodir /var/lib/postfix
+ keepdir /var/lib/postfix
+ fowners -R postfix:postfix /var/lib/postfix
+ fperms 0750 /var/lib/postfix
+ fowners root:postdrop /usr/sbin/post{drop,queue}
+ fperms 02711 /usr/sbin/post{drop,queue}
+
+ keepdir /etc/postfix
+ if use mbox; then
+ mypostconf="mail_spool_directory=/var/spool/mail"
+ else
+ mypostconf="home_mailbox=.maildir/"
+ fi
+ "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
+ -e ${mypostconf} || die "postconf failed"
+
+ insinto /etc/postfix
+ newins "${FILESDIR}"/smtp.pass saslpass
+ fperms 600 /etc/postfix/saslpass
+
+ newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
+ # do not start mysql/postgres unnecessarily - bug #359913
+ use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
+ use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
+
+ dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
+ mv "${D}"/etc/postfix/{*.default,makedefs.out} "${D}"/usr/share/doc/${PF}/
+ use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
+
+ pamd_mimic_system smtp auth account
+
+ if use sasl; then
+ insinto /etc/sasl2
+ newins "${FILESDIR}"/smtp.sasl smtpd.conf
+ fi
+
+ # header files
+ insinto /usr/include/postfix
+ doins include/*.h
+
+ # Remove unnecessary files
+ rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
+ rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_preinst() {
+ # Postfix 2.9.
+ # default for inet_protocols changed from ipv4 to all in postfix-2.9.
+ # check inet_protocols setting in main.cf and modify if necessary to prevent
+ # performance loss with useless DNS lookups and useless connection attempts.
+ [[ -d ${ROOT}/etc/postfix ]] && {
+ if [[ "$(${D}/usr/sbin/postconf -dh inet_protocols)" != "ipv4" ]]; then
+ if [[ ! -n "$(${D}/usr/sbin/postconf -c ${ROOT}/etc/postfix -n inet_protocols)" ]];
+ then
+ ewarn "\nCOMPATIBILITY: adding inet_protocols=ipv4 to main.cf."
+ ewarn "That will keep the same behaviour as previous postfix versions."
+ ewarn "Specify inet_protocols explicitly if you want to enable IPv6.\n"
+ else
+ # delete inet_protocols setting. there is already one in /etc/postfix
+ sed -i -e /inet_protocols/d "${D}"/etc/postfix/main.cf || die
+ fi
+ fi
+ }
+}
+
+pkg_postinst() {
+ # Do not install server.{key,pem) SSL certificates if they already exist
+ if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
+ && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
+ SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
+ install_cert /etc/ssl/postfix/server
+ chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
+ fi
+
+ if [[ ! -e /etc/mail/aliases.db ]] ; then
+ ewarn
+ ewarn "You must edit /etc/mail/aliases to suit your needs"
+ ewarn "and then run /usr/bin/newaliases. Postfix will not"
+ ewarn "work correctly without it."
+ ewarn
+ fi
+}
diff --git a/mail-mta/postfix/postfix-3.1.2-r2.ebuild b/mail-mta/postfix/postfix-3.1.2-r2.ebuild
new file mode 100644
index 000000000000..4b77390d2e6f
--- /dev/null
+++ b/mail-mta/postfix/postfix-3.1.2-r2.ebuild
@@ -0,0 +1,308 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic pam systemd toolchain-funcs user
+
+MY_PV="${PV/_rc/-RC}"
+MY_SRC="${PN}-${MY_PV}"
+MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
+RC_VER="2.7"
+
+DESCRIPTION="A fast and secure drop-in replacement for sendmail"
+HOMEPAGE="http://www.postfix.org/"
+SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86 ~x86-fbsd"
+IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
+
+DEPEND=">=dev-libs/libpcre-3.4
+ dev-lang/perl
+ berkdb? ( >=sys-libs/db-3.2:* )
+ cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
+ eai? ( dev-libs/icu:= )
+ ldap? ( net-nds/openldap )
+ ldap-bind? ( net-nds/openldap[sasl] )
+ lmdb? ( >=dev-db/lmdb-0.9.11 )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql:* )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
+RDEPEND="${DEPEND}
+ dovecot-sasl? ( net-mail/dovecot )
+ memcached? ( net-misc/memcached )
+ net-mail/mailbase
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/fastforward
+ selinux? ( sec-policy/selinux-postfix )"
+
+REQUIRED_USE="ldap-bind? ( ldap sasl )"
+
+S="${WORKDIR}/${MY_SRC}"
+
+pkg_setup() {
+ # Add postfix, postdrop user/group (bug #77565)
+ enewgroup postfix 207
+ enewgroup postdrop 208
+ enewuser postfix 207 -1 /var/spool/postfix postfix,mail
+}
+
+src_prepare() {
+ default
+ sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
+ src/util/sys_defs.h || die "sed failed"
+ # change default paths to better comply with portage standard paths
+ sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
+ eapply -p0 "${FILESDIR}/${PN}-libressl.patch"
+ eapply -p0 "${FILESDIR}/${PN}-libressl-runtime.patch"
+}
+
+src_configure() {
+ for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
+ do
+ local AUXLIBS_${name}=""
+ done
+
+ # Make sure LDFLAGS get passed down to the executables.
+ local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
+ AUXLIBS_PCRE="$(pcre-config --libs)"
+
+ use pam && mylibs="${mylibs} -lpam"
+
+ if use ldap; then
+ mycc="${mycc} -DHAS_LDAP"
+ AUXLIBS_LDAP="-lldap -llber"
+ fi
+
+ if use mysql; then
+ mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
+ AUXLIBS_MYSQL="$(mysql_config --libs)"
+ fi
+
+ if use postgres; then
+ mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
+ AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
+ fi
+
+ if use sqlite; then
+ mycc="${mycc} -DHAS_SQLITE"
+ AUXLIBS_SQLITE="-lsqlite3 -lpthread"
+ fi
+
+ if use ssl; then
+ mycc="${mycc} -DUSE_TLS"
+ mylibs="${mylibs} -lssl -lcrypto"
+ fi
+
+ if use lmdb; then
+ mycc="${mycc} -DHAS_LMDB"
+ AUXLIBS_LMDB="-llmdb -lpthread"
+ fi
+
+ if ! use eai; then
+ mycc="${mycc} -DNO_EAI"
+ fi
+
+ # broken. and "in other words, not supported" by upstream.
+ # Use inet_protocols setting in main.cf
+ #if ! use ipv6; then
+ # mycc="${mycc} -DNO_IPV6"
+ #fi
+
+ if use sasl; then
+ if use dovecot-sasl; then
+ # Set dovecot as default.
+ mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
+ fi
+ if use ldap-bind; then
+ mycc="${mycc} -DUSE_LDAP_SASL"
+ fi
+ mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
+ mylibs="${mylibs} -lsasl2"
+ elif use dovecot-sasl; then
+ mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
+ fi
+
+ if ! use nis; then
+ mycc="${mycc} -DNO_NIS"
+ fi
+
+ if ! use berkdb; then
+ mycc="${mycc} -DNO_DB"
+ if use cdb; then
+ # change default hash format from Berkeley DB to cdb
+ mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
+ fi
+ fi
+
+ if use cdb; then
+ mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
+ # Tinycdb is preferred.
+ if has_version dev-db/tinycdb ; then
+ einfo "Building with dev-db/tinycdb"
+ AUXLIBS_CDB="-lcdb"
+ else
+ einfo "Building with dev-db/cdb"
+ CDB_PATH="/usr/$(get_libdir)"
+ for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
+ AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
+ done
+ fi
+ fi
+
+ # Robin H. Johnson <robbat2@gentoo.org> 17/Nov/2006
+ # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
+ mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+ filter-lfs-flags
+
+ # Workaround for bug #76512
+ if use hardened; then
+ [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
+ fi
+
+ # Remove annoying C++ comment style warnings - bug #378099
+ append-flags -Wno-comment
+
+ sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
+ sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
+
+ emake makefiles shared=yes dynamicmaps=no pie=yes \
+ shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
+ DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
+ AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
+ AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
+ AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
+ AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
+}
+
+src_install () {
+ local myconf
+ use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
+ html_directory=\"/usr/share/doc/${PF}/html\""
+
+ LD_LIBRARY_PATH="${S}/lib" \
+ /bin/sh postfix-install \
+ -non-interactive \
+ install_root="${D}" \
+ config_directory="/etc/postfix" \
+ manpage_directory="/usr/share/man" \
+ command_directory="/usr/sbin" \
+ mailq_path="/usr/bin/mailq" \
+ newaliases_path="/usr/bin/newaliases" \
+ sendmail_path="/usr/sbin/sendmail" \
+ ${myconf} \
+ || die "postfix-install failed"
+
+ # Fix spool removal on upgrade
+ rm -Rf "${D}"/var
+ keepdir /var/spool/postfix
+
+ # Install rmail for UUCP, closes bug #19127
+ dobin auxiliary/rmail/rmail
+
+ # Provide another link for legacy FSH
+ dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
+
+ # Install qshape and posttls-finger
+ dobin auxiliary/qshape/qshape.pl
+ doman man/man1/qshape.1
+ dobin bin/posttls-finger
+ doman man/man1/posttls-finger.1
+
+ # Performance tuning tools and their manuals
+ dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
+ doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
+
+ # Set proper permissions on required files/directories
+ dodir /var/lib/postfix
+ keepdir /var/lib/postfix
+ fowners -R postfix:postfix /var/lib/postfix
+ fperms 0750 /var/lib/postfix
+ fowners root:postdrop /usr/sbin/post{drop,queue}
+ fperms 02711 /usr/sbin/post{drop,queue}
+
+ keepdir /etc/postfix
+ if use mbox; then
+ mypostconf="mail_spool_directory=/var/spool/mail"
+ else
+ mypostconf="home_mailbox=.maildir/"
+ fi
+ LD_LIBRARY_PATH="${S}/lib" \
+ "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
+ -e ${mypostconf} || die "postconf failed"
+
+ insinto /etc/postfix
+ newins "${FILESDIR}"/smtp.pass saslpass
+ fperms 600 /etc/postfix/saslpass
+
+ newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
+ # do not start mysql/postgres unnecessarily - bug #359913
+ use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
+ use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
+
+ dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
+ use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
+
+ pamd_mimic_system smtp auth account
+
+ if use sasl; then
+ insinto /etc/sasl2
+ newins "${FILESDIR}"/smtp.sasl smtpd.conf
+ fi
+
+ # header files
+ insinto /usr/include/postfix
+ doins include/*.h
+
+ # Keep config_dir clean
+ rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
+ rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
+
+ if has_version mail-mta/postfix; then
+ # let the sysadmin decide when to change the compatibility_level
+ sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
+ fi
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ if [[ ! -e /etc/mail/aliases.db ]] ; then
+ ewarn
+ ewarn "You must edit /etc/mail/aliases to suit your needs"
+ ewarn "and then run /usr/bin/newaliases. Postfix will not"
+ ewarn "work correctly without it."
+ ewarn
+ fi
+
+ # configure tls
+ if use ssl ; then
+ if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
+ elog "To configure client side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-client
+ fi
+ if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
+ elog "To configure server side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-server
+ fi
+ fi
+}
diff --git a/mail-mta/postfix/postfix-3.1.6.ebuild b/mail-mta/postfix/postfix-3.1.6.ebuild
new file mode 100644
index 000000000000..4b77390d2e6f
--- /dev/null
+++ b/mail-mta/postfix/postfix-3.1.6.ebuild
@@ -0,0 +1,308 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic pam systemd toolchain-funcs user
+
+MY_PV="${PV/_rc/-RC}"
+MY_SRC="${PN}-${MY_PV}"
+MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
+RC_VER="2.7"
+
+DESCRIPTION="A fast and secure drop-in replacement for sendmail"
+HOMEPAGE="http://www.postfix.org/"
+SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86 ~x86-fbsd"
+IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
+
+DEPEND=">=dev-libs/libpcre-3.4
+ dev-lang/perl
+ berkdb? ( >=sys-libs/db-3.2:* )
+ cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
+ eai? ( dev-libs/icu:= )
+ ldap? ( net-nds/openldap )
+ ldap-bind? ( net-nds/openldap[sasl] )
+ lmdb? ( >=dev-db/lmdb-0.9.11 )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql:* )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
+RDEPEND="${DEPEND}
+ dovecot-sasl? ( net-mail/dovecot )
+ memcached? ( net-misc/memcached )
+ net-mail/mailbase
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/fastforward
+ selinux? ( sec-policy/selinux-postfix )"
+
+REQUIRED_USE="ldap-bind? ( ldap sasl )"
+
+S="${WORKDIR}/${MY_SRC}"
+
+pkg_setup() {
+ # Add postfix, postdrop user/group (bug #77565)
+ enewgroup postfix 207
+ enewgroup postdrop 208
+ enewuser postfix 207 -1 /var/spool/postfix postfix,mail
+}
+
+src_prepare() {
+ default
+ sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
+ src/util/sys_defs.h || die "sed failed"
+ # change default paths to better comply with portage standard paths
+ sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
+ eapply -p0 "${FILESDIR}/${PN}-libressl.patch"
+ eapply -p0 "${FILESDIR}/${PN}-libressl-runtime.patch"
+}
+
+src_configure() {
+ for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
+ do
+ local AUXLIBS_${name}=""
+ done
+
+ # Make sure LDFLAGS get passed down to the executables.
+ local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
+ AUXLIBS_PCRE="$(pcre-config --libs)"
+
+ use pam && mylibs="${mylibs} -lpam"
+
+ if use ldap; then
+ mycc="${mycc} -DHAS_LDAP"
+ AUXLIBS_LDAP="-lldap -llber"
+ fi
+
+ if use mysql; then
+ mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
+ AUXLIBS_MYSQL="$(mysql_config --libs)"
+ fi
+
+ if use postgres; then
+ mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
+ AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
+ fi
+
+ if use sqlite; then
+ mycc="${mycc} -DHAS_SQLITE"
+ AUXLIBS_SQLITE="-lsqlite3 -lpthread"
+ fi
+
+ if use ssl; then
+ mycc="${mycc} -DUSE_TLS"
+ mylibs="${mylibs} -lssl -lcrypto"
+ fi
+
+ if use lmdb; then
+ mycc="${mycc} -DHAS_LMDB"
+ AUXLIBS_LMDB="-llmdb -lpthread"
+ fi
+
+ if ! use eai; then
+ mycc="${mycc} -DNO_EAI"
+ fi
+
+ # broken. and "in other words, not supported" by upstream.
+ # Use inet_protocols setting in main.cf
+ #if ! use ipv6; then
+ # mycc="${mycc} -DNO_IPV6"
+ #fi
+
+ if use sasl; then
+ if use dovecot-sasl; then
+ # Set dovecot as default.
+ mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
+ fi
+ if use ldap-bind; then
+ mycc="${mycc} -DUSE_LDAP_SASL"
+ fi
+ mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
+ mylibs="${mylibs} -lsasl2"
+ elif use dovecot-sasl; then
+ mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
+ fi
+
+ if ! use nis; then
+ mycc="${mycc} -DNO_NIS"
+ fi
+
+ if ! use berkdb; then
+ mycc="${mycc} -DNO_DB"
+ if use cdb; then
+ # change default hash format from Berkeley DB to cdb
+ mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
+ fi
+ fi
+
+ if use cdb; then
+ mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
+ # Tinycdb is preferred.
+ if has_version dev-db/tinycdb ; then
+ einfo "Building with dev-db/tinycdb"
+ AUXLIBS_CDB="-lcdb"
+ else
+ einfo "Building with dev-db/cdb"
+ CDB_PATH="/usr/$(get_libdir)"
+ for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
+ AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
+ done
+ fi
+ fi
+
+ # Robin H. Johnson <robbat2@gentoo.org> 17/Nov/2006
+ # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
+ mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+ filter-lfs-flags
+
+ # Workaround for bug #76512
+ if use hardened; then
+ [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
+ fi
+
+ # Remove annoying C++ comment style warnings - bug #378099
+ append-flags -Wno-comment
+
+ sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
+ sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
+
+ emake makefiles shared=yes dynamicmaps=no pie=yes \
+ shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
+ DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
+ AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
+ AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
+ AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
+ AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
+}
+
+src_install () {
+ local myconf
+ use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
+ html_directory=\"/usr/share/doc/${PF}/html\""
+
+ LD_LIBRARY_PATH="${S}/lib" \
+ /bin/sh postfix-install \
+ -non-interactive \
+ install_root="${D}" \
+ config_directory="/etc/postfix" \
+ manpage_directory="/usr/share/man" \
+ command_directory="/usr/sbin" \
+ mailq_path="/usr/bin/mailq" \
+ newaliases_path="/usr/bin/newaliases" \
+ sendmail_path="/usr/sbin/sendmail" \
+ ${myconf} \
+ || die "postfix-install failed"
+
+ # Fix spool removal on upgrade
+ rm -Rf "${D}"/var
+ keepdir /var/spool/postfix
+
+ # Install rmail for UUCP, closes bug #19127
+ dobin auxiliary/rmail/rmail
+
+ # Provide another link for legacy FSH
+ dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
+
+ # Install qshape and posttls-finger
+ dobin auxiliary/qshape/qshape.pl
+ doman man/man1/qshape.1
+ dobin bin/posttls-finger
+ doman man/man1/posttls-finger.1
+
+ # Performance tuning tools and their manuals
+ dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
+ doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
+
+ # Set proper permissions on required files/directories
+ dodir /var/lib/postfix
+ keepdir /var/lib/postfix
+ fowners -R postfix:postfix /var/lib/postfix
+ fperms 0750 /var/lib/postfix
+ fowners root:postdrop /usr/sbin/post{drop,queue}
+ fperms 02711 /usr/sbin/post{drop,queue}
+
+ keepdir /etc/postfix
+ if use mbox; then
+ mypostconf="mail_spool_directory=/var/spool/mail"
+ else
+ mypostconf="home_mailbox=.maildir/"
+ fi
+ LD_LIBRARY_PATH="${S}/lib" \
+ "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
+ -e ${mypostconf} || die "postconf failed"
+
+ insinto /etc/postfix
+ newins "${FILESDIR}"/smtp.pass saslpass
+ fperms 600 /etc/postfix/saslpass
+
+ newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
+ # do not start mysql/postgres unnecessarily - bug #359913
+ use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
+ use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
+
+ dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
+ use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
+
+ pamd_mimic_system smtp auth account
+
+ if use sasl; then
+ insinto /etc/sasl2
+ newins "${FILESDIR}"/smtp.sasl smtpd.conf
+ fi
+
+ # header files
+ insinto /usr/include/postfix
+ doins include/*.h
+
+ # Keep config_dir clean
+ rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
+ rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
+
+ if has_version mail-mta/postfix; then
+ # let the sysadmin decide when to change the compatibility_level
+ sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
+ fi
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ if [[ ! -e /etc/mail/aliases.db ]] ; then
+ ewarn
+ ewarn "You must edit /etc/mail/aliases to suit your needs"
+ ewarn "and then run /usr/bin/newaliases. Postfix will not"
+ ewarn "work correctly without it."
+ ewarn
+ fi
+
+ # configure tls
+ if use ssl ; then
+ if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
+ elog "To configure client side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-client
+ fi
+ if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
+ elog "To configure server side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-server
+ fi
+ fi
+}
diff --git a/mail-mta/postfix/postfix-3.2.2.ebuild b/mail-mta/postfix/postfix-3.2.2.ebuild
new file mode 100644
index 000000000000..0d7b71cde944
--- /dev/null
+++ b/mail-mta/postfix/postfix-3.2.2.ebuild
@@ -0,0 +1,308 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic pam systemd toolchain-funcs user
+
+MY_PV="${PV/_pre/-}"
+MY_SRC="${PN}-${MY_PV}"
+MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
+RC_VER="2.7"
+
+DESCRIPTION="A fast and secure drop-in replacement for sendmail"
+HOMEPAGE="http://www.postfix.org/"
+SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
+
+DEPEND=">=dev-libs/libpcre-3.4
+ dev-lang/perl
+ berkdb? ( >=sys-libs/db-3.2:* )
+ cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
+ eai? ( dev-libs/icu:= )
+ ldap? ( net-nds/openldap )
+ ldap-bind? ( net-nds/openldap[sasl] )
+ lmdb? ( >=dev-db/lmdb-0.9.11 )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql:* )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
+RDEPEND="${DEPEND}
+ dovecot-sasl? ( net-mail/dovecot )
+ memcached? ( net-misc/memcached )
+ net-mail/mailbase
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/fastforward
+ selinux? ( sec-policy/selinux-postfix )"
+
+REQUIRED_USE="ldap-bind? ( ldap sasl )"
+
+S="${WORKDIR}/${MY_SRC}"
+
+pkg_setup() {
+ # Add postfix, postdrop user/group (bug #77565)
+ enewgroup postfix 207
+ enewgroup postdrop 208
+ enewuser postfix 207 -1 /var/spool/postfix postfix,mail
+}
+
+src_prepare() {
+ default
+ sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
+ src/util/sys_defs.h || die "sed failed"
+ # change default paths to better comply with portage standard paths
+ sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
+ eapply -p0 "${FILESDIR}/${PN}-libressl.patch"
+ eapply -p0 "${FILESDIR}/${PN}-libressl-runtime.patch"
+}
+
+src_configure() {
+ for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
+ do
+ local AUXLIBS_${name}=""
+ done
+
+ # Make sure LDFLAGS get passed down to the executables.
+ local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
+ AUXLIBS_PCRE="$(pcre-config --libs)"
+
+ use pam && mylibs="${mylibs} -lpam"
+
+ if use ldap; then
+ mycc="${mycc} -DHAS_LDAP"
+ AUXLIBS_LDAP="-lldap -llber"
+ fi
+
+ if use mysql; then
+ mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
+ AUXLIBS_MYSQL="$(mysql_config --libs)"
+ fi
+
+ if use postgres; then
+ mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
+ AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
+ fi
+
+ if use sqlite; then
+ mycc="${mycc} -DHAS_SQLITE"
+ AUXLIBS_SQLITE="-lsqlite3 -lpthread"
+ fi
+
+ if use ssl; then
+ mycc="${mycc} -DUSE_TLS"
+ mylibs="${mylibs} -lssl -lcrypto"
+ fi
+
+ if use lmdb; then
+ mycc="${mycc} -DHAS_LMDB"
+ AUXLIBS_LMDB="-llmdb -lpthread"
+ fi
+
+ if ! use eai; then
+ mycc="${mycc} -DNO_EAI"
+ fi
+
+ # broken. and "in other words, not supported" by upstream.
+ # Use inet_protocols setting in main.cf
+ #if ! use ipv6; then
+ # mycc="${mycc} -DNO_IPV6"
+ #fi
+
+ if use sasl; then
+ if use dovecot-sasl; then
+ # Set dovecot as default.
+ mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
+ fi
+ if use ldap-bind; then
+ mycc="${mycc} -DUSE_LDAP_SASL"
+ fi
+ mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
+ mylibs="${mylibs} -lsasl2"
+ elif use dovecot-sasl; then
+ mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
+ fi
+
+ if ! use nis; then
+ mycc="${mycc} -DNO_NIS"
+ fi
+
+ if ! use berkdb; then
+ mycc="${mycc} -DNO_DB"
+ if use cdb; then
+ # change default hash format from Berkeley DB to cdb
+ mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
+ fi
+ fi
+
+ if use cdb; then
+ mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
+ # Tinycdb is preferred.
+ if has_version dev-db/tinycdb ; then
+ einfo "Building with dev-db/tinycdb"
+ AUXLIBS_CDB="-lcdb"
+ else
+ einfo "Building with dev-db/cdb"
+ CDB_PATH="/usr/$(get_libdir)"
+ for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
+ AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
+ done
+ fi
+ fi
+
+ # Robin H. Johnson <robbat2@gentoo.org> 17/Nov/2006
+ # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
+ mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+ filter-lfs-flags
+
+ # Workaround for bug #76512
+ if use hardened; then
+ [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
+ fi
+
+ # Remove annoying C++ comment style warnings - bug #378099
+ append-flags -Wno-comment
+
+ sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
+ sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
+
+ emake makefiles shared=yes dynamicmaps=no pie=yes \
+ shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
+ DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
+ AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
+ AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
+ AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
+ AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
+}
+
+src_install () {
+ local myconf
+ use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
+ html_directory=\"/usr/share/doc/${PF}/html\""
+
+ LD_LIBRARY_PATH="${S}/lib" \
+ /bin/sh postfix-install \
+ -non-interactive \
+ install_root="${D}" \
+ config_directory="/etc/postfix" \
+ manpage_directory="/usr/share/man" \
+ command_directory="/usr/sbin" \
+ mailq_path="/usr/bin/mailq" \
+ newaliases_path="/usr/bin/newaliases" \
+ sendmail_path="/usr/sbin/sendmail" \
+ ${myconf} \
+ || die "postfix-install failed"
+
+ # Fix spool removal on upgrade
+ rm -Rf "${D}"/var
+ keepdir /var/spool/postfix
+
+ # Install rmail for UUCP, closes bug #19127
+ dobin auxiliary/rmail/rmail
+
+ # Provide another link for legacy FSH
+ dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
+
+ # Install qshape and posttls-finger
+ dobin auxiliary/qshape/qshape.pl
+ doman man/man1/qshape.1
+ dobin bin/posttls-finger
+ doman man/man1/posttls-finger.1
+
+ # Performance tuning tools and their manuals
+ dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
+ doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
+
+ # Set proper permissions on required files/directories
+ dodir /var/lib/postfix
+ keepdir /var/lib/postfix
+ fowners -R postfix:postfix /var/lib/postfix
+ fperms 0750 /var/lib/postfix
+ fowners root:postdrop /usr/sbin/post{drop,queue}
+ fperms 02711 /usr/sbin/post{drop,queue}
+
+ keepdir /etc/postfix
+ if use mbox; then
+ mypostconf="mail_spool_directory=/var/spool/mail"
+ else
+ mypostconf="home_mailbox=.maildir/"
+ fi
+ LD_LIBRARY_PATH="${S}/lib" \
+ "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
+ -e ${mypostconf} || die "postconf failed"
+
+ insinto /etc/postfix
+ newins "${FILESDIR}"/smtp.pass saslpass
+ fperms 600 /etc/postfix/saslpass
+
+ newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
+ # do not start mysql/postgres unnecessarily - bug #359913
+ use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
+ use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
+
+ dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
+ use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
+
+ pamd_mimic_system smtp auth account
+
+ if use sasl; then
+ insinto /etc/sasl2
+ newins "${FILESDIR}"/smtp.sasl smtpd.conf
+ fi
+
+ # header files
+ insinto /usr/include/postfix
+ doins include/*.h
+
+ # Keep config_dir clean
+ rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
+ rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
+
+ if has_version mail-mta/postfix; then
+ # let the sysadmin decide when to change the compatibility_level
+ sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
+ fi
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ if [[ ! -e /etc/mail/aliases.db ]] ; then
+ ewarn
+ ewarn "You must edit /etc/mail/aliases to suit your needs"
+ ewarn "and then run /usr/bin/newaliases. Postfix will not"
+ ewarn "work correctly without it."
+ ewarn
+ fi
+
+ # configure tls
+ if use ssl ; then
+ if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
+ elog "To configure client side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-client
+ fi
+ if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
+ elog "To configure server side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-server
+ fi
+ fi
+}
diff --git a/mail-mta/postfix/postfix-3.2.3.ebuild b/mail-mta/postfix/postfix-3.2.3.ebuild
new file mode 100644
index 000000000000..0d7b71cde944
--- /dev/null
+++ b/mail-mta/postfix/postfix-3.2.3.ebuild
@@ -0,0 +1,308 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic pam systemd toolchain-funcs user
+
+MY_PV="${PV/_pre/-}"
+MY_SRC="${PN}-${MY_PV}"
+MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
+RC_VER="2.7"
+
+DESCRIPTION="A fast and secure drop-in replacement for sendmail"
+HOMEPAGE="http://www.postfix.org/"
+SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
+
+DEPEND=">=dev-libs/libpcre-3.4
+ dev-lang/perl
+ berkdb? ( >=sys-libs/db-3.2:* )
+ cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
+ eai? ( dev-libs/icu:= )
+ ldap? ( net-nds/openldap )
+ ldap-bind? ( net-nds/openldap[sasl] )
+ lmdb? ( >=dev-db/lmdb-0.9.11 )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql:* )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
+RDEPEND="${DEPEND}
+ dovecot-sasl? ( net-mail/dovecot )
+ memcached? ( net-misc/memcached )
+ net-mail/mailbase
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/fastforward
+ selinux? ( sec-policy/selinux-postfix )"
+
+REQUIRED_USE="ldap-bind? ( ldap sasl )"
+
+S="${WORKDIR}/${MY_SRC}"
+
+pkg_setup() {
+ # Add postfix, postdrop user/group (bug #77565)
+ enewgroup postfix 207
+ enewgroup postdrop 208
+ enewuser postfix 207 -1 /var/spool/postfix postfix,mail
+}
+
+src_prepare() {
+ default
+ sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
+ src/util/sys_defs.h || die "sed failed"
+ # change default paths to better comply with portage standard paths
+ sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
+ eapply -p0 "${FILESDIR}/${PN}-libressl.patch"
+ eapply -p0 "${FILESDIR}/${PN}-libressl-runtime.patch"
+}
+
+src_configure() {
+ for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
+ do
+ local AUXLIBS_${name}=""
+ done
+
+ # Make sure LDFLAGS get passed down to the executables.
+ local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
+ AUXLIBS_PCRE="$(pcre-config --libs)"
+
+ use pam && mylibs="${mylibs} -lpam"
+
+ if use ldap; then
+ mycc="${mycc} -DHAS_LDAP"
+ AUXLIBS_LDAP="-lldap -llber"
+ fi
+
+ if use mysql; then
+ mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
+ AUXLIBS_MYSQL="$(mysql_config --libs)"
+ fi
+
+ if use postgres; then
+ mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
+ AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
+ fi
+
+ if use sqlite; then
+ mycc="${mycc} -DHAS_SQLITE"
+ AUXLIBS_SQLITE="-lsqlite3 -lpthread"
+ fi
+
+ if use ssl; then
+ mycc="${mycc} -DUSE_TLS"
+ mylibs="${mylibs} -lssl -lcrypto"
+ fi
+
+ if use lmdb; then
+ mycc="${mycc} -DHAS_LMDB"
+ AUXLIBS_LMDB="-llmdb -lpthread"
+ fi
+
+ if ! use eai; then
+ mycc="${mycc} -DNO_EAI"
+ fi
+
+ # broken. and "in other words, not supported" by upstream.
+ # Use inet_protocols setting in main.cf
+ #if ! use ipv6; then
+ # mycc="${mycc} -DNO_IPV6"
+ #fi
+
+ if use sasl; then
+ if use dovecot-sasl; then
+ # Set dovecot as default.
+ mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
+ fi
+ if use ldap-bind; then
+ mycc="${mycc} -DUSE_LDAP_SASL"
+ fi
+ mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
+ mylibs="${mylibs} -lsasl2"
+ elif use dovecot-sasl; then
+ mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
+ fi
+
+ if ! use nis; then
+ mycc="${mycc} -DNO_NIS"
+ fi
+
+ if ! use berkdb; then
+ mycc="${mycc} -DNO_DB"
+ if use cdb; then
+ # change default hash format from Berkeley DB to cdb
+ mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
+ fi
+ fi
+
+ if use cdb; then
+ mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
+ # Tinycdb is preferred.
+ if has_version dev-db/tinycdb ; then
+ einfo "Building with dev-db/tinycdb"
+ AUXLIBS_CDB="-lcdb"
+ else
+ einfo "Building with dev-db/cdb"
+ CDB_PATH="/usr/$(get_libdir)"
+ for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
+ AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
+ done
+ fi
+ fi
+
+ # Robin H. Johnson <robbat2@gentoo.org> 17/Nov/2006
+ # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
+ mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+ filter-lfs-flags
+
+ # Workaround for bug #76512
+ if use hardened; then
+ [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
+ fi
+
+ # Remove annoying C++ comment style warnings - bug #378099
+ append-flags -Wno-comment
+
+ sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
+ sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
+
+ emake makefiles shared=yes dynamicmaps=no pie=yes \
+ shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
+ DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
+ AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
+ AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
+ AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
+ AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
+}
+
+src_install () {
+ local myconf
+ use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
+ html_directory=\"/usr/share/doc/${PF}/html\""
+
+ LD_LIBRARY_PATH="${S}/lib" \
+ /bin/sh postfix-install \
+ -non-interactive \
+ install_root="${D}" \
+ config_directory="/etc/postfix" \
+ manpage_directory="/usr/share/man" \
+ command_directory="/usr/sbin" \
+ mailq_path="/usr/bin/mailq" \
+ newaliases_path="/usr/bin/newaliases" \
+ sendmail_path="/usr/sbin/sendmail" \
+ ${myconf} \
+ || die "postfix-install failed"
+
+ # Fix spool removal on upgrade
+ rm -Rf "${D}"/var
+ keepdir /var/spool/postfix
+
+ # Install rmail for UUCP, closes bug #19127
+ dobin auxiliary/rmail/rmail
+
+ # Provide another link for legacy FSH
+ dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
+
+ # Install qshape and posttls-finger
+ dobin auxiliary/qshape/qshape.pl
+ doman man/man1/qshape.1
+ dobin bin/posttls-finger
+ doman man/man1/posttls-finger.1
+
+ # Performance tuning tools and their manuals
+ dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
+ doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
+
+ # Set proper permissions on required files/directories
+ dodir /var/lib/postfix
+ keepdir /var/lib/postfix
+ fowners -R postfix:postfix /var/lib/postfix
+ fperms 0750 /var/lib/postfix
+ fowners root:postdrop /usr/sbin/post{drop,queue}
+ fperms 02711 /usr/sbin/post{drop,queue}
+
+ keepdir /etc/postfix
+ if use mbox; then
+ mypostconf="mail_spool_directory=/var/spool/mail"
+ else
+ mypostconf="home_mailbox=.maildir/"
+ fi
+ LD_LIBRARY_PATH="${S}/lib" \
+ "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
+ -e ${mypostconf} || die "postconf failed"
+
+ insinto /etc/postfix
+ newins "${FILESDIR}"/smtp.pass saslpass
+ fperms 600 /etc/postfix/saslpass
+
+ newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
+ # do not start mysql/postgres unnecessarily - bug #359913
+ use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
+ use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
+
+ dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
+ use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
+
+ pamd_mimic_system smtp auth account
+
+ if use sasl; then
+ insinto /etc/sasl2
+ newins "${FILESDIR}"/smtp.sasl smtpd.conf
+ fi
+
+ # header files
+ insinto /usr/include/postfix
+ doins include/*.h
+
+ # Keep config_dir clean
+ rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
+ rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
+
+ if has_version mail-mta/postfix; then
+ # let the sysadmin decide when to change the compatibility_level
+ sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
+ fi
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ if [[ ! -e /etc/mail/aliases.db ]] ; then
+ ewarn
+ ewarn "You must edit /etc/mail/aliases to suit your needs"
+ ewarn "and then run /usr/bin/newaliases. Postfix will not"
+ ewarn "work correctly without it."
+ ewarn
+ fi
+
+ # configure tls
+ if use ssl ; then
+ if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
+ elog "To configure client side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-client
+ fi
+ if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
+ elog "To configure server side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-server
+ fi
+ fi
+}
diff --git a/mail-mta/postfix/postfix-3.3_pre20170924.ebuild b/mail-mta/postfix/postfix-3.3_pre20170924.ebuild
new file mode 100644
index 000000000000..a6ac5530fbf4
--- /dev/null
+++ b/mail-mta/postfix/postfix-3.3_pre20170924.ebuild
@@ -0,0 +1,310 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic pam systemd toolchain-funcs user
+
+MY_PV="${PV/_pre/-}"
+MY_SRC="${PN}-${MY_PV}"
+MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/experimental"
+RC_VER="2.7"
+
+DESCRIPTION="A fast and secure drop-in replacement for sendmail"
+HOMEPAGE="http://www.postfix.org/"
+SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
+
+DEPEND=">=dev-libs/libpcre-3.4
+ dev-lang/perl
+ berkdb? ( >=sys-libs/db-3.2:* )
+ cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
+ eai? ( dev-libs/icu:= )
+ ldap? ( net-nds/openldap )
+ ldap-bind? ( net-nds/openldap[sasl] )
+ lmdb? ( >=dev-db/lmdb-0.9.11 )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql:* )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
+RDEPEND="${DEPEND}
+ dovecot-sasl? ( net-mail/dovecot )
+ memcached? ( net-misc/memcached )
+ net-mail/mailbase
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/fastforward
+ selinux? ( sec-policy/selinux-postfix )"
+
+REQUIRED_USE="ldap-bind? ( ldap sasl )"
+
+S="${WORKDIR}/${MY_SRC}"
+
+pkg_setup() {
+ # Add postfix, postdrop user/group (bug #77565)
+ enewgroup postfix 207
+ enewgroup postdrop 208
+ enewuser postfix 207 -1 /var/spool/postfix postfix,mail
+}
+
+src_prepare() {
+ default
+ sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
+ src/util/sys_defs.h || die "sed failed"
+ # change default paths to better comply with portage standard paths
+ sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
+ eapply -p0 "${FILESDIR}/${PN}-libressl.patch"
+ eapply -p0 "${FILESDIR}/${PN}-libressl-runtime.patch"
+}
+
+src_configure() {
+ for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
+ do
+ local AUXLIBS_${name}=""
+ done
+
+ # Make sure LDFLAGS get passed down to the executables.
+ local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
+ AUXLIBS_PCRE="$(pcre-config --libs)"
+
+ use pam && mylibs="${mylibs} -lpam"
+
+ if use ldap; then
+ mycc="${mycc} -DHAS_LDAP"
+ AUXLIBS_LDAP="-lldap -llber"
+ fi
+
+ if use mysql; then
+ mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
+ AUXLIBS_MYSQL="$(mysql_config --libs)"
+ fi
+
+ if use postgres; then
+ mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
+ AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
+ fi
+
+ if use sqlite; then
+ mycc="${mycc} -DHAS_SQLITE"
+ AUXLIBS_SQLITE="-lsqlite3 -lpthread"
+ fi
+
+ if use ssl; then
+ mycc="${mycc} -DUSE_TLS"
+ mylibs="${mylibs} -lssl -lcrypto"
+ fi
+
+ if use lmdb; then
+ mycc="${mycc} -DHAS_LMDB"
+ AUXLIBS_LMDB="-llmdb -lpthread"
+ fi
+
+ if ! use eai; then
+ mycc="${mycc} -DNO_EAI"
+ fi
+
+ # broken. and "in other words, not supported" by upstream.
+ # Use inet_protocols setting in main.cf
+ #if ! use ipv6; then
+ # mycc="${mycc} -DNO_IPV6"
+ #fi
+
+ if use sasl; then
+ if use dovecot-sasl; then
+ # Set dovecot as default.
+ mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
+ fi
+ if use ldap-bind; then
+ mycc="${mycc} -DUSE_LDAP_SASL"
+ fi
+ mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
+ mylibs="${mylibs} -lsasl2"
+ elif use dovecot-sasl; then
+ mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
+ fi
+
+ if ! use nis; then
+ mycc="${mycc} -DNO_NIS"
+ fi
+
+ if ! use berkdb; then
+ mycc="${mycc} -DNO_DB"
+ if use cdb; then
+ # change default hash format from Berkeley DB to cdb
+ mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
+ fi
+ fi
+
+ if use cdb; then
+ mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
+ # Tinycdb is preferred.
+ if has_version dev-db/tinycdb ; then
+ einfo "Building with dev-db/tinycdb"
+ AUXLIBS_CDB="-lcdb"
+ else
+ einfo "Building with dev-db/cdb"
+ CDB_PATH="/usr/$(get_libdir)"
+ for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
+ AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
+ done
+ fi
+ fi
+
+ # Robin H. Johnson <robbat2@gentoo.org> 17/Nov/2006
+ # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
+ mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+ filter-lfs-flags
+
+ # Workaround for bug #76512
+ if use hardened; then
+ [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
+ fi
+
+ # Remove annoying C++ comment style warnings - bug #378099
+ append-flags -Wno-comment
+
+ sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
+ sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
+
+ emake makefiles shared=yes dynamicmaps=no pie=yes \
+ shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
+ DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
+ AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
+ AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
+ AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
+ AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
+}
+
+src_install () {
+ local myconf
+ use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
+ html_directory=\"/usr/share/doc/${PF}/html\""
+
+ LD_LIBRARY_PATH="${S}/lib" \
+ /bin/sh postfix-install \
+ -non-interactive \
+ install_root="${D}" \
+ config_directory="/etc/postfix" \
+ manpage_directory="/usr/share/man" \
+ command_directory="/usr/sbin" \
+ mailq_path="/usr/bin/mailq" \
+ newaliases_path="/usr/bin/newaliases" \
+ sendmail_path="/usr/sbin/sendmail" \
+ ${myconf} \
+ || die "postfix-install failed"
+
+ # Fix spool removal on upgrade
+ rm -Rf "${D}"/var
+ keepdir /var/spool/postfix
+
+ # Install rmail for UUCP, closes bug #19127
+ dobin auxiliary/rmail/rmail
+
+ # Provide another link for legacy FSH
+ dosym ../sbin/sendmail /usr/$(get_libdir)/sendmail
+
+ # Install qshape, posttls-finger and collate
+ dobin auxiliary/qshape/qshape.pl
+ doman man/man1/qshape.1
+ dobin bin/posttls-finger
+ doman man/man1/posttls-finger.1
+ dobin auxiliary/collate/collate.pl
+ newdoc auxiliary/collate/README README.collate
+
+ # Performance tuning tools and their manuals
+ dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
+ doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
+
+ # Set proper permissions on required files/directories
+ dodir /var/lib/postfix
+ keepdir /var/lib/postfix
+ fowners -R postfix:postfix /var/lib/postfix
+ fperms 0750 /var/lib/postfix
+ fowners root:postdrop /usr/sbin/post{drop,queue}
+ fperms 02711 /usr/sbin/post{drop,queue}
+
+ keepdir /etc/postfix
+ if use mbox; then
+ mypostconf="mail_spool_directory=/var/spool/mail"
+ else
+ mypostconf="home_mailbox=.maildir/"
+ fi
+ LD_LIBRARY_PATH="${S}/lib" \
+ "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
+ -e ${mypostconf} || die "postconf failed"
+
+ insinto /etc/postfix
+ newins "${FILESDIR}"/smtp.pass saslpass
+ fperms 600 /etc/postfix/saslpass
+
+ newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
+ # do not start mysql/postgres unnecessarily - bug #359913
+ use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
+ use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
+
+ dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
+ use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
+
+ pamd_mimic_system smtp auth account
+
+ if use sasl; then
+ insinto /etc/sasl2
+ newins "${FILESDIR}"/smtp.sasl smtpd.conf
+ fi
+
+ # header files
+ insinto /usr/include/postfix
+ doins include/*.h
+
+ # Keep config_dir clean
+ rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
+ rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
+
+ if has_version mail-mta/postfix; then
+ # let the sysadmin decide when to change the compatibility_level
+ sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
+ fi
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ if [[ ! -e /etc/mail/aliases.db ]] ; then
+ ewarn
+ ewarn "You must edit /etc/mail/aliases to suit your needs"
+ ewarn "and then run /usr/bin/newaliases. Postfix will not"
+ ewarn "work correctly without it."
+ ewarn
+ fi
+
+ # configure tls
+ if use ssl ; then
+ if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
+ elog "To configure client side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-client
+ fi
+ if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
+ elog "To configure server side TLS settings:"
+ elog "${EROOT}"usr/sbin/postfix tls enable-server
+ fi
+ fi
+}
diff --git a/mail-mta/qmail-ldap/Manifest b/mail-mta/qmail-ldap/Manifest
new file mode 100644
index 000000000000..565147e4ab47
--- /dev/null
+++ b/mail-mta/qmail-ldap/Manifest
@@ -0,0 +1,13 @@
+AUX 1.03-warnings.patch 2604 SHA256 2b27769cae0a52229787b67ae0f5b7a0fbfbb8377ee43cdaedbef418b27e7444 SHA512 6bf142eb11dd14133786b4c8ff44e70e2e3ef625c7a488e1506030a73c34bb8029ac25be6e2567436aac8b08efaaa174260694875ec22795d8bbb2ca806849ac WHIRLPOOL 73597de4a976eab8ddc3b3ee3e868af816633bda084444e2e2472c18d6ff6b55c34f2567d43d43bd550711168ad45c64ef317efb54fbf3ecabbcff1eb46fbb92
+AUX samples.ldif 821 SHA256 7fc42450cb689ee3e71d12aadef4dd68ec42bd8676040d0f3a22813204482c60 SHA512 2b77a383a1a2fb482f583b8044575ac476a3d0e6ee0a807b05cd42ba25d701e8f1562675518d76df23fbb33b7b7b1c691866ea7d8f918d73cd65c4a4ce52f38c WHIRLPOOL 1a6764a70f13072e965a67ea7fe54e19935f974ca49f5830c12e8f617655168e2478fcceaf6c5b8f84823f751fa993fa716561913ea95cecd64a6cfe6a967ee1
+DIST genqmail-20080406.tar.bz2 10252 SHA256 501ca2120c7619569bd9ac3e0035cb0022bfd0cdc9c720b5c43c9e3a4eb07ce8 SHA512 744d0968307bfedebf0ca7bc0d5bd0780884326acaf5fea0a66fb91f8b0caf5ba52eb443c9cb2a7d6389622ca5c87100c3204ec3408aed8ef5fb1e7f80ff0d35 WHIRLPOOL b385cd2d5e88795f163a4f49dc81a2080d7076ec2016ee7d8154df4488effa7112caf0577c8dc8ff654665213aa4120a21de8223f3dd51056fa189546ace3cf5
+DIST qmail-1.03.tar.gz 220668 SHA256 21ed6c562cbb55092a66197c35c8222b84115d1acab0854fdb1ad1f301626f88 SHA512 f2cc47c3ef4a3595d5953f216811a9b60f505cf8cbfd31ae31a888ee04916936210ef1c23d59e8d280a5f0e1c3794b90ee212b2b0f36361c5eff842598c8aee2 WHIRLPOOL 60c4545738666403ff13e89ffacd817dfcb51066c2de309894af79372cfb8613a34cf287c2e3fb23c7035463ffd4dc7ba3a2f52448012448e711e0054163f7f2
+DIST qmail-ldap-1.03-20060201-controls20060401d.patch 195962 SHA256 49b4418d620af20bb2f3a1b3a9413b51c831bfe7c9ea153f0aef3d5dc76a3577 SHA512 7e75089de1f9ed09f2e1397cbe8b8e68ad44cc164af92eefdbbb58d7b11678505afc3f225d8038f68c891c3ec3443ae768c334593c0f347e4b16189a9606b181 WHIRLPOOL 836ea0ae6806b15f1acb03309c3184e52ef61970abcb7f44e57637b9da1e38fe7ec1e7a35dec30d41171a9256b2996f3747c91f12691cf065586bb83647f9a54
+DIST qmail-ldap-1.03-20060201.patch.gz 270788 SHA256 92ba895df1957109ad856cc1d1554ece4d25d59017e77127dd52d76afd05525a SHA512 c74dd4b600129cac808c8caef63ee8c969887b5c576cd700bb2d021d4480e3e854d147e3e3b72923abe9c3b8bc108c8f00ed7b842eba1f66a961b39f108df798 WHIRLPOOL 82b890617262b9aeb81e30329a6e9a1f8ae63f06a8ceeb817be6c178e8f57abe5a67556b112ac1bb7db4086a9b8260bf24b9bc300c4756d0d5a64e8ac539ea8a
+DIST qmail-ldap-1.03-queue-custom-error.patch 2472 SHA256 77536616109591ef5f4bc0f309879167a14b3d6ce4778ff3f2dcaee9a424c25a SHA512 04db0c940e8c2a888298febc59a11ae023c154b0c21183134e5255b994630993d0a9241724f8bc5e64337c5444e2c3059d5cc29561ac70637cb40c3e52c5a3b3 WHIRLPOOL 28e3e3649ec1348984f3e38f2a8ddc1ca3932fb686d45301d38914226a0f1acfd970dde8a63a7df46c83515297cb0a95c923934ebb0b66b6809ea0591e0f85f8
+DIST qmail-ldap-1.03-spp-0.42.patch 13618 SHA256 0f673a5944347d5e46c7beffd5d9fa760cecb2e61a3291c3392ffa6777cee8c8 SHA512 3aecc004ccc34f1974a9d0d471add0424b3663fefa12a2a47b7312a73eb5ad6dba28cf075e73243c5740ee4a403b1e37f2a2cbe62c6c15cd3ea8e0b840e72021 WHIRLPOOL 9293ca254ffd8c7468962a71aea76a3600a956b42793cca992a82ca8e69a8e719018bb8f1f55cf8e61b9613726c535473e658883df63eddfab29142d57a90c58
+DIST qmail-spp-0.42.tar.gz 18689 SHA256 1518e7e82d10fbbb8ecc520f51daf503edeb9c3a9fb935be65a8185e7b53808d SHA512 03449862886a0ca20fbadab4c94b34b55d185f8df3261bd68aea99e9ded9edfab4477c6b38a8e0295e9b38b0045615da8b1a906a458f28745eadd3c4d882bcbf WHIRLPOOL 2f8525bb264fbec4b057bad6d92968e29085fdf10b8538b8e572d81ea8793e74c07c6093d0cc2a34de00b629e797b048007b30e3845dce76829037fdb44f527c
+EBUILD qmail-ldap-1.03-r8.ebuild 5681 SHA256 50e3f5eaa254c82010d2f7f2b4394378ed97f5a631aee58be7db0ee5a55f4bd0 SHA512 9f4e475e46be7755e341e520c0699e8286860000ffebdc9e12bbf2eaf578d3672d3bc232f557f5c50e8c106d00b89fc70820455d5df10c68e6553580d7f1cd26 WHIRLPOOL 0930e357465085ece7942d150c6a198d369492274cc195bcb3e00bd9b3c5ed18ff45953176f118603c69cb9a9fe405df63c3d9ee5ddfdc9bc44d061ee4954939
+MISC ChangeLog 2520 SHA256 3e6d325342fc438d24d5fa9b27fc445d3766c78b6add9d8b1a66c1d522bbf010 SHA512 d94b8560753a2d4883b1d47155170b4d361d3fe618e06ac76caf3c5af0f1eedc035a89570690483d88bee4df9148d97fc88bc88d1405aea6fb43e56364e549c9 WHIRLPOOL 87b81826b13a3a510541b7e4cc181d86ba08a6f68678ecd01899815823b6d06870e9931f8fa66107992dec4b37b1b49128df6797b7a1a640bf1f97114de65c8e
+MISC ChangeLog-2015 11499 SHA256 fbc00aada9042f8b5d6b93282d48fa5fcff5890211f591596a5593dfe5878479 SHA512 40138426e782e5fc19540da2171b9e0de630d07f46f67268fff85a55e21d266143233ee235654db18f95f8537081b07c7ceda13298feebc8f9b59fdfe7199849 WHIRLPOOL 6b977151146f7cea7e2330e72da11f475530782d19f563023909aef8811f86bb17fde609e88621d0bc57977c5816e06d6e9f324233b4bdcc36456d3caea45466
+MISC metadata.xml 759 SHA256 8e85b9b21556df13e0ae14a40900c46e03820919750617647b466941890d2946 SHA512 97caf06c635b1f639406cac7b9ff84910b8c7ad1147e2ab2b052d10d8841ace90fd3c978534d1203788a481b5763497dd1bf1155ae48053f57ab7ad0981b08c1 WHIRLPOOL d2431d9a66779e720a9866a8225582401ddd6c88045719482449ffd6cf9b90462dad0d55d92f9edabbf5e979bb91444d3bd9a3491a0ba2f4b46952f140186f37
diff --git a/mail-mta/qmail-ldap/files/1.03-warnings.patch b/mail-mta/qmail-ldap/files/1.03-warnings.patch
new file mode 100644
index 000000000000..324d4b35730b
--- /dev/null
+++ b/mail-mta/qmail-ldap/files/1.03-warnings.patch
@@ -0,0 +1,55 @@
+Files qmail-1.03.orig/auth_imap and qmail-1.03/auth_imap differ
+Files qmail-1.03.orig/auth_pop and qmail-1.03/auth_pop differ
+Files qmail-1.03.orig/auth_smtp and qmail-1.03/auth_smtp differ
+diff -NurpP qmail-1.03.orig/control.c qmail-1.03/control.c
+--- qmail-1.03.orig/control.c 2008-04-06 19:06:15.683511000 +0000
++++ qmail-1.03/control.c 2008-04-06 19:15:47.923622781 +0000
+@@ -1,3 +1,6 @@
++#define _GNU_SOURCE 1
++#include <string.h>
++
+ #include <unistd.h>
+ #include "readwrite.h"
+ #include "open.h"
+@@ -10,10 +13,6 @@
+ #include "scan.h"
+ #include "limit.h"
+
+-#if defined(USE_CONTROLDB) || defined(SECUREBIND_SASL) || defined(SECUREBIND_SSL) || defined(SECUREBIND_TLS) || defined(SECUREBIND_ALL)
+-#include <string.h>
+-#endif
+-
+ #ifdef USE_CONTROLDB
+ #include <syslog.h>
+
+@@ -48,7 +47,6 @@ int control_ldap_search(const char *fn,
+
+ #if defined(SECUREBIND_SASL) || defined(SECUREBIND_SSL) || defined(SECUREBIND_TLS) || defined(SECUREBIND_ALL)
+ #include <malloc.h>
+-#include <string.h>
+ #include <malloc.h>
+
+ #include "subfd.h"
+Files qmail-1.03.orig/control.o and qmail-1.03/control.o differ
+Files qmail-1.03.orig/pbsadd and qmail-1.03/pbsadd differ
+Files qmail-1.03.orig/pbscheck and qmail-1.03/pbscheck differ
+Files qmail-1.03.orig/pbsdbd and qmail-1.03/pbsdbd differ
+Files qmail-1.03.orig/qmail-forward and qmail-1.03/qmail-forward differ
+Files qmail-1.03.orig/qmail-group and qmail-1.03/qmail-group differ
+Files qmail-1.03.orig/qmail-inject and qmail-1.03/qmail-inject differ
+Files qmail-1.03.orig/qmail-ldaplookup and qmail-1.03/qmail-ldaplookup differ
+Files qmail-1.03.orig/qmail-lspawn and qmail-1.03/qmail-lspawn differ
+Files qmail-1.03.orig/qmail-newmrh and qmail-1.03/qmail-newmrh differ
+Files qmail-1.03.orig/qmail-pw2u and qmail-1.03/qmail-pw2u differ
+Files qmail-1.03.orig/qmail-qmqpc and qmail-1.03/qmail-qmqpc differ
+Files qmail-1.03.orig/qmail-qmtpd and qmail-1.03/qmail-qmtpd differ
+Files qmail-1.03.orig/qmail-queue and qmail-1.03/qmail-queue differ
+Files qmail-1.03.orig/qmail-quotawarn and qmail-1.03/qmail-quotawarn differ
+Files qmail-1.03.orig/qmail-remote and qmail-1.03/qmail-remote differ
+Files qmail-1.03.orig/qmail-reply and qmail-1.03/qmail-reply differ
+Files qmail-1.03.orig/qmail-secretary and qmail-1.03/qmail-secretary differ
+Files qmail-1.03.orig/qmail-send and qmail-1.03/qmail-send differ
+Files qmail-1.03.orig/qmail-showctl and qmail-1.03/qmail-showctl differ
+Files qmail-1.03.orig/qmail-smtpd and qmail-1.03/qmail-smtpd differ
+Files qmail-1.03.orig/qmail-todo and qmail-1.03/qmail-todo differ
+Files qmail-1.03.orig/qmail-verify and qmail-1.03/qmail-verify differ
diff --git a/mail-mta/qmail-ldap/files/samples.ldif b/mail-mta/qmail-ldap/files/samples.ldif
new file mode 100644
index 000000000000..c1a77c4d97ca
--- /dev/null
+++ b/mail-mta/qmail-ldap/files/samples.ldif
@@ -0,0 +1,32 @@
+#ldapauth, better to use this than your rootdn for security reasons
+dn: uid=ldapauth,ou=People,dc=yhourhost,dc=net
+uid: ldapauth
+cn: ldapuath
+objectClass: account
+objectClass: posixAccount
+objectClass: top
+objectClass: shadowAccount
+shadowLastChange: 12116
+loginShell: /bin/true
+uidNumber: 11184
+gidNumber: 2110
+homeDirectory: /var/qmail/maildirs/
+gecos: ldap authorization,,,
+userPassword: libcrypt_format
+
+#sample user dn
+dn: uid=denverj ,ou=people,dc=yourhost,dc=net
+objectClass: top
+objectClass: inetOrgPerson
+objectClass: qmailUser
+objectClass: person
+cn: John Denver
+givenName: denverj
+sn: denverj
+uid: denverj
+mail: denverj@yourhost.net
+mailMessageStore: /var/qmail/maildirs/denverj/Maildir/
+nohomeDirectory: /var/qmail/maildirs/denverj/
+mailAlternateAddress: denverj@alias.host.net
+userPassword: libcrypt_format
+
diff --git a/mail-mta/qmail-ldap/metadata.xml b/mail-mta/qmail-ldap/metadata.xml
new file mode 100644
index 000000000000..1186ed7cef3d
--- /dev/null
+++ b/mail-mta/qmail-ldap/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <use>
+ <flag name="cluster">Enable this if you want to have cluster support in
+ qmail-ldap</flag>
+ <flag name="gencertdaily">Generate SSL certificates daily instead of
+ hourly</flag>
+ <flag name="highvolume">Prepare qmail for high volume servers</flag>
+ <flag name="rfc2307">Add support for RFC2307 compliant uid/gid
+ attributes</flag>
+ <flag name="rfc822">Add support for RFC822 compliant mail
+ attributes</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">qmail-spp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/qmail-ldap/qmail-ldap-1.03-r8.ebuild b/mail-mta/qmail-ldap/qmail-ldap-1.03-r8.ebuild
new file mode 100644
index 000000000000..a9126133a775
--- /dev/null
+++ b/mail-mta/qmail-ldap/qmail-ldap-1.03-r8.ebuild
@@ -0,0 +1,225 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+GENQMAIL_PV=20080406
+QMAIL_SPP_PV=0.42
+
+QMAIL_LDAP_PV=20060201
+QMAIL_LDAP_F=${P}-${QMAIL_LDAP_PV}.patch.gz
+
+QMAIL_LDAP_SPP_F=${P}-spp-${QMAIL_SPP_PV}.patch
+
+QMAIL_LDAP_CONTROLS_PV=20060401d
+QMAIL_LDAP_CONTROLS_F=${P}-${QMAIL_LDAP_PV}-controls${QMAIL_LDAP_CONTROLS_PV}.patch
+
+inherit eutils qmail
+
+DESCRIPTION="qmail -- a secure, reliable, efficient, simple message transfer agent"
+HOMEPAGE="
+ http://www.qmail-ldap.org
+ http://cr.yp.to/qmail.html
+ http://qmail.org
+"
+SRC_URI="mirror://qmail/qmail-${PV}.tar.gz
+ https://dev.gentoo.org/~hollow/distfiles/${GENQMAIL_F}
+ http://www.nrg4u.com/qmail/${QMAIL_LDAP_F}
+ mirror://gentoo/${QMAIL_LDAP_CONTROLS_F}
+ mirror://gentoo/${P}-queue-custom-error.patch
+ !vanilla? (
+ qmail-spp? (
+ mirror://sourceforge/qmail-spp/${QMAIL_SPP_F}
+ mirror://gentoo/${QMAIL_LDAP_SPP_F}
+ )
+ )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="cluster debug gencertdaily highvolume qmail-spp rfc2307 rfc822 ssl vanilla zlib"
+RESTRICT="test"
+
+DEPEND="
+ !mail-mta/qmail
+ net-nds/openldap
+ net-mail/queue-repair
+ ssl? ( dev-libs/openssl )
+"
+RDEPEND="
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !mail-mta/ssmtp
+ >=sys-apps/ucspi-tcp-0.88-r17
+ ssl? ( >=sys-apps/ucspi-ssl-0.70-r1 )
+ virtual/daemontools
+ >=net-mail/dot-forward-0.71-r3
+ ${DEPEND}
+"
+
+S="${WORKDIR}"/qmail-${PV}
+
+pkg_setup() {
+ if [[ -n "${QMAIL_PATCH_DIR}" ]]; then
+ eerror
+ eerror "The QMAIL_PATCH_DIR variable for custom patches"
+ eerror "has been removed from ${PN}. If you need custom patches"
+ eerror "you should create a copy of this ebuild in an overlay."
+ eerror
+ die "QMAIL_PATCH_DIR is not supported anymore"
+ fi
+
+ qmail_create_users
+}
+
+src_unpack() {
+ genqmail_src_unpack
+ use qmail-spp && qmail_spp_src_unpack
+
+ unpack qmail-${PV}.tar.gz
+
+ cd "${S}"
+
+ # main ldap patch
+ # includes: netqmail-1.05, EXTTODO, BIGTODO, TLS/SMTPAUTH, 0.0.0.0 fix
+ epatch "${DISTDIR}"/${QMAIL_LDAP_F}
+
+ # QmailLDAP/Controls patch
+ # includes: RFC2307/822 fixes
+ epatch "${DISTDIR}"/${QMAIL_LDAP_CONTROLS_F}
+ epatch "${FILESDIR}"/${PV}-warnings.patch
+
+ # fix libraries for controls patch
+ sed -i -e 's|NEWLDAPPROGLIBS=.*|& str.a|' Makefile
+
+ ht_fix_file Makefile*
+
+ if ! use vanilla; then
+ # Add custom bounce messages to qmail-queue
+ epatch "${DISTDIR}"/${P}-queue-custom-error.patch
+
+ # qmail-spp patch
+ use qmail-spp && epatch "${DISTDIR}"/${QMAIL_LDAP_SPP_F}
+ fi
+
+ # makefile options
+ local INCLUDES="-I/usr/include"
+ local LDAPLIBS="-L/usr/lib -lldap -llber"
+ local LDAPFLAGS="-DALTQUEUE -DEXTERNAL_TODO -DDASH_EXT -DSMTPEXECCHECK"
+ local CONTROLDB="-DUSE_CONTROLDB -DQLDAP_BAILOUT"
+ local SECUREBIND= RFCFLAGS=
+
+ use cluster && LDAPFLAGS="${LDAPFLAGS} -DQLDAP_CLUSTER"
+ use highvolume && LDAPFLAGS="${LDAPFLAGS} -DBIGTODO"
+ use zlib && LDAPFLAGS="${LDAPFLAGS} -DDATA_COMPRESS -D QMQP_COMPRESS"
+
+ use rfc2307 && RFCFLAGS="${RFCFLAGS} -DUSE_RFC2307"
+ use rfc822 && RFCFLAGS="${RFCFLAGS} -DUSE_RFC822"
+
+ use ssl && SECUREBIND="-DSECUREBIND_TLS -DSECUREBIND_SSL"
+
+ # a lot of sed magic to get Makefile right
+ local EXP=
+
+ EXP="${EXP} s|^#LDAPINCLUDES=.*|LDAPINCLUDES=${INCLUDES}|;"
+ EXP="${EXP} s|^#LDAPLIBS=.*|LDAPLIBS=${LDAPLIBS}|;"
+ EXP="${EXP} s|^#LDAPFLAGS=.*|LDAPFLAGS=${LDAPFLAGS}|;"
+
+ EXP="${EXP} s|^#CONTROLDB=.*|CONTROLDB=${CONTROLDB}|;"
+ EXP="${EXP} s|^#RFCFLAGS=.*|RFCFLAGS=${RFCFLAGS}|;"
+ EXP="${EXP} s|^#SECUREBIND=.*|SECUREBIND=${SECUREBIND}|;"
+
+ # TODO: do we even need this with LDAP?
+ EXP="${EXP} s|^#SHADOWLIBS=.*|SHADOWLIBS=-lcrypt|;"
+
+ # automagic maildir creation
+ EXP="${EXP} s|^#\(MDIRMAKE=.*\)|\1|;"
+ EXP="${EXP} s|^#\(HDIRMAKE=.*\)|\1|;"
+
+ use debug && EXP="${EXP} s|^#\(DEBUG=.*\)|\1|;"
+ use zlib && EXP="${EXP} s|^#ZLIB=.*|ZLIB=-lz|;"
+
+ if use ssl; then
+ EXP="${EXP} s|^#\(TLS=.*\)|\1|;"
+ EXP="${EXP} s|^#TLSINCLUDES=.*|TLSINCLUDES=${INCLUDES}|;"
+ EXP="${EXP} s|^#TLSLIBS=.*|TLSLIBS=-L/usr/lib -lssl -lcrypto|;"
+ EXP="${EXP} s|^#OPENSSLBIN=.*|OPENSSLBIN=/usr/bin/openssl|;"
+ fi
+
+ qmail_src_postunpack
+
+ sed -i -e "${EXP}" Makefile || die "could not patch Makefile"
+}
+
+src_compile() {
+ qmail_src_compile ldap
+ use qmail-spp && qmail_spp_src_compile
+}
+
+qmail_full_install_hook() {
+ insinto ${QMAIL_HOME}/bin
+ insopts -o root -g qmail -m 0755
+ doins auth_smtp condwrite digest dirmaker pbs{add,check,dbd} \
+ qmail-{forward,group,quotawarn,reply,secretary,verify}
+
+ insopts -o root -g root -m 0750
+ doins qmail-ldaplookup
+
+ insopts -o root -g qmail -m 0711
+ doins qmail-todo
+
+ insopts -o root -g qmail -m 0700
+ doins auth_{imap,pop} qmail-cdb
+}
+
+qmail_man_install_hook() {
+ dodoc EXTTODO POPBEFORESMTP QLDAP* "${FILESDIR}"/samples.ldif
+}
+
+qmail_config_install_hook() {
+ einfo "Installing OpenLDAP schema"
+ insinto /etc/openldap/schema
+ doins qmail.schema qmail-ldap-control/qmailControl.schema
+}
+
+src_install() {
+ qmail_src_install
+}
+
+pkg_postinst() {
+ qmail_queue_setup
+ qmail_rootmail_fixup
+ qmail_tcprules_build
+
+ qmail_config_notice
+ qmail_supervise_config_notice
+ elog
+ elog "If you are looking for documentation, check those links:"
+ elog "http://www.lifewithqmail.com/ldap/"
+ elog " -- Life with qmail-ldap"
+ elog
+ elog "For sample ldifs, please check /usr/share/doc/${PF}/"
+ elog
+}
+
+pkg_preinst() {
+ qmail_tcprules_fixup
+}
+
+pkg_config() {
+ # avoid some weird locale problems
+ export LC_ALL=C
+
+ qmail_config_fast
+ qmail_tcprules_config
+ qmail_tcprules_build
+
+ use ssl && qmail_ssl_generate
+}
diff --git a/mail-mta/qpsmtpd/Manifest b/mail-mta/qpsmtpd/Manifest
new file mode 100644
index 000000000000..ec78b2c4d8a2
--- /dev/null
+++ b/mail-mta/qpsmtpd/Manifest
@@ -0,0 +1,17 @@
+AUX qpsmtpd-0.40-badrcptto_allowrelay.patch 498 SHA256 f0bc5f9d4865084ef673e5271725dd01ec1d3fbfcf4ea47988d728c5acd14acf SHA512 542a36cc410386873fb1eeb39debc443615f39dd0cdfc0e21e914542515ae75294904778f78324e5e5ce03c39542a1e00be0b4d3c7a114b14591f343078ec8c7 WHIRLPOOL 237eb12e95ba61e0a511c42a0e51184eb7dbc6c059008952226fff5c0484509f6d3ad1899fdbf62de98cb798e3bcfec5c4f8e7de2ac62370160c41e14be89062
+AUX qpsmtpd-0.83-accept-empty-email.patch 1599 SHA256 036d280a67da1b737b16cb56ab4acb5fa03b2ade2d38399262c63583ee6874a7 SHA512 859235361dd238a2d1b1fc5d34e951ae184b4c66031b3ffee4c7e33aefc0fbcaa0987aab290b95d08e576da47f69769aa403ba4965f2a20fcaf431412e2a6428 WHIRLPOOL de0599c97f89ea7501ae871b968723c04d8bc7a433f5942b1b28a442e50b1221e2800de5ec716141fe54ec9a1bce0bbecd0e913290f3620cd12410dc53c3b37c
+AUX qpsmtpd-0.83-clamd_conf.patch 706 SHA256 ead4226d7037bbeac5ca66b162a8858da520ef6be73604cfe0e86c9aa51aa6f3 SHA512 644daac5c73a0997707a4195bd70faff436205b274fc2d89043ba2d07b76a2b97462a5bcbbd7146f3a6914f6243e973a0a168740dc97068dfda28eecd3ce2366 WHIRLPOOL eb5a1ed14d73d9d24c967cd79093f4a1f8bbb36b84149dae1488fb5bd448b651e842cf3f5f2526a7ee753e795429a48a7db610b7c0360686ade37ded64c00f7b
+AUX qpsmtpd-0.84-Net-DNS-id.patch 1069 SHA256 e5967b9d43bebd8e7491e40458b83cac0d9e8994d8d9c23d97db6554b134d627 SHA512 daf8e3c03c80f926cd0e94519945941dcd5b376ab5a1e99c3d83d26f800f0d1b69d4bb5c739483916f038fd7c1190746a2114f72416550f01d9a05c62e63d9bb WHIRLPOOL 04b52894701f8253e40f3f8cb6376908f9f19842240d6ad2f4263a4b749828a215b9c4fb5c7268c440ae9bb7eabce91eaef6d28e4c5b72ce910e6990e0d8824b
+AUX qpsmtpd.confd 617 SHA256 7748b525d9c3a3e8cbeec66b8b5df48510a44a1d624168278ce71720e7de8bc0 SHA512 d6dae42a493de7ac7c00e5b1aa2ccb7e1f3b3a2f23011ce854252d1e988d029adcb46407f2aff78cf8c4b832ef38e25a6fa2ddac4512acf7a455ab5f031201a2 WHIRLPOOL 7290cf8d7220e34208250a456b4dc244c9dd2eaf2e4041e201c078a396657c59724653be5a98cf206b7335c6b8378b3e7b0efd0d85cdf39a7276f178d526b089
+AUX qpsmtpd.envd 74 SHA256 bbf8f40198e8a87ff6103b5dc98cae561f0dc9738a6cda3492b00468fbfdfd8e SHA512 2fe8e49d55df9216249fda126cf632c82b19740878f3f8aa3044b4f98d435ebd37933fa786dd89e9f538486251239f87f42942f3e12673d096aca9f5b9cb3ea8 WHIRLPOOL 1d4944de0731b4a2b00da1a9092fa0f995fad80df95a3852307f5eeba19345cf0e2456c436011e1363d7ce91df736ae8e742a4146ee8d93e1687e97cfe195764
+AUX qpsmtpd.initd 2058 SHA256 8bcde362c743ac7400c745e57d732b884943544571ca502bd4f2d4032926215e SHA512 ee3477b3de6f7e7bd5c6460f78d04b3c61fa7448805f53067e4c0c7437d896a47ed3beb2c0bce403b7541a06561f8698aaa4f12e1e4a885412472b8f06d1dbd3 WHIRLPOOL a81a282def0e32ff71959b497f04b6143fa89fe7e7e7a42857bac4503fa1baaa3dd63e3e7da194b566dc57b5b92f5c204a91c853254b5e1a9eb6f51167137e07
+AUX qpsmtpd.initd-r1 2054 SHA256 f3187b68f31e105edea0af7034adea8ee18456029913d32a43b8950e1a6679f3 SHA512 5c62c18b249fe0566b958f1a43f4d31f376005ec393d493fd419b89f0a08a23a41d6b8b24c30d4e5cb7b672a545ebeafc9b5645e3b1e2aa8c7bfcfaca20f07ff WHIRLPOOL 3b2c33e619bd28af7515bb8c98d9cb89951e1ca01bb46f4d8f55dff48c83d477f1dd937b8a4489c93caf70003201326e57bcd967ec8dd17b59bf0ed9dacdc263
+AUX qpsmtpd.xinetd 526 SHA256 45729911251be13007d95bb9e25b6c9c951a6419b8badae4e4097dfc603edcdd SHA512 b02331ea352573ea6bb1a46b1df343d2819ebe39dc4a42ec750c9a59f49a653f01bc933d7a2ee32e86fd386395137309de8202970465a2a2d8668fa35ae03994 WHIRLPOOL 1d483d3053cc72de09b6ea70cc6ed458caf92c6b9cb051f82454f1cb238cfbf1a8163e9161ffcafb002333a681c62f11aa947b635d2d1aeedce555ddbc8815b6
+DIST qpsmtpd-0.84.tar.gz 178260 SHA256 a09865816322531edd59d6fecd4bda35a9d583610b69d69a86e44038da841c98 SHA512 a12491c123d21b4e3965105bbe88ad7e7e61551a3ff4e96eee78c83dcb2afae62239fa24d710092a7ccf60097699901c42d70df8183de6454bef4fb26843358d WHIRLPOOL dfc0049faebbbe203949b24fc6d49213c606f5fbe24b4df35b2be8c8cc77d2350719f304a9c7f16782a67d64a5101debb03baa204d91f97adeaa072bf942a3fb
+DIST qpsmtpd-0.95.tar.gz 367400 SHA256 ec5a7d202f4a90ef1df5581c669440082cd5a4c24f5cf4b86f23b323835c7fdb SHA512 4265606ecde68eda92091e2c3c27645baa131db4197f3d135932dc2ad8d76c1fb6c25ce267ab421cab3a4a9902aa682e4be87a1228e41b226705a64e440ffe87 WHIRLPOOL ea927d322d5b5bb82eb80e279e5ca9f461afd42bbb0922470cf97ca8e87578ae968116ccc263eec57676ca2fa3b4b582a11757f6eb9c15c100664451f989d3cd
+EBUILD qpsmtpd-0.84-r2.ebuild 2114 SHA256 358715f0e2e7c8a895379213f52f361f7d508c0eb5e2fa75e50c010d9303cda9 SHA512 9f692226f67cf179f5c238c1a92db515605597d62a01b5ad0040960546184cb20c676b7b5efbb35cf26f0e9d875473af9ba31a00b4b50122703b1386ad206c35 WHIRLPOOL 2726997d15afe36a0b01793dfc25dead023d237f34cba1bf10f96211d6c44b8e96bbb1cd9a75910faabc9768a778673e1c82af4882fa37a5dece36a6e92e5fbe
+EBUILD qpsmtpd-0.95.ebuild 2231 SHA256 326a69ba29d3e2b744b4669b5bc49cc7dfb7dd8a40d6bf4190acb438e8e7f9e8 SHA512 78676d88efb2cc4924e55e76a9f9fb1f15deb3a74a7760546953f07db1d10d6827dc5028fe6f28e544123422279318dc2b27c0f47f9bb38ce4bad89919215973 WHIRLPOOL 85f8c0867872d5c734145cad67b9a7556c5301afa3700ede965f6f81cc4b7782354eed332dc3f274f9853a52cfe63d41390bc05950dab899acd810419c3758ef
+EBUILD qpsmtpd-9999.ebuild 1924 SHA256 12533b30b9c672fa8b4ec9b4977766a62528599665bf1727ee3b9616e42d775c SHA512 f91d624d6b2cdaef054e95131dcbd456ee1036aec1a83540c2c3e46bbaa22d5291cb298dd6f2d9d235aa53b5f76718b0ccfd776ec117ee034a1cbf608ffeaca9 WHIRLPOOL d81a63234cf81f619b5562aa8e1c53b24977c58fb6163a5c8ab75a82c70ff59d9b116b1a9044b0c4ee0142133462e1ad6b10c2757de2d688711c3850605b7c27
+MISC ChangeLog 3505 SHA256 784fa6bfb33dac40d91255f919617182d67315cdd0063a25551bf4a08851eabe SHA512 870f7e53eb7cef0d5fc2a67712d0ea37c89c2e1d99304cb0320363f7a57bd948c2c8038ea352c8c7eae6d993ca43fb9bd1c07a31ccfc50fba2f4b1ccc12052ee WHIRLPOOL b387ae940a69a6bf0d8fd179262d11a353439878b28cc01d20b671c74b04412f6a2e3e615ecbafa93aded85f5792ce2c2dfcacbe79840ab3637a6a36a8dc2f57
+MISC ChangeLog-2015 4947 SHA256 83b6f0f0400985bd82b26a013dd468ced10005f1c1f68341efc73b3578257e50 SHA512 5d56439de42b7e4df30abef41c4aa976c62c6c419fbfc09c9620bf986b59932c75c8cd4664fbdb56a4dc8ecb0337fe84d1fee1b8e50fce3e56729c4665d3e227 WHIRLPOOL 14b2721adbeb7314a1083fd79ab8ca5ea2a80d8dd04e836b4cd2693bfe23e44e91a2f3ec17c0be46f1a81e5e30f27d8623f120bc27a5ba06e29a2c5924693c6b
+MISC metadata.xml 469 SHA256 ad2e209a10185f17a5a260336d270f07b3fbe73b35512d9121102b9ce09e9597 SHA512 d78cfa5db252e2957c22d76a779e9fd64f821d49c1eac7454c9d86ed8579ee90fba45a9d75e7d44f256f8c0bf25c357c2df9c1d870be16b54d519a47eeb692dd WHIRLPOOL 8648e5d139676d1f1982505a885f459662645c06212f3352934be478075e141cc8a4e197a664343aa2f92255fc09e925b68c36c369c3fd992711ebd1eafaf7e0
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd-0.40-badrcptto_allowrelay.patch b/mail-mta/qpsmtpd/files/qpsmtpd-0.40-badrcptto_allowrelay.patch
new file mode 100644
index 000000000000..1f9f33f9a148
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd-0.40-badrcptto_allowrelay.patch
@@ -0,0 +1,10 @@
+--- qpsmtpd-0.40/plugins/check_badrcptto.badrcptto_allowrelay 2007-06-14 11:57:24.000000000 -0600
++++ qpsmtpd-0.40/plugins/check_badrcptto 2007-06-14 13:26:42.000000000 -0600
+@@ -3,6 +3,7 @@
+
+ sub hook_rcpt {
+ my ($self, $transaction, $recipient, %param) = @_;
++ return (DECLINED) if $self->qp->connection->relay_client;
+ my @badrcptto = $self->qp->config("badrcptto") or return (DECLINED);
+ return (DECLINED) unless $recipient->host && $recipient->user;
+ my $host = lc $recipient->host;
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch b/mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch
new file mode 100644
index 000000000000..2e1dcacc46c3
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd-0.83-accept-empty-email.patch
@@ -0,0 +1,44 @@
+Accept messages with no body.
+
+If a message has no body, there is nothing in the RFC spec that says it
+needs to have a trailing \n for a blank line after the headers.
+
+Thumderbird 10 generates some emails like this, which will always cause
+plugin errors when $transaction->header is accessed otherwise, as there
+is almost no checking that $transaction->header is defined before usage.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+Thanks-To: Jack Bates <ms419@freezone.co.uk>
+
+--- qpsmtpd-0.83.orig/lib/Qpsmtpd/SMTP.pm 2009-04-03 06:24:21.000000000 +0000
++++ qpsmtpd-0.83/lib/Qpsmtpd/SMTP.pm 2012-02-25 05:52:14.000000000 +0000
+@@ -632,7 +632,7 @@
+
+ my $timeout = $self->config('timeout');
+ while (defined($_ = $self->getline($timeout))) {
+- $complete++, last if $_ eq ".\r\n";
++ $complete++, $_ = '' if $_ eq ".\r\n";
+ $i++;
+
+ # should probably use \012 and \015 in these checks instead of \r and \n ...
+@@ -648,7 +648,7 @@
+ unless (($max_size and $size > $max_size)) {
+ s/\r\n$/\n/;
+ s/^\.\./\./;
+- if ($in_header and m/^$/) {
++ if ($in_header and (m/^$/ or $complete > 0)) {
+ $in_header = 0;
+ my @headers = split /^/m, $buffer;
+
+@@ -691,9 +691,10 @@
+
+ # copy all lines into the spool file, including the headers
+ # we will create a new header later before sending onwards
+- $self->transaction->body_write($_);
++ $self->transaction->body_write($_) unless $complete;
+ $size += length $_;
+ }
++ last if $complete > 0;
+ #$self->log(LOGDEBUG, "size is at $size\n") unless ($i % 300);
+ }
+
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd-0.83-clamd_conf.patch b/mail-mta/qpsmtpd/files/qpsmtpd-0.83-clamd_conf.patch
new file mode 100644
index 000000000000..801dc477df9f
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd-0.83-clamd_conf.patch
@@ -0,0 +1,12 @@
+diff -Nuar --exclude '*.orig' --exclude '*.rej' qpsmtpd-0.83.orig/plugins/virus/clamav qpsmtpd-0.83/plugins/virus/clamav
+--- qpsmtpd-0.83.orig/plugins/virus/clamav 2009-07-20 15:36:17.000000000 +0000
++++ qpsmtpd-0.83/plugins/virus/clamav 2009-09-16 01:14:22.903329780 +0000
+@@ -151,7 +151,7 @@
+ $self->{_max_size} ||= 512 * 1024;
+ $self->{_spool_dir} ||= $self->spool_dir();
+ $self->{_back_compat} ||= ''; # make sure something is set
+- $self->{_clamd_conf} ||= '/etc/clamd/conf'; # make sure something is set
++ $self->{_clamd_conf} ||= '/etc/clamd.conf'; # make sure something is set
+ $self->{_declined_on_fail} ||= 0; # decline the message on clamav failure
+
+ unless ($self->{_spool_dir}) {
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd-0.84-Net-DNS-id.patch b/mail-mta/qpsmtpd/files/qpsmtpd-0.84-Net-DNS-id.patch
new file mode 100644
index 000000000000..6331e98cb48b
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd-0.84-Net-DNS-id.patch
@@ -0,0 +1,28 @@
+Net::DNS function nextid() changed to id().
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar qpsmtpd-0.84.orig/qpsmtpd-async qpsmtpd-0.84/qpsmtpd-async
+--- qpsmtpd-0.84.orig/qpsmtpd-async 2009-04-03 05:48:34.000000000 +0000
++++ qpsmtpd-0.84/qpsmtpd-async 2013-04-15 23:01:49.952857659 +0000
+@@ -145,7 +145,7 @@
+ # print "Next DNS ID: $Net::DNS::Resolver::global{id}\n";
+ };
+ if ($@) {
+- # print "Next DNS ID: " . Net::DNS::Header::nextid() . "\n";
++ # print "Next DNS ID: " . Net::DNS::Header::id() . "\n";
+ }
+
+ # Fixup lost kqueue after fork
+diff -Nuar qpsmtpd-0.84.orig/qpsmtpd-forkserver qpsmtpd-0.84/qpsmtpd-forkserver
+--- qpsmtpd-0.84.orig/qpsmtpd-forkserver 2010-04-08 05:29:52.000000000 +0000
++++ qpsmtpd-0.84/qpsmtpd-forkserver 2013-04-15 23:01:49.952857659 +0000
+@@ -285,7 +285,7 @@
+ # all children should have different seeds, to prevent conflicts
+ srand();
+ for (0 .. rand(65536)) {
+- Net::DNS::Header::nextid();
++ Net::DNS::Header::id();
+ }
+
+ close $_ for $select->handles;
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd.confd b/mail-mta/qpsmtpd/files/qpsmtpd.confd
new file mode 100644
index 000000000000..9a82c7100e21
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd.confd
@@ -0,0 +1,25 @@
+# Config file for /etc/init.d/qpsmtpd
+#
+
+QPSMTPD_CONFIG="/etc/qpsmtpd"
+QPSMTPD_NICELEVEL="0"
+
+# Select QPSMTPD server type
+# - async
+# Not all plugins work without problems with the async mode.
+# - forkserver (default)
+# - prefork
+# Does not work 100%. Use at your own risk.
+QPSMTPD_SERVER_TYPE="forkserver"
+
+# QPSMTPD options. This can be different depending on
+# what QPSMTPD server you run.
+#
+# Typical forkserver
+QPSMTPD_OPTIONS="-l 0.0.0.0 -p 25 -u smtpd"
+#
+# Typical prefork
+# QPSMTPD_OPTIONS="--interface 0.0.0.0 --port 25 --user smtpd"
+#
+# Typical async
+# QPSMTPD_OPTIONS="-l 0.0.0.0 -p 25 -u smtpd"
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd.envd b/mail-mta/qpsmtpd/files/qpsmtpd.envd
new file mode 100644
index 000000000000..3665116f34ea
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd.envd
@@ -0,0 +1,2 @@
+QPSMTPD_CONFIG="/etc/qpsmtpd"
+CONFIG_PROTECT="/usr/share/qpsmtpd/plugins"
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd.initd b/mail-mta/qpsmtpd/files/qpsmtpd.initd
new file mode 100644
index 000000000000..8f4b27f85ed4
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd.initd
@@ -0,0 +1,62 @@
+#!/sbin/openrc-run
+
+pidfile=/var/run/qpsmtpd/qpsmtpd.pid
+
+depend() {
+ use logger dns ypbind amavisd mysql postgresql antivirus postfix_greylist net saslauthd
+ provide mta
+}
+
+checkconfig() {
+ if ! [ -d "${QPSMTPD_CONFIG:-/etc/qpsmtpd}" ]; then
+ eerror "Configuration directory ${QPSMTPD_CONFIG:-/etc/qpsmtpd} does not exist."
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting qpsmtpd [${QPSMTPD_SERVER_TYPE}] server"
+ HOME="/var/spool/qpsmtpd"
+ local QPSMTPD_SERVER_BIN=""
+ local myopts=""
+ export QPSMTPD_CONFIG=${QPSMTPD_CONFIG}
+ for foo in PERL_UNICODE LANG LC_TIME LC_ALL BASH_ENV ENV CDPATH IFS
+ do
+ unset ${foo}
+ done
+ case "${QPSMTPD_SERVER_TYPE}" in
+ prefork)
+ QPSMTPD_SERVER_BIN="/usr/bin/qpsmtpd-prefork"
+ QPSMTPD_OPTIONS="$(echo "${QPSMTPD_OPTIONS}" | sed "s:\-\-pid\-file[\t ]\{1,99\}[^ ]*::gI")"
+ # Option --pid-file is mentioned in the help of the prefork server
+ # but does not work when specified.
+ # QPSMTPD_OPTIONS="${QPSMTPD_OPTIONS} --pid-file ${pidfile}"
+ myopts="${myopts} --make-pidfile --pidfile ${pidfile}"
+ ;;
+ async)
+ QPSMTPD_SERVER_BIN="/usr/sbin/qpsmtpd-async"
+ myopts="${myopts} --background --make-pidfile --pidfile ${pidfile}"
+ ;;
+ forkserver|*)
+ QPSMTPD_SERVER_BIN="/usr/bin/qpsmtpd-forkserver"
+ QPSMTPD_OPTIONS="$(echo "${QPSMTPD_OPTIONS}" | sed "s:\-\-pid\-file[\t ]\{1,99\}[^ ]*::gI")"
+ QPSMTPD_OPTIONS="$(echo "${QPSMTPD_OPTIONS}" | sed "s:[\t ]\{0,99\}\-d[\t ]\{1,99\}|[\t ]\{1,99\}\-d[\t ]\{0,99\}::gI")"
+ QPSMTPD_OPTIONS="$(echo "${QPSMTPD_OPTIONS}" | sed "s:[\t ]\{0,99\}\-\detach[\t ]\{1,99\}|[\t ]\{1,99\}\-\-detach[\t ]\{0,99\}::gI")"
+ QPSMTPD_OPTIONS="${QPSMTPD_OPTIONS} --pid-file ${pidfile} --detach"
+ myopts="${myopts} --pidfile ${pidfile}"
+ ;;
+ esac
+ start-stop-daemon --start --nicelevel ${QPSMTPD_NICELEVEL:-0} \
+ --quiet ${myopts} \
+ --exec ${QPSMTPD_SERVER_BIN} \
+ -- ${QPSMTPD_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping qpsmtpd [${QPSMTPD_SERVER_TYPE}] server"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd.initd-r1 b/mail-mta/qpsmtpd/files/qpsmtpd.initd-r1
new file mode 100644
index 000000000000..a0c8f591b598
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd.initd-r1
@@ -0,0 +1,62 @@
+#!/sbin/openrc-run
+
+pidfile=/run/qpsmtpd/qpsmtpd.pid
+
+depend() {
+ use logger dns ypbind amavisd mysql postgresql antivirus postfix_greylist net saslauthd
+ provide mta
+}
+
+checkconfig() {
+ if ! [ -d "${QPSMTPD_CONFIG:-/etc/qpsmtpd}" ]; then
+ eerror "Configuration directory ${QPSMTPD_CONFIG:-/etc/qpsmtpd} does not exist."
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting qpsmtpd [${QPSMTPD_SERVER_TYPE}] server"
+ HOME="/var/spool/qpsmtpd"
+ local QPSMTPD_SERVER_BIN=""
+ local myopts=""
+ export QPSMTPD_CONFIG=${QPSMTPD_CONFIG}
+ for foo in PERL_UNICODE LANG LC_TIME LC_ALL BASH_ENV ENV CDPATH IFS
+ do
+ unset ${foo}
+ done
+ case "${QPSMTPD_SERVER_TYPE}" in
+ prefork)
+ QPSMTPD_SERVER_BIN="/usr/bin/qpsmtpd-prefork"
+ QPSMTPD_OPTIONS="$(echo "${QPSMTPD_OPTIONS}" | sed "s:\-\-pid\-file[\t ]\{1,99\}[^ ]*::gI")"
+ # Option --pid-file is mentioned in the help of the prefork server
+ # but does not work when specified.
+ # QPSMTPD_OPTIONS="${QPSMTPD_OPTIONS} --pid-file ${pidfile}"
+ myopts="${myopts} --make-pidfile --pidfile ${pidfile}"
+ ;;
+ async)
+ QPSMTPD_SERVER_BIN="/usr/sbin/qpsmtpd-async"
+ myopts="${myopts} --background --make-pidfile --pidfile ${pidfile}"
+ ;;
+ forkserver|*)
+ QPSMTPD_SERVER_BIN="/usr/bin/qpsmtpd-forkserver"
+ QPSMTPD_OPTIONS="$(echo "${QPSMTPD_OPTIONS}" | sed "s:\-\-pid\-file[\t ]\{1,99\}[^ ]*::gI")"
+ QPSMTPD_OPTIONS="$(echo "${QPSMTPD_OPTIONS}" | sed "s:[\t ]\{0,99\}\-d[\t ]\{1,99\}|[\t ]\{1,99\}\-d[\t ]\{0,99\}::gI")"
+ QPSMTPD_OPTIONS="$(echo "${QPSMTPD_OPTIONS}" | sed "s:[\t ]\{0,99\}\-\detach[\t ]\{1,99\}|[\t ]\{1,99\}\-\-detach[\t ]\{0,99\}::gI")"
+ QPSMTPD_OPTIONS="${QPSMTPD_OPTIONS} --pid-file ${pidfile} --detach"
+ myopts="${myopts} --pidfile ${pidfile}"
+ ;;
+ esac
+ start-stop-daemon --start --nicelevel ${QPSMTPD_NICELEVEL:-0} \
+ --quiet ${myopts} \
+ --exec ${QPSMTPD_SERVER_BIN} \
+ -- ${QPSMTPD_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping qpsmtpd [${QPSMTPD_SERVER_TYPE}] server"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/mail-mta/qpsmtpd/files/qpsmtpd.xinetd b/mail-mta/qpsmtpd/files/qpsmtpd.xinetd
new file mode 100644
index 000000000000..71cb21c2b98e
--- /dev/null
+++ b/mail-mta/qpsmtpd/files/qpsmtpd.xinetd
@@ -0,0 +1,20 @@
+# default: off
+# description: The telnet server serves telnet sessions; it uses \
+# unencrypted username/password pairs for authentication.
+
+service smtp
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = smtpd
+ group = smtpd
+ groups = yes
+ log_on_failure += USERID HOST
+ disable = yes
+ rlimit_as = 128M
+ instances = 40
+ per_source = 10
+ cps = 50 10
+ server = /usr/bin/qpsmtpd
+}
diff --git a/mail-mta/qpsmtpd/metadata.xml b/mail-mta/qpsmtpd/metadata.xml
new file mode 100644
index 000000000000..de132d22fea8
--- /dev/null
+++ b/mail-mta/qpsmtpd/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <use>
+ <flag name="postfix">create user with permissions for proper postfix interaction</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">smtpd/qpsmtpd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-mta/qpsmtpd/qpsmtpd-0.84-r2.ebuild b/mail-mta/qpsmtpd/qpsmtpd-0.84-r2.ebuild
new file mode 100644
index 000000000000..b0dc181fd287
--- /dev/null
+++ b/mail-mta/qpsmtpd/qpsmtpd-0.84-r2.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils perl-app user
+
+DESCRIPTION="qpsmtpd is a flexible smtpd daemon written in Perl"
+HOMEPAGE="http://smtpd.develooper.com"
+SRC_URI="http://smtpd.develooper.com/files/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="postfix ipv6 syslog"
+
+RDEPEND=">=dev-lang/perl-5.8.0
+ >=dev-perl/Net-DNS-0.690.0
+ virtual/perl-MIME-Base64
+ dev-perl/MailTools
+ dev-perl/IPC-Shareable
+ dev-perl/Socket6
+ dev-perl/Danga-Socket
+ dev-perl/ParaDNS
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ syslog? ( virtual/perl-Sys-Syslog )
+ virtual/inetd"
+
+pkg_setup() {
+ enewgroup smtpd
+ local additional_groups
+ if use postfix; then
+ additional_groups="${additional_groups},postdrop"
+ fi
+ enewuser smtpd -1 -1 /var/spool/qpsmtpd smtpd${additional_groups}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.40-badrcptto_allowrelay.patch
+ #epatch "${FILESDIR}"/${PN}-0.83-clamd_conf.patch
+ epatch "${FILESDIR}"/${PN}-0.83-accept-empty-email.patch
+ epatch "${FILESDIR}"/${PN}-0.84-Net-DNS-id.patch
+}
+
+src_install() {
+ perl-module_src_install
+
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}"/qpsmtpd.xinetd qpsmtpd
+
+ dodir /usr/share/qpsmtpd
+ cp -Rf plugins "${D}"/usr/share/qpsmtpd/
+
+ insinto /etc/qpsmtpd
+ doins config.sample/*
+
+ echo "/usr/share/qpsmtpd/plugins" > "${D}"/etc/qpsmtpd/plugin_dirs
+ echo "/var/spool/qpsmtpd" > "${D}"/etc/qpsmtpd/spool_dir
+ cat >"${D}"/etc/qpsmtpd/logging <<-EOF
+ #logging/syslog loglevel LOGINFO priority LOG_NOTICE
+ #logging/file loglevel LOGINFO /var/log/qpsmtpd/%Y-%m-%d
+ EOF
+ if use syslog; then
+ sed -i -e '/^#logging\/syslog/s,^#,,g' "${D}"/etc/qpsmtpd/logging || die
+ else
+ sed -i -e '/^#logging\/file/s,^#,,g' "${D}"/etc/qpsmtpd/logging || die
+ fi
+
+ newenvd "${FILESDIR}"/qpsmtpd.envd 99qpsmtpd
+
+ newconfd "${FILESDIR}"/qpsmtpd.confd qpsmtpd
+ newinitd "${FILESDIR}"/qpsmtpd.initd-r1 qpsmtpd
+
+ dodoc CREDITS Changes README README.plugins STATUS
+
+ diropts -m 0755 -o smtpd -g smtpd
+ dodir /var/spool/qpsmtpd /var/log/qpsmtpd
+ keepdir /var/spool/qpsmtpd /var/log/qpsmtpd
+
+}
diff --git a/mail-mta/qpsmtpd/qpsmtpd-0.95.ebuild b/mail-mta/qpsmtpd/qpsmtpd-0.95.ebuild
new file mode 100644
index 000000000000..c815be43a4db
--- /dev/null
+++ b/mail-mta/qpsmtpd/qpsmtpd-0.95.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+[[ ${PV} == *9999 ]] && SCM="git-2"
+inherit eutils perl-app user ${SCM}
+
+DESCRIPTION="qpsmtpd is a flexible smtpd daemon written in Perl"
+HOMEPAGE="https://smtpd.github.io/qpsmtpd/"
+KEYWORDS=""
+if [[ ${PV} != *9999 ]]; then
+ SRC_URI="https://github.com/smtpd/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+else
+ # This is a spotted development fork with many improvements
+EGIT_REPO_URI="https://github.com/smtpd/${PN}.git"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+IUSE="postfix ipv6 syslog"
+
+RDEPEND=">=dev-lang/perl-5.8.0
+ >=dev-perl/Net-DNS-0.690.0
+ virtual/perl-MIME-Base64
+ dev-perl/MailTools
+ dev-perl/IPC-Shareable
+ dev-perl/Socket6
+ dev-perl/Danga-Socket
+ dev-perl/ParaDNS
+ dev-perl/UNIVERSAL-isa
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ syslog? ( virtual/perl-Sys-Syslog )
+ virtual/inetd"
+
+pkg_setup() {
+ enewgroup smtpd
+ local additional_groups
+ if use postfix; then
+ additional_groups="${additional_groups},postdrop"
+ fi
+ enewuser smtpd -1 -1 /var/spool/qpsmtpd smtpd${additional_groups}
+}
+
+src_unpack() {
+ if [[ ${PV} != *9999 ]]; then
+ unpack ${A}
+ cd "${S}"
+ else
+ git-2_src_unpack
+ cd "${S}"
+ fi
+}
+
+src_install() {
+ perl-module_src_install
+
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}"/qpsmtpd.xinetd qpsmtpd
+
+ dodir /usr/share/qpsmtpd
+ cp -Rf plugins "${D}"/usr/share/qpsmtpd/
+
+ diropts -m 0755 -o smtpd -g smtpd
+ dodir /var/spool/qpsmtpd
+ keepdir /var/spool/qpsmtpd
+
+ dodir /etc/qpsmtpd
+ insinto /etc/qpsmtpd
+ doins config.sample/*
+
+ echo "/usr/share/qpsmtpd/plugins" > "${D}"/etc/qpsmtpd/plugin_dirs
+ echo "/var/spool/qpsmtpd" > "${D}"/etc/qpsmtpd/spool_dir
+ if use syslog; then
+ echo "logging/syslog loglevel LOGINFO priority LOG_NOTICE" > "${D}"/etc/qpsmtpd/logging
+ else
+ diropts -m 0755 -o smtpd -g smtpd
+ dodir /var/log/qpsmtpd
+ keepdir /var/log/qpsmtpd
+ echo "logging/file loglevel LOGINFO /var/log/qpsmtpd/%Y-%m-%d" > "${D}"/etc/qpsmtpd/logging
+ fi
+
+ newenvd "${FILESDIR}"/qpsmtpd.envd 99qpsmtpd
+
+ newconfd "${FILESDIR}"/qpsmtpd.confd qpsmtpd
+ newinitd "${FILESDIR}"/qpsmtpd.initd-r1 qpsmtpd
+
+ dodoc CREDITS Changes README.md README.plugins.md STATUS UPGRADING.md
+}
diff --git a/mail-mta/qpsmtpd/qpsmtpd-9999.ebuild b/mail-mta/qpsmtpd/qpsmtpd-9999.ebuild
new file mode 100644
index 000000000000..1374e821c0e6
--- /dev/null
+++ b/mail-mta/qpsmtpd/qpsmtpd-9999.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils perl-app user git-2
+
+DESCRIPTION="qpsmtpd is a flexible smtpd daemon written in Perl"
+HOMEPAGE="https://smtpd.github.io/qpsmtpd/"
+# This is a spotted development fork with many improvements
+EGIT_REPO_URI="https://github.com/smtpd/${PN}.git"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+IUSE="postfix ipv6 syslog"
+
+RDEPEND=">=dev-lang/perl-5.8.0
+ >=dev-perl/Net-DNS-0.690.0
+ virtual/perl-MIME-Base64
+ dev-perl/MailTools
+ dev-perl/IPC-Shareable
+ dev-perl/Socket6
+ dev-perl/Danga-Socket
+ dev-perl/ParaDNS
+ dev-perl/UNIVERSAL-isa
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ syslog? ( virtual/perl-Sys-Syslog )
+ virtual/inetd"
+
+pkg_setup() {
+ enewgroup smtpd
+ local additional_groups
+ if use postfix; then
+ additional_groups="${additional_groups},postdrop"
+ fi
+ enewuser smtpd -1 -1 /var/spool/qpsmtpd smtpd${additional_groups}
+}
+
+src_install() {
+ perl-module_src_install
+
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}"/qpsmtpd.xinetd qpsmtpd
+
+ dodir /usr/share/qpsmtpd
+ cp -Rf plugins "${D}"/usr/share/qpsmtpd/
+
+ diropts -m 0755 -o smtpd -g smtpd
+ dodir /var/spool/qpsmtpd
+ keepdir /var/spool/qpsmtpd
+
+ dodir /etc/qpsmtpd
+ insinto /etc/qpsmtpd
+ doins config.sample/*
+
+ echo "/usr/share/qpsmtpd/plugins" > "${D}"/etc/qpsmtpd/plugin_dirs
+ echo "/var/spool/qpsmtpd" > "${D}"/etc/qpsmtpd/spool_dir
+ if use syslog; then
+ echo "logging/syslog loglevel LOGINFO priority LOG_NOTICE" > "${D}"/etc/qpsmtpd/logging
+ else
+ diropts -m 0755 -o smtpd -g smtpd
+ dodir /var/log/qpsmtpd
+ keepdir /var/log/qpsmtpd
+ echo "logging/file loglevel LOGINFO /var/log/qpsmtpd/%Y-%m-%d" > "${D}"/etc/qpsmtpd/logging
+ fi
+
+ newenvd "${FILESDIR}"/qpsmtpd.envd 99qpsmtpd
+
+ newconfd "${FILESDIR}"/qpsmtpd.confd qpsmtpd
+ newinitd "${FILESDIR}"/qpsmtpd.initd-r1 qpsmtpd
+
+ dodoc CREDITS Changes README.md README.plugins.md STATUS UPGRADING.md
+}
diff --git a/mail-mta/sendmail/Manifest b/mail-mta/sendmail/Manifest
new file mode 100644
index 000000000000..2cffaa41878a
--- /dev/null
+++ b/mail-mta/sendmail/Manifest
@@ -0,0 +1,17 @@
+AUX libmilter-sharedlib.patch 2843 SHA256 3a753b0881fe622814b471ee5f9037905c7cc3ed08ef74908464ab5307e59d5a SHA512 31c36b57739946c1b9c7c85307fe5c53c45d7f8cbf427a0f2248db8b74871a6f5a30ef1af524915821aeca54310d28272bcd0a587cb918192214fa5c30e4a8da WHIRLPOOL 1ee6cdbee9e32e66c5836d7a296f741476d4cf03625dd4409ecdaba5001063e11b1f6f3d3b07e8150563641eaa78ff336759e278782f04bcab75d2dc73a10e8f
+AUX sendmail 595 SHA256 102e312ecdd06be2426f9d3de55ccfac60aca2eda8cadd8c634b6ae0ef35c5e8 SHA512 0a1611eeec33a7d7eecff75ed6c8f70abf0d6d8cf4a5242f084da0d4139e0e871239e9893a53782e5dab80c4386c62d96ec03839fc98a497e697fce1f7a149aa WHIRLPOOL 0d7ca7ee89b86935c33882eacb0625edc345151b0616d029eaefee7053eae1c3b86f78a3588da682951036aecc8aae3cf7d83d48c85f1b7cc93a16603b1b6813
+AUX sendmail-8.14.5+db-5.0.patch 432 SHA256 8de05f83c7d6fd287e965666f7b4c502fb0e00dc872a0c83ff48b0a83735f9a6 SHA512 f9df3b0560a0620a9875f6e85b1ea0866879aafd3475efa47539f41f4b54a34fe91c752a067fb62634cb71ad09c44b8408bdacddf3d5c47545b49c618eb005ec WHIRLPOOL 4f3fcaf7b123caba5cf2a13a243bbdc6f7a69d69088107c829a96a4c274137fdac13143a12a1c8ea92ce7cf3013e5fbd66e586ffdf08f16e1ced429fcf28826c
+AUX sendmail-8.14.6-build-system.patch 12909 SHA256 ca489d3b4c305a3e28ab0b6034484d0eac9ea84e1a89354d5903aca3ae8083cc SHA512 0e03b7cfd7f3002a36fed2fca60240314bac175a502ca9bda8397e7ad07e26faf8d3437bbdcdb9cda4dbc6b4917ca0ed1b5c9126ad246044dc7da8ce3ad70b54 WHIRLPOOL 026c355b31666b8e67887ab4da0411cbcbbe96373da434f25238888b68c1942a0e588c8540fc5b5069d3422556058cc53d1b924ee7811202ab6b514c00c8c147
+AUX sendmail-delivered_hdr.patch 341 SHA256 bfe354d1047c66ea857e56cb374f583eb779c8f4ccc92ea766e916ec358cd77c SHA512 1e97ca1b32e6cbb69fe08d4e1c5dee0763ef874537448e60129f71f82bc92c78fc5d9e124568d21188b6e6e2186a1a3c9f1362b0d0734f7e12e2272643238254 WHIRLPOOL 60e858808e7df43aa0da536921052931cbcfab754bdc979b2e56556879c4e4416c45aaa38bce7affc4a0a7fe9fb519d2f0a2ecc8ee93db81e5101413c7b20e11
+AUX sendmail-procmail.mc 295 SHA256 6972193f47b4d91221a9082e33670059c41439794efbfa9f7cc6efe8dba77ef6 SHA512 eb693fb91acdc3cbc4601d517119300f238c20e86dc0dbc137a209ce56bd5bf7d7a8c9848a143daf932be487d919004da994ba2dbd7494ea5be6e08929549d58 WHIRLPOOL ba9478d4e618f9a8405b3d8a5413cba853d142f5a161f8fe580f53e08e20eb74bd92ebd95e63cea6dfc82b0b1b0c5aecfba18b8220b4d3c4d9a4108433a54433
+AUX sendmail-starttls-multi-crl.patch 643 SHA256 9cfbc3f9049c6380693854cd1f3af95ec24f02db7116939b808751acaed1f313 SHA512 3028c9aca8b1f69d911b8fa78027acc949b1584fdb5be514ee71cb2860658ed1a13ee964696a93af3e9999c7f02526c046455d8740129d3eea546c272df24bd2 WHIRLPOOL 986b36c2c5f1d297d3a8df409b045e940d61d09db5f6dcf927fd6e429aa8593a6db64757a12531306b320e9a23dbb4d69bfec9952ab597a241cbd11c70e611c1
+AUX sendmail.mc-r1 285 SHA256 a26043f1b06f27eaa6238a696cf23e16b593128ebe086fed40b87c61865b1ac7 SHA512 f197572f4004cd1f9de4c423d1d5ded382535b9643b32aa8dc03889cdf76bf918702a77a20edde5f2d19276ca7ec473cac5db01c42b0833cda950cfc11cbbf41 WHIRLPOOL 8d32f1a88ca995b272c54696bf3af2fe218b0d6998dd80897fbf256d852091a6f89f1030d0806191fd649bcb5513813354823b917c9a680d61c8b7fdc411f28f
+AUX sendmail.service 353 SHA256 8238af44ac0baa8c39d38a047933c3dc66a015b7f93254b2e1033d0d211aa933 SHA512 3bf4d502c965c56c7d421b1a1b68ab49d42f61d7227bf91d56c527ed1ae1a604aead35a6b774f6e534e9b014f3f6d1e53c00c349df1f2b90a81f70b5d5948012 WHIRLPOOL e28c138c60cf68deda558ec433314ff1a698c761c88a35e0917db371437f35016c3414c73185bd58467bdee1b3d1f6e7da7307e3c350761e331d6e410c6a5fe8
+AUX site.config.m4 564 SHA256 3a7d586f8dfc24f7ed53621c04374aeca91153ded80cf17411ce417a45aade44 SHA512 82d9bbb233e6ffbcef411f8a8184b47aea27f3dc0b41ace053e0107e05a5fe6929d9dd76d3d1baf0ce43be78dc46f40888ad0c93e4f126f6ce0c0372007a262d WHIRLPOOL 3eb5169eda91a67e62fd6ece0bb69bb9dbe3f7e210a40242a172a7b3e80952713170882f89ddbb1c49b261cdefce05992c61417560e6df9e7f0860a97cb5c0bb
+AUX sm-client.service 418 SHA256 c70560eb85b32895dcb36fd398b3066a39597e2def33e1eead4f55f3059c82d6 SHA512 26e5a64790fd7106e45de0f4dfafb3b648094953bd1831a223ca7c60b7cb75b673fb554b426a6aa0e7dc200a134fd042b4ecc6795641cfddd82bd04e4c7ea324 WHIRLPOOL e6b176381beb18fc240154696d8056b1483a2ff97bb7d012bece388087dcb16adf2db3b626a717b001cea8ffe8cb81e527e2174ecd463ed452fd68e2ad96e12f
+DIST sendmail.8.14.9.tar.gz 2114293 SHA256 f5a497151abd8f341cca0736c3f9bd703d574d93146b2989689dff6d7a445d75 SHA512 a541fe687e9967fb87f2f6c6263ecc698aac42c6a52e81e7ee556f0c3d719b9c996dfccf10cc2e0e5c6d03dd8d3ce79b856b78ca049dd47665e38c77763fa424 WHIRLPOOL c1b290d66d9397bbe8041cd17cfc1fbc205c9d5439d89ee59c339e3febe605d964e7a50482101edec8f0b9cd6df38138e489869a5404dbfc2b7ba57dbeef1c55
+EBUILD sendmail-8.14.9-r1.ebuild 7110 SHA256 038b3adf4ec687a1ad666fe001f49d627ce75cf5def21b9b4bb1ac9b577083d6 SHA512 3392d8cc6f5370958a22055cd403c9730b17e28a2388bb87264edbd264ddf117ca1c43a3623ba70126542dd63cfe5a611a3a6c1bfc15fda4dc4a3a2bc08f8652 WHIRLPOOL 128bd32471729311abf0d9bd4003a30f83cb3f3ca6099c850bdfc4c38fe951cafbca73dac4253a38e42932d1916a5eee3966d2789e20cb66504cca8c5a730be4
+EBUILD sendmail-8.14.9.ebuild 7038 SHA256 a36aa4a7502d629ec81e9714f4fe3907c1294a845261684feaa8c6eeb4449356 SHA512 bb29cee737f08e55e672315ac0dfa26d660dcbdf2dec2b6cd648596449ff837be654890c14f68fd13612d3d799ea084af3bd55a514ab5c67ef0ae4ba9273ced2 WHIRLPOOL f73a6bad4857e9db19ccd26ca387870a9776e7cecaac108c39d328253e2a530a0f874ae5c11f98791970bc7e030c68328b7eb66db4ee5dd2674f51649245b039
+MISC ChangeLog 3043 SHA256 d90830b1f29106f8ddba1c0a5cbd9b892b4360df0449237a5ce7f5dadde8a2f2 SHA512 1b3fd8a43c6729c3567f53d4b6919743189aeec8fc4df97f6693eb6adf6d28cb34b3e388aae03d88e50fbe5547560e7162d1d38031631268ead25fdc80654e82 WHIRLPOOL 916a6c4e69ec6917112783059d0e84c020c6004e63770568b0bfde1fdaea41ee9f24c3bd3f3eb8810a0801c0723f807fe33581f26de00161a9a0a5990fa39fa8
+MISC ChangeLog-2015 26755 SHA256 bf440575028af352c0b34015b6e6352e1257064883d728af69618d6cff2b8a17 SHA512 bb22f00ae2f27725bda3fd1a93c929c545042ba83351735a4be76d2e105b76972b789be0a1b39ee80631355b5592162ed4449935231bd023a7ca54ede4919e79 WHIRLPOOL e847db3f6fbf380268abd2299a7b7c5ac453592982aeca9cb0d6b2169790614028079821f1b9b977b7d706c8071367fa4e9e4848ae4a33988444bcc65209525f
+MISC metadata.xml 244 SHA256 856e819659934229aa18649e0c783b9714fa33065cb5113e7b667ed68392b39a SHA512 0e856f808459b6d83c6eaeee418d87d85385968a39e6c1871a0eb76c04b533bbba16996a6f18613b7c550da90c76843bd01237be9b9f290394048e904535653c WHIRLPOOL 2aa292ef66863766df8920a2ebd497218854f9a41724cdef1d63a93c94620fbea641a688af2bb374673773dd5b1b8afff80867c974f49d5600991ab44f9b8752
diff --git a/mail-mta/sendmail/files/libmilter-sharedlib.patch b/mail-mta/sendmail/files/libmilter-sharedlib.patch
new file mode 100644
index 000000000000..43ec78612190
--- /dev/null
+++ b/mail-mta/sendmail/files/libmilter-sharedlib.patch
@@ -0,0 +1,55 @@
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4 sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4 1970-01-01 01:00:00.000000000 +0100
++++ sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4 2009-08-22 21:51:10.000000000 +0200
+@@ -0,0 +1,39 @@
++divert(-1)
++#
++# Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
++# All rights reserved.
++#
++# By using this file, you agree to the terms and conditions set
++# forth in the LICENSE file which can be found at the top level of
++# the sendmail distribution.
++#
++#
++# Definitions for Makefile construction for sendmail
++#
++divert(0)dnl
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/links.m4')dnl
++bldLIST_PUSH_ITEM(`bldC_PRODUCTS', bldCURRENT_PRODUCT)dnl
++bldPUSH_TARGET(bldCURRENT_PRODUCT`.so' bldCURRENT_PRODUCT`.a')dnl
++bldPUSH_INSTALL_TARGET(`install-'bldCURRENT_PRODUCT)dnl
++bldPUSH_CLEAN_TARGET(bldCURRENT_PRODUCT`-clean')dnl
++
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/defines.m4')
++divert(bldTARGETS_SECTION)
++bldCURRENT_PRODUCT.so: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++ ${CCLINK} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.so -Wl,confSONAME,bldCURRENT_PRODUCT.so.${MILTER_SOVER} ${bldCURRENT_PRODUCT`OBJS'} -lc ${LIBS}
++bldCURRENT_PRODUCT.a: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++ ${AR} ${AROPTS} bldCURRENT_PRODUCT.a ${bldCURRENT_PRODUCT`OBJS'}
++ ${RANLIB} ${RANLIBOPTS} bldCURRENT_PRODUCT.a
++ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
++
++install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.so bldCURRENT_PRODUCT.a
++ifdef(`bldINSTALLABLE', ` ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}" ]; then confMKDIR -p "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}"; else :; fi ')
++ ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${UBINMODE} bldCURRENT_PRODUCT.so "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.so.${MILTER_SOVER}"
++ ${LN} ${LNOPTS} bldCURRENT_PRODUCT.so.${MILTER_SOVER} "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.so"
++ ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a "${DESTDIR}${LIBDIR}"')
++
++bldCURRENT_PRODUCT-clean:
++ rm -f ${OBJS} bldCURRENT_PRODUCT.so bldCURRENT_PRODUCT.a ${MANPAGES}
++
++divert(0)
++COPTS+= confCCOPTS_SO
+diff -Nru sendmail-8.14.3.orig/libmilter/Makefile.m4 sendmail-8.14.3/libmilter/Makefile.m4
+--- sendmail-8.14.3.orig/libmilter/Makefile.m4 2008-04-08 07:23:44.000000000 +0200
++++ sendmail-8.14.3/libmilter/Makefile.m4 2009-08-22 21:53:35.000000000 +0200
+@@ -9,7 +9,7 @@
+ SMSRCDIR=ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
+ PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
+
+-bldPRODUCT_START(`library', `libmilter')
++bldPRODUCT_START(`milterlibrary', `libmilter')
+ define(`bldINSTALLABLE', `true')
+ define(`LIBMILTER_EXTRAS', `errstring.c strl.c')
+ APPENDDEF(`confENVDEF', `-DNOT_SENDMAIL -Dsm_snprintf=snprintf')
diff --git a/mail-mta/sendmail/files/sendmail b/mail-mta/sendmail/files/sendmail
new file mode 100644
index 000000000000..0f6d62da6085
--- /dev/null
+++ b/mail-mta/sendmail/files/sendmail
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+ use dns logger antivirus
+ provide mta
+}
+
+start() {
+ ebegin "Starting sendmail"
+ /usr/bin/newaliases > /dev/null 2>&1
+ (cd /var/spool/mqueue; rm -f xf*)
+ /usr/sbin/sendmail ${SENDMAIL_OPTS} > /dev/null 2>&1
+ /usr/sbin/sendmail ${CLIENTMQUEUE_OPTS} > /dev/null 2>&1
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping sendmail"
+ kill ${KILL_OPTS} `head -n 1 /var/run/sendmail.pid`
+ kill ${KILL_OPTS} `head -n 1 /var/spool/clientmqueue/sm-client.pid`
+ eend $?
+}
diff --git a/mail-mta/sendmail/files/sendmail-8.14.5+db-5.0.patch b/mail-mta/sendmail/files/sendmail-8.14.5+db-5.0.patch
new file mode 100644
index 000000000000..99ecbe081674
--- /dev/null
+++ b/mail-mta/sendmail/files/sendmail-8.14.5+db-5.0.patch
@@ -0,0 +1,13 @@
+Index: sendmail-8.14.4/include/sm/bdb.h
+===================================================================
+--- sendmail-8.14.4.orig/include/sm/bdb.h
++++ sendmail-8.14.4/include/sm/bdb.h
+@@ -19,7 +19,7 @@
+ # define DB_VERSION_MAJOR 1
+ # endif /* ! DB_VERSION_MAJOR */
+
+-# if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
++# if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) || DB_VERSION_MAJOR >= 5
+
+ # define DBTXN NULL ,
+
diff --git a/mail-mta/sendmail/files/sendmail-8.14.6-build-system.patch b/mail-mta/sendmail/files/sendmail-8.14.6-build-system.patch
new file mode 100644
index 000000000000..3348e921926c
--- /dev/null
+++ b/mail-mta/sendmail/files/sendmail-8.14.6-build-system.patch
@@ -0,0 +1,211 @@
+diff -Nru sendmail-8.14.3.orig/cf/cf/Makefile sendmail-8.14.3/cf/cf/Makefile
+--- sendmail-8.14.3.orig/cf/cf/Makefile 2005-06-14 04:16:34.000000000 +0200
++++ sendmail-8.14.3/cf/cf/Makefile 2009-09-20 10:55:50.000000000 +0200
+@@ -80,10 +80,10 @@
+ install-cf: install-sendmail-cf install-submit-cf
+
+ install-sendmail-cf: $(CF).cf
+- $(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(CF).cf ${DESTDIR}$(MAILDIR)/sendmail.cf
++ $(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(CF).cf "${DESTDIR}$(MAILDIR)/sendmail.cf"
+
+ install-submit-cf: $(SUBMIT).cf
+- $(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(SUBMIT).cf ${DESTDIR}$(MAILDIR)/submit.cf
++ $(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(SUBMIT).cf "${DESTDIR}$(MAILDIR)/submit.cf"
+
+ depend:
+
+diff -Nru sendmail-8.14.6.orig/devtools/M4/UNIX/defines.m4 sendmail-8.14.6/devtools/M4/UNIX/defines.m4
+--- sendmail-8.14.6.orig/devtools/M4/UNIX/defines.m4 2012-01-21 00:07:08.000000000 +0000
++++ sendmail-8.14.6/devtools/M4/UNIX/defines.m4 2012-12-27 08:13:15.792214375 +0000
+@@ -26,7 +26,7 @@
+ CCLINK = ifdef(`confCCLINK', `confCCLINK', `confCC')
+ # Linker for libraries
+ LD= ifdef(`confLD', `confLD', `confCC')
+-LDOPTS= ifdef(`confLDOPTS', `confLDOPTS') ifdef(`confMT', ifdef(`confMTLDOPTS', `confMTLDOPTS', `'), `')
++LDOPTS= ifdef(`confLDOPTS', `confLDOPTS')
+ LDOPTS_SO= ${LDOPTS} ifdef(`confLDOPTS_SO', `confLDOPTS_SO', `-shared')
+
+ # Shell
+@@ -71,7 +71,7 @@
+ LIBADD= ifdef(`conf_'bldCURRENT_PRD`_LIBS', `conf_'bldCURRENT_PRD`_LIBS')
+
+ # libraries required on your system
+-LIBS= ${LIBADD} ifdef(`confLIBS', `confLIBS') ifdef(`conf_'bldCURRENT_PRD`_LIB_POST', `conf_'bldCURRENT_PRD`_LIB_POST')
++LIBS= ${LIBADD} ifdef(`confLIBS', `confLIBS') ifdef(`conf_'bldCURRENT_PRD`_LIB_POST', `conf_'bldCURRENT_PRD`_LIB_POST') ifdef(`confMT', ifdef(`confMTLDOPTS', `confMTLDOPTS', `'), `')
+
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR= ifdef(`confMBINDIR', `confMBINDIR', `/usr/sbin')
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/executable.m4 sendmail-8.14.3/devtools/M4/UNIX/executable.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/executable.m4 2006-10-06 07:44:44.000000000 +0200
++++ sendmail-8.14.3/devtools/M4/UNIX/executable.m4 2009-09-20 10:50:36.000000000 +0200
+@@ -30,12 +30,12 @@
+
+ ifdef(`bldNO_INSTALL', ,
+ `install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT ifdef(`bldTARGET_INST_DEP', `bldTARGET_INST_DEP')
+- ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'BINDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'BINDIR}; else :; fi ')
+- ${INSTALL} -c -o ${bldBIN_TYPE`'BINOWN} -g ${bldBIN_TYPE`'BINGRP} -m ${bldBIN_TYPE`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${bldINSTALL_DIR`'BINDIR}
++ ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${bldINSTALL_DIR`'BINDIR}" ]; then confMKDIR -p "${DESTDIR}${bldINSTALL_DIR`'BINDIR}"; else :; fi ')
++ ${INSTALL} -c -o ${bldBIN_TYPE`'BINOWN} -g ${bldBIN_TYPE`'BINGRP} -m ${bldBIN_TYPE`'BINMODE} bldCURRENT_PRODUCT "${DESTDIR}${bldINSTALL_DIR`'BINDIR}"
+ ifdef(`bldTARGET_LINKS', `bldMAKE_TARGET_LINKS(${bldINSTALL_DIR`'BINDIR}/bldCURRENT_PRODUCT, ${bldCURRENT_PRODUCT`'TARGET_LINKS})')')
+
+ strip-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT
+- ${STRIP} ${STRIPOPTS} ${DESTDIR}${bldINSTALL_DIR`'BINDIR}`'/bldCURRENT_PRODUCT
++ ${STRIP} ${STRIPOPTS} "${DESTDIR}${bldINSTALL_DIR`'BINDIR}`'/bldCURRENT_PRODUCT"
+
+ bldCURRENT_PRODUCT-clean:
+ rm -f ${OBJS} bldCURRENT_PRODUCT ${MANPAGES}
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/library.m4 sendmail-8.14.3/devtools/M4/UNIX/library.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/library.m4 2006-09-06 00:56:53.000000000 +0200
++++ sendmail-8.14.3/devtools/M4/UNIX/library.m4 2009-09-20 10:50:36.000000000 +0200
+@@ -27,8 +27,8 @@
+ ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
+
+ install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.a
+-ifdef(`bldINSTALLABLE', ` ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'LIBDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'LIBDIR}; else :; fi ')
+- ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a ${DESTDIR}${LIBDIR}')
++ifdef(`bldINSTALLABLE', ` ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${LIBDIR}" ]; then confMKDIR -p "${DESTDIR}${LIBDIR}"; else :; fi ')
++ ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a "${DESTDIR}${LIBDIR}"')
+
+ bldCURRENT_PRODUCT-clean:
+ rm -f ${OBJS} bldCURRENT_PRODUCT.a ${MANPAGES}
+--- sendmail-8.14.6.orig/devtools/M4/UNIX/manpage.m4 2012-01-21 00:07:08.000000000 +0000
++++ sendmail-8.14.6/devtools/M4/UNIX/manpage.m4 2012-12-27 08:28:52.617502447 +0000
+@@ -68,11 +68,11 @@
+ ifdef(`confNO_MAN_INSTALL', `divert(-1)', `dnl')
+ define(`bldMAN_INSTALL_CMD',
+ `ifdef(`confDONT_INSTALL_CATMAN', `dnl',
+-` ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC} ]; then confMKDIR -p ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}; else :; fi ')
+- ${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).`${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}' `${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}'')
++` ifdef(`confMKDIR', `if [ ! -d "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}" ]; then confMKDIR -p "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}"; else :; fi ')
++ ${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).`${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}' "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}''")
+ ifdef(`confINSTALL_RAWMAN',
+-` ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN} ]; then confMKDIR -p ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}; else :; fi ')
+- ${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).bldGET_MAN_SOURCE_NUM($1) `${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}'', `dnl')'
++` ifdef(`confMKDIR', `if [ ! -d "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'" ]; then confMKDIR -p "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'"; else :; fi ')
++ ${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).bldGET_MAN_SOURCE_NUM($1) "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}''", `dnl')'
+ )dnl
+ bldFOREACH(`bldMAN_INSTALL_CMD(', `bldMAN_PAGES')
+ ifdef(`confNO_MAN_INSTALL', `divert(0)', `dnl')
+diff -Nru sendmail-8.14.3.orig/libmilter/Makefile.m4 sendmail-8.14.3/libmilter/Makefile.m4
+--- sendmail-8.14.3.orig/libmilter/Makefile.m4 2008-04-08 07:23:44.000000000 +0200
++++ sendmail-8.14.3/libmilter/Makefile.m4 2009-09-20 10:50:36.000000000 +0200
+@@ -32,9 +32,9 @@
+ MFAPI= ${SRCDIR}/inc`'lude/libmilter/mfapi.h
+ MFDEF= ${SRCDIR}/inc`'lude/libmilter/mfdef.h
+ install-mfapi: ${MFAPI}
+- if [ ! -d ${DESTDIR}${INCLUDEDIR}/libmilter ]; then mkdir -p ${DESTDIR}${INCLUDEDIR}/libmilter; else :; fi
+- ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFAPI} ${DESTDIR}${INCLUDEDIR}/libmilter/mfapi.h
+- ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFDEF} ${DESTDIR}${INCLUDEDIR}/libmilter/mfdef.h
++ if [ ! -d "${DESTDIR}${INCLUDEDIR}/libmilter" ]; then mkdir -p "${DESTDIR}${INCLUDEDIR}/libmilter"; else :; fi
++ ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFAPI} "${DESTDIR}${INCLUDEDIR}/libmilter/mfapi.h"
++ ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFDEF} "${DESTDIR}${INCLUDEDIR}/libmilter/mfdef.h"
+ divert(0)
+
+ bldFINISH
+diff -Nru sendmail-8.14.3.orig/mail.local/Makefile.m4 sendmail-8.14.3/mail.local/Makefile.m4
+--- sendmail-8.14.3.orig/mail.local/Makefile.m4 2006-06-28 23:08:02.000000000 +0200
++++ sendmail-8.14.3/mail.local/Makefile.m4 2009-09-20 10:56:24.000000000 +0200
+@@ -30,7 +30,7 @@
+ force-install: install-mail.local ifdef(`confNO_MAN_BUILD',, `install-docs')
+
+ install-mail.local: mail.local
+- ${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m ${UBINMODE} mail.local ${DESTDIR}${EBINDIR}
++ ${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m ${UBINMODE} mail.local "${DESTDIR}${EBINDIR}"
+ divert
+
+ bldFINISH
+diff -Nru sendmail-8.14.3.orig/rmail/Makefile.m4 sendmail-8.14.3/rmail/Makefile.m4
+--- sendmail-8.14.3.orig/rmail/Makefile.m4 2006-06-28 23:08:04.000000000 +0200
++++ sendmail-8.14.3/rmail/Makefile.m4 2009-09-20 10:55:29.000000000 +0200
+@@ -31,7 +31,7 @@
+ force-install: install-rmail ifdef(`confNO_MAN_BUILD',, `install-docs')
+
+ install-rmail: rmail
+- ${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m ${UBINMODE} rmail ${DESTDIR}${UBINDIR}
++ ${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m ${UBINMODE} rmail "${DESTDIR}${UBINDIR}"
+ divert
+
+ bldFINISH
+diff -Nru sendmail-8.14.3.orig/sendmail/Makefile.m4 sendmail-8.14.3/sendmail/Makefile.m4
+--- sendmail-8.14.3.orig/sendmail/Makefile.m4.orig 2008-03-27 17:13:33.000000000 +0100
++++ sendmail-8.14.3/sendmail/Makefile.m4 2009-09-20 11:07:24.000000000 +0200
+@@ -14,9 +14,9 @@
+
+ dnl hack: /etc/mail is not defined as "location of .cf" in the build system
+ define(`bldTARGET_INST_DEP', ifdef(`confINST_DEP', `confINST_DEP',
+-`${DESTDIR}/etc/mail/submit.cf ${DESTDIR}${MSPQ}'))dnl
++`"${DESTDIR}/etc/mail/submit.cf" "${DESTDIR}${MSPQ}"'))dnl
+ define(`bldTARGET_LINKS', ifdef(`confLINKS', `confLINKS',
+-`${DESTDIR}${UBINDIR}/newaliases ${DESTDIR}${UBINDIR}/mailq ${DESTDIR}${UBINDIR}/hoststat ${DESTDIR}${UBINDIR}/purgestat')
++`"${DESTDIR}${UBINDIR}/newaliases" "${DESTDIR}${UBINDIR}/mailq" "${DESTDIR}${UBINDIR}/hoststat" "${DESTDIR}${UBINDIR}/purgestat"')
+ )dnl
+
+ # location of sendmail statistics file (usually /etc/mail/ or /var/log)
+@@ -43,21 +43,21 @@
+ statistics:
+ ${CP} /dev/null statistics
+
+-${DESTDIR}/etc/mail/submit.cf:
++"${DESTDIR}/etc/mail/submit.cf":
+ @echo "Please read INSTALL if anything fails while installing the binary."
+ @echo "${DESTDIR}/etc/mail/submit.cf will be installed now."
+ cd ${SRCDIR}/cf/cf && make install-submit-cf
+
+ MSPQ=ifdef(`confMSP_QUEUE_DIR', `confMSP_QUEUE_DIR', `/var/spool/clientmqueue')
+
+-${DESTDIR}${MSPQ}:
++"${DESTDIR}${MSPQ}":
+ @echo "Please read INSTALL if anything fails while installing the binary."
+ @echo "You must have setup a new user ${MSPQOWN} and a new group ${GBINGRP}"
+ @echo "as explained in sendmail/SECURITY."
+- mkdir -p ${DESTDIR}${MSPQ}
+- chown ${MSPQOWN} ${DESTDIR}${MSPQ}
+- chgrp ${GBINGRP} ${DESTDIR}${MSPQ}
+- chmod 0770 ${DESTDIR}${MSPQ}
++ mkdir -p "${DESTDIR}${MSPQ}"
++ chown ${MSPQOWN} "${DESTDIR}${MSPQ}"
++ chgrp ${GBINGRP} "${DESTDIR}${MSPQ}"
++ chmod 0770 "${DESTDIR}${MSPQ}"
+
+ divert(0)
+
+@@ -68,30 +68,30 @@
+ divert(bldTARGETS_SECTION)
+
+ install-set-user-id: bldCURRENT_PRODUCT ifdef(`confNO_HELPFILE_INSTALL',, `install-hf') ifdef(`confNO_STATISTICS_INSTALL',, `install-st') ifdef(`confNO_MAN_BUILD',, `install-docs')
+- ${INSTALL} -c -o ${S`'BINOWN} -g ${S`'BINGRP} -m ${S`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${M`'BINDIR}
++ ${INSTALL} -c -o ${S`'BINOWN} -g ${S`'BINGRP} -m ${S`'BINMODE} bldCURRENT_PRODUCT "${DESTDIR}${M`'BINDIR}"
+ for i in ${sendmailTARGET_LINKS}; do \
+ rm -f $$i; \
+ ${LN} ${LNOPTS} ${M`'BINDIR}/sendmail $$i; \
+ done
+
+-define(`confMTA_LINKS', `${DESTDIR}${UBINDIR}/newaliases ${DESTDIR}${UBINDIR}/mailq ${DESTDIR}${UBINDIR}/hoststat ${DESTDIR}${UBINDIR}/purgestat')
++define(`confMTA_LINKS', `"${DESTDIR}${UBINDIR}/newaliases" "${DESTDIR}${UBINDIR}/mailq" "${DESTDIR}${UBINDIR}/hoststat" "${DESTDIR}${UBINDIR}/purgestat"')
+ install-sm-mta: bldCURRENT_PRODUCT
+- ${INSTALL} -c -o ${M`'BINOWN} -g ${M`'BINGRP} -m ${M`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${M`'BINDIR}/sm-mta
++ ${INSTALL} -c -o ${M`'BINOWN} -g ${M`'BINGRP} -m ${M`'BINMODE} bldCURRENT_PRODUCT "${DESTDIR}${M`'BINDIR}/sm-mta"
+ for i in confMTA_LINKS; do \
+ rm -f $$i; \
+ ${LN} ${LNOPTS} ${M`'BINDIR}/sm-mta $$i; \
+ done
+
+ install-hf:
+- if [ ! -d ${DESTDIR}${HFDIR} ]; then mkdir -p ${DESTDIR}${HFDIR}; else :; fi
+- ${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m 444 helpfile ${DESTDIR}${HFFILE}
++ if [ ! -d "${DESTDIR}${HFDIR}" ]; then mkdir -p "${DESTDIR}${HFDIR}"; else :; fi
++ ${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m 444 helpfile "${DESTDIR}${HFFILE}"
+
+ install-st: statistics
+- if [ ! -d ${DESTDIR}${STDIR} ]; then mkdir -p ${DESTDIR}${STDIR}; else :; fi
+- ${INSTALL} -c -o ${SBINOWN} -g ${UBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics ${DESTDIR}${STPATH}
++ if [ ! -d "${DESTDIR}${STDIR}" ]; then mkdir -p "${DESTDIR}${STDIR}"; else :; fi
++ ${INSTALL} -c -o ${SBINOWN} -g ${UBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics "${DESTDIR}${STPATH}"
+
+-install-submit-st: statistics ${DESTDIR}${MSPQ}
+- ${INSTALL} -c -o ${MSPQOWN} -g ${GBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics ${DESTDIR}${MSPQ}/${MSPSTFILE}
++install-submit-st: statistics "${DESTDIR}${MSPQ}"
++ ${INSTALL} -c -o ${MSPQOWN} -g ${GBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics "${DESTDIR}${MSPQ}/${MSPSTFILE}"
+
+ divert(0)
+ bldPRODUCT_END
diff --git a/mail-mta/sendmail/files/sendmail-delivered_hdr.patch b/mail-mta/sendmail/files/sendmail-delivered_hdr.patch
new file mode 100644
index 000000000000..6837fed1c46d
--- /dev/null
+++ b/mail-mta/sendmail/files/sendmail-delivered_hdr.patch
@@ -0,0 +1,10 @@
+--- sendmail/conf.c.orig 2004-07-14 21:54:23.000000000 +0000
++++ sendmail/conf.c 2004-12-06 15:22:05.000000000 +0000
+@@ -117,6 +117,7 @@
+ { "content-length", H_ACHECK, NULL },
+ { "subject", H_ENCODABLE, NULL },
+ { "x-authentication-warning", H_FORCE, NULL },
++ { "delivered-to", H_FORCE, NULL },
+
+ { NULL, 0, NULL }
+ };
diff --git a/mail-mta/sendmail/files/sendmail-procmail.mc b/mail-mta/sendmail/files/sendmail-procmail.mc
new file mode 100644
index 000000000000..af994ae33ad0
--- /dev/null
+++ b/mail-mta/sendmail/files/sendmail-procmail.mc
@@ -0,0 +1,12 @@
+divert(-1)
+divert(0)dnl
+include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
+VERSIONID(`$Id$')dnl
+OSTYPE(linux)dnl
+DOMAIN(generic)dnl
+FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
+FEATURE(`local_lmtp',`/usr/sbin/mail.local')dnl
+FEATURE(`local_procmail')dnl
+MAILER(local)dnl
+MAILER(smtp)dnl
+MAILER(procmail)dnl
diff --git a/mail-mta/sendmail/files/sendmail-starttls-multi-crl.patch b/mail-mta/sendmail/files/sendmail-starttls-multi-crl.patch
new file mode 100644
index 000000000000..8d93817d07da
--- /dev/null
+++ b/mail-mta/sendmail/files/sendmail-starttls-multi-crl.patch
@@ -0,0 +1,20 @@
+Bug #354611
+--- sendmail/tls.c.orig 2010-05-26 21:54:30.000000000 -0600
++++ sendmail/tls.c 2010-05-26 21:54:36.000000000 -0600
+@@ -723,11 +723,12 @@
+ {
+ if (BIO_read_filename(crl_file, CRLFile) >= 0)
+ {
+- crl = PEM_read_bio_X509_CRL(crl_file, NULL,
+- NULL, NULL);
++ while((crl = PEM_read_bio_X509_CRL(crl_file, NULL, NULL, NULL)))
++ {
++ X509_STORE_add_crl(store, crl);
++ X509_CRL_free(crl);
++ }
+ BIO_free(crl_file);
+- X509_STORE_add_crl(store, crl);
+- X509_CRL_free(crl);
+ X509_STORE_set_flags(store,
+ X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL);
+ X509_STORE_set_verify_cb_func(store,
diff --git a/mail-mta/sendmail/files/sendmail.mc-r1 b/mail-mta/sendmail/files/sendmail.mc-r1
new file mode 100644
index 000000000000..dbc09b02bc74
--- /dev/null
+++ b/mail-mta/sendmail/files/sendmail.mc-r1
@@ -0,0 +1,11 @@
+divert(-1)
+divert(0)dnl
+include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
+VERSIONID(`$Id$')dnl
+OSTYPE(linux)dnl
+DOMAIN(generic)dnl
+FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
+FEATURE(`local_lmtp',`/usr/sbin/mail.local')dnl
+define(`confTRUSTED_USER', `smmsp')dnl
+MAILER(local)dnl
+MAILER(smtp)dnl
diff --git a/mail-mta/sendmail/files/sendmail.service b/mail-mta/sendmail/files/sendmail.service
new file mode 100644
index 000000000000..1aeb769ececc
--- /dev/null
+++ b/mail-mta/sendmail/files/sendmail.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Sendmail Mail Transport Agent
+After=syslog.target network.target
+Wants=sm-client.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/sendmail.pid
+ExecStartPre=-/usr/bin/newaliases
+ExecStartPre=-/bin/rm -f /var/spool/mqueue/xf*
+ExecStart=/usr/sbin/sendmail -bd -q30m -L sm-mta
+
+[Install]
+WantedBy=multi-user.target
+Also=sm-client.service
diff --git a/mail-mta/sendmail/files/site.config.m4 b/mail-mta/sendmail/files/site.config.m4
new file mode 100644
index 000000000000..a9e0883a9b00
--- /dev/null
+++ b/mail-mta/sendmail/files/site.config.m4
@@ -0,0 +1,16 @@
+define(`confCCOPTS', `@@confCCOPTS@@')
+define(`confMAPDEF', `@@confMAPDEF@@')
+define(`confENVDEF', `@@confENVDEF@@')
+define(`confLIBS', `@@confLIBS@@')
+define(`confSTDIO_TYPE', `portable')
+define(`confLDOPTS', `-Wl,-z,now @@confLDOPTS@@')
+define(`confLDOPTS_SO', `-shared')
+define(`confCCOPTS_SO', `-fPIC')
+define(`confCC', `@@confCC@@')
+define(`confMANOWN', `root')
+define(`confMANGRP', `root')
+define(`confMANMODE', `644')
+define(`confMAN1SRC', `1')
+define(`confMAN5SRC', `5')
+define(`confMAN8SRC', `8')
+APPENDDEF(`conf_sendmail_LIBS', `@@conf_sendmail_LIBS@@')
diff --git a/mail-mta/sendmail/files/sm-client.service b/mail-mta/sendmail/files/sm-client.service
new file mode 100644
index 000000000000..4937c132914d
--- /dev/null
+++ b/mail-mta/sendmail/files/sm-client.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Sendmail Mail Transport Client
+After=syslog.target network.target sendmail.service
+BindTo=sendmail.service
+
+[Service]
+Type=forking
+PIDFile=/var/spool/clientmqueue/sm-client.pid
+ExecStartPre=/bin/touch /var/spool/clientmqueue/sm-client.pid
+ExecStartPre=/bin/chown smmsp:smmsp /var/spool/clientmqueue/sm-client.pid
+ExecStart=/usr/sbin/sendmail -Ac -q30m -L sm-cm
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-mta/sendmail/metadata.xml b/mail-mta/sendmail/metadata.xml
new file mode 100644
index 000000000000..1c3bc7b3fcef
--- /dev/null
+++ b/mail-mta/sendmail/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/mail-mta/sendmail/sendmail-8.14.9-r1.ebuild b/mail-mta/sendmail/sendmail-8.14.9-r1.ebuild
new file mode 100644
index 000000000000..01104843e2bd
--- /dev/null
+++ b/mail-mta/sendmail/sendmail-8.14.9-r1.ebuild
@@ -0,0 +1,205 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit eutils multilib systemd toolchain-funcs user
+
+DESCRIPTION="Widely-used Mail Transport Agent (MTA)"
+HOMEPAGE="http://www.sendmail.org/"
+SRC_URI="ftp://ftp.sendmail.org/pub/${PN}/${PN}.${PV}.tar.gz"
+
+LICENSE="Sendmail GPL-2" # GPL-2 is here for initscript
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="ssl ldap libressl sasl tcpd mbox ipv6 nis sockets"
+
+DEPEND="net-mail/mailbase
+ sys-devel/m4
+ sasl? ( >=dev-libs/cyrus-sasl-2.1.10 )
+ tcpd? ( sys-apps/tcp-wrappers )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )
+ ldap? ( net-nds/openldap )
+ >=sys-libs/db-3.2
+ !net-mail/vacation
+ "
+RDEPEND="${DEPEND}
+ >=net-mail/mailbase-0.00
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/opensmtpd
+ !mail-mta/qmail-ldap
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]"
+
+PDEPEND="!mbox? ( mail-filter/procmail )"
+
+# libmilter library is part of sendmail, but it does not share the version number with it.
+# In order to find the right libmilter version number, check SMFI_VERSION definition
+# that can be found in ${S}/include/libmilter/mfapi.h (see also SM_LM_VRS_* defines).
+# For example, version 1.0.1 has a SMFI_VERSION of 0x01000001.
+LIBMILTER_VER=1.0.2
+
+pkg_setup() {
+ enewgroup smmsp 209
+ enewuser smmsp 209 -1 /var/spool/mqueue smmsp
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/"${PN}"-8.14.6-build-system.patch
+ epatch "${FILESDIR}"/sendmail-delivered_hdr.patch
+ epatch "${FILESDIR}"/libmilter-sharedlib.patch
+ epatch "${FILESDIR}"/"${PN}"-8.14.5+db-5.0.patch
+ epatch "${FILESDIR}"/sendmail-starttls-multi-crl.patch
+
+ local confCC="$(tc-getCC)"
+ local confCCOPTS="${CFLAGS}"
+ local confLDOPTS="${LDFLAGS}"
+ local confMAPDEF="-DMAP_REGEX"
+ local conf_sendmail_LIBS=""
+ use sasl && confLIBS="${confLIBS} -lsasl2" \
+ && confENVDEF="${confENVDEF} -DSASL=2" \
+ && confCCOPTS="${confCCOPTS} -I/usr/include/sasl" \
+ && conf_sendmail_LIBS="${conf_sendmail_LIBS} -lsasl2"
+ use tcpd && confENVDEF="${confENVDEF} -DTCPWRAPPERS" \
+ && confLIBS="${confLIBS} -lwrap"
+ use ssl && confENVDEF="${confENVDEF} -DSTARTTLS -D_FFR_DEAL_WITH_ERROR_SSL" \
+ && confENVDEF="${confENVDEF} -D_FFR_TLS_1" \
+ && confLIBS="${confLIBS} -lssl -lcrypto" \
+ && conf_sendmail_LIBS="${conf_sendmail_LIBS} -lssl -lcrypto"
+ use ldap && confMAPDEF="${confMAPDEF} -DLDAPMAP" \
+ && confLIBS="${confLIBS} -lldap -llber"
+ use ipv6 && confENVDEF="${confENVDEF} -DNETINET6"
+ use nis && confENVDEF="${confENVDEF} -DNIS"
+ use sockets && confENVDEF="${confENVDEF} -DSOCKETMAP"
+ sed -e "s:@@confCCOPTS@@:${confCCOPTS}:" \
+ -e "s/@@confLDOPTS@@/${confLDOPTS}/" \
+ -e "s/@@confCC@@/${confCC}/" \
+ -e "s/@@confMAPDEF@@/${confMAPDEF}/" \
+ -e "s/@@confENVDEF@@/${confENVDEF}/" \
+ -e "s/@@confLIBS@@/${confLIBS}/" \
+ -e "s/@@conf_sendmail_LIBS@@/${conf_sendmail_LIBS}/" \
+ "${FILESDIR}"/site.config.m4 > devtools/Site/site.config.m4
+}
+
+src_compile() {
+ sh Build AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "compilation failed in main Build script"
+ pushd libmilter
+ sh Build AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" MILTER_SOVER=${LIBMILTER_VER} || die "libmilter compilation failed"
+ popd
+}
+
+src_install () {
+ local MY_LIBDIR=/usr/$(get_libdir)
+ local MY_OBJDIR="obj.`uname -s`.`uname -r`.`uname -m`"
+ dodir /usr/bin ${MY_LIBDIR} /usr/include/libmilter
+ dodir /usr/share/man/man{1,5,8} /usr/sbin /var/log /usr/share/sendmail-cf
+ dodir /var/spool/{mqueue,clientmqueue} /etc/conf.d
+ keepdir /var/spool/{clientmqueue,mqueue}
+ for dir in libsmutil sendmail mailstats praliases smrsh makemap vacation editmap
+ do
+ make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
+ SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
+ MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
+ LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
+ MSPQOWN=root CFOWN=root CFGRP=root \
+ install -C "${MY_OBJDIR}/${dir}" \
+ || die "install failed"
+ done
+ for dir in rmail mail.local
+ do
+ make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
+ SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
+ MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
+ LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
+ MSPQOWN=root CFOWN=root CFGRP=root \
+ force-install -C "${MY_OBJDIR}/${dir}" \
+ || die "install failed"
+ done
+
+ make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
+ SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
+ MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
+ LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
+ MSPQOWN=root CFOWN=root CFGRP=root \
+ MILTER_SOVER=${LIBMILTER_VER} \
+ install -C "${MY_OBJDIR}/libmilter" \
+ || die "install failed"
+
+ fowners root:smmsp /usr/sbin/sendmail
+ fperms 2555 /usr/sbin/sendmail
+ fowners smmsp:smmsp /var/spool/clientmqueue
+ fperms 770 /var/spool/clientmqueue
+ fperms 700 /var/spool/mqueue
+ dosym /usr/sbin/makemap /usr/bin/makemap
+ dodoc FAQ KNOWNBUGS README RELEASE_NOTES doc/op/op.ps
+ newdoc sendmail/README README.sendmail
+ newdoc sendmail/SECURITY SECURITY
+ newdoc sendmail/TUNING TUNING
+ newdoc smrsh/README README.smrsh
+ newdoc libmilter/README README.libmilter
+
+ newdoc cf/README README.cf
+ newdoc cf/cf/README README.install-cf
+ cp -pPR cf/* "${D}"/usr/share/sendmail-cf
+
+ docinto contrib
+ dodoc contrib/*
+
+ insinto /etc/mail
+ if use mbox
+ then
+ newins "${FILESDIR}"/sendmail.mc-r1 sendmail.mc
+ else
+ newins "${FILESDIR}"/sendmail-procmail.mc sendmail.mc
+ fi
+ m4 "${D}"/usr/share/sendmail-cf/m4/cf.m4 "${D}"/etc/mail/sendmail.mc \
+ > "${D}"/etc/mail/sendmail.cf
+ echo "include(\`/usr/share/sendmail-cf/m4/cf.m4')dnl" \
+ > "${D}"/etc/mail/submit.mc
+ cat "${D}"/usr/share/sendmail-cf/cf/submit.mc >> "${D}"/etc/mail/submit.mc
+ echo "# local-host-names - include all aliases for your machine here" \
+ > "${D}"/etc/mail/local-host-names
+ cat <<- EOF > "${D}"/etc/mail/trusted-users
+ # trusted-users - users that can send mail as others without a warning
+ # apache, mailman, majordomo, uucp are good candidates
+ EOF
+ cat <<- EOF > "${D}"/etc/mail/access
+ # Check the /usr/share/doc/sendmail/README.cf file for a description
+ # of the format of this file. (search for access_db in that file)
+ # The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
+ # package.
+ #
+
+ EOF
+ cat <<- EOF > "${D}"/etc/conf.d/sendmail
+ # Config file for /etc/init.d/sendmail
+ # add start-up options here
+ SENDMAIL_OPTS="-bd -q30m -L sm-mta" # default daemon mode
+ CLIENTMQUEUE_OPTS="-Ac -q30m -L sm-cm" # clientmqueue
+ KILL_OPTS="" # add -9/-15/your favorite evil SIG level here
+
+ EOF
+ if use sasl; then
+ dodir /etc/sasl2
+ cat <<- EOF > "${D}"/etc/sasl2/Sendmail.conf
+ pwcheck_method: saslauthd
+ mech_list: PLAIN LOGIN
+
+ EOF
+ fi
+
+ doinitd "${FILESDIR}"/sendmail
+ systemd_dounit "${FILESDIR}"/sendmail.service
+ systemd_dounit "${FILESDIR}"/sm-client.service
+
+ keepdir /usr/adm/sm.bin
+}
diff --git a/mail-mta/sendmail/sendmail-8.14.9.ebuild b/mail-mta/sendmail/sendmail-8.14.9.ebuild
new file mode 100644
index 000000000000..d356bfab013b
--- /dev/null
+++ b/mail-mta/sendmail/sendmail-8.14.9.ebuild
@@ -0,0 +1,202 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit eutils multilib systemd toolchain-funcs user
+
+DESCRIPTION="Widely-used Mail Transport Agent (MTA)"
+HOMEPAGE="http://www.sendmail.org/"
+SRC_URI="ftp://ftp.sendmail.org/pub/${PN}/${PN}.${PV}.tar.gz"
+
+LICENSE="Sendmail GPL-2" # GPL-2 is here for initscript
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="ssl ldap sasl tcpd mbox ipv6 nis sockets"
+
+DEPEND="net-mail/mailbase
+ sys-devel/m4
+ sasl? ( >=dev-libs/cyrus-sasl-2.1.10 )
+ tcpd? ( sys-apps/tcp-wrappers )
+ ssl? ( dev-libs/openssl )
+ ldap? ( net-nds/openldap )
+ >=sys-libs/db-3.2
+ !net-mail/vacation
+ "
+RDEPEND="${DEPEND}
+ >=net-mail/mailbase-0.00
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/opensmtpd
+ !mail-mta/qmail-ldap
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]"
+
+PDEPEND="!mbox? ( mail-filter/procmail )"
+
+# libmilter library is part of sendmail, but it does not share the version number with it.
+# In order to find the right libmilter version number, check SMFI_VERSION definition
+# that can be found in ${S}/include/libmilter/mfapi.h (see also SM_LM_VRS_* defines).
+# For example, version 1.0.1 has a SMFI_VERSION of 0x01000001.
+LIBMILTER_VER=1.0.2
+
+pkg_setup() {
+ enewgroup smmsp 209
+ enewuser smmsp 209 -1 /var/spool/mqueue smmsp
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/"${PN}"-8.14.6-build-system.patch
+ epatch "${FILESDIR}"/sendmail-delivered_hdr.patch
+ epatch "${FILESDIR}"/libmilter-sharedlib.patch
+ epatch "${FILESDIR}"/"${PN}"-8.14.5+db-5.0.patch
+ epatch "${FILESDIR}"/sendmail-starttls-multi-crl.patch
+
+ local confCC="$(tc-getCC)"
+ local confCCOPTS="${CFLAGS}"
+ local confLDOPTS="${LDFLAGS}"
+ local confMAPDEF="-DMAP_REGEX"
+ local conf_sendmail_LIBS=""
+ use sasl && confLIBS="${confLIBS} -lsasl2" \
+ && confENVDEF="${confENVDEF} -DSASL=2" \
+ && confCCOPTS="${confCCOPTS} -I/usr/include/sasl" \
+ && conf_sendmail_LIBS="${conf_sendmail_LIBS} -lsasl2"
+ use tcpd && confENVDEF="${confENVDEF} -DTCPWRAPPERS" \
+ && confLIBS="${confLIBS} -lwrap"
+ use ssl && confENVDEF="${confENVDEF} -DSTARTTLS -D_FFR_DEAL_WITH_ERROR_SSL" \
+ && confENVDEF="${confENVDEF} -D_FFR_TLS_1" \
+ && confLIBS="${confLIBS} -lssl -lcrypto" \
+ && conf_sendmail_LIBS="${conf_sendmail_LIBS} -lssl -lcrypto"
+ use ldap && confMAPDEF="${confMAPDEF} -DLDAPMAP" \
+ && confLIBS="${confLIBS} -lldap -llber"
+ use ipv6 && confENVDEF="${confENVDEF} -DNETINET6"
+ use nis && confENVDEF="${confENVDEF} -DNIS"
+ use sockets && confENVDEF="${confENVDEF} -DSOCKETMAP"
+ sed -e "s:@@confCCOPTS@@:${confCCOPTS}:" \
+ -e "s/@@confLDOPTS@@/${confLDOPTS}/" \
+ -e "s/@@confCC@@/${confCC}/" \
+ -e "s/@@confMAPDEF@@/${confMAPDEF}/" \
+ -e "s/@@confENVDEF@@/${confENVDEF}/" \
+ -e "s/@@confLIBS@@/${confLIBS}/" \
+ -e "s/@@conf_sendmail_LIBS@@/${conf_sendmail_LIBS}/" \
+ "${FILESDIR}"/site.config.m4 > devtools/Site/site.config.m4
+}
+
+src_compile() {
+ sh Build AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "compilation failed in main Build script"
+ pushd libmilter
+ sh Build AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" MILTER_SOVER=${LIBMILTER_VER} || die "libmilter compilation failed"
+ popd
+}
+
+src_install () {
+ local MY_LIBDIR=/usr/$(get_libdir)
+ local MY_OBJDIR="obj.`uname -s`.`uname -r`.`uname -m`"
+ dodir /usr/bin ${MY_LIBDIR} /usr/include/libmilter
+ dodir /usr/share/man/man{1,5,8} /usr/sbin /var/log /usr/share/sendmail-cf
+ dodir /var/spool/{mqueue,clientmqueue} /etc/conf.d
+ keepdir /var/spool/{clientmqueue,mqueue}
+ for dir in libsmutil sendmail mailstats praliases smrsh makemap vacation editmap
+ do
+ make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
+ SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
+ MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
+ LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
+ MSPQOWN=root CFOWN=root CFGRP=root \
+ install -C "${MY_OBJDIR}/${dir}" \
+ || die "install failed"
+ done
+ for dir in rmail mail.local
+ do
+ make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
+ SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
+ MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
+ LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
+ MSPQOWN=root CFOWN=root CFGRP=root \
+ force-install -C "${MY_OBJDIR}/${dir}" \
+ || die "install failed"
+ done
+
+ make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
+ SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
+ MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
+ LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
+ MSPQOWN=root CFOWN=root CFGRP=root \
+ MILTER_SOVER=${LIBMILTER_VER} \
+ install -C "${MY_OBJDIR}/libmilter" \
+ || die "install failed"
+
+ fowners root:smmsp /usr/sbin/sendmail
+ fperms 2555 /usr/sbin/sendmail
+ fowners smmsp:smmsp /var/spool/clientmqueue
+ fperms 770 /var/spool/clientmqueue
+ fperms 700 /var/spool/mqueue
+ dosym /usr/sbin/makemap /usr/bin/makemap
+ dodoc FAQ KNOWNBUGS README RELEASE_NOTES doc/op/op.ps
+ newdoc sendmail/README README.sendmail
+ newdoc sendmail/SECURITY SECURITY
+ newdoc sendmail/TUNING TUNING
+ newdoc smrsh/README README.smrsh
+ newdoc libmilter/README README.libmilter
+
+ newdoc cf/README README.cf
+ newdoc cf/cf/README README.install-cf
+ cp -pPR cf/* "${D}"/usr/share/sendmail-cf
+
+ docinto contrib
+ dodoc contrib/*
+
+ insinto /etc/mail
+ if use mbox
+ then
+ newins "${FILESDIR}"/sendmail.mc-r1 sendmail.mc
+ else
+ newins "${FILESDIR}"/sendmail-procmail.mc sendmail.mc
+ fi
+ m4 "${D}"/usr/share/sendmail-cf/m4/cf.m4 "${D}"/etc/mail/sendmail.mc \
+ > "${D}"/etc/mail/sendmail.cf
+ echo "include(\`/usr/share/sendmail-cf/m4/cf.m4')dnl" \
+ > "${D}"/etc/mail/submit.mc
+ cat "${D}"/usr/share/sendmail-cf/cf/submit.mc >> "${D}"/etc/mail/submit.mc
+ echo "# local-host-names - include all aliases for your machine here" \
+ > "${D}"/etc/mail/local-host-names
+ cat <<- EOF > "${D}"/etc/mail/trusted-users
+ # trusted-users - users that can send mail as others without a warning
+ # apache, mailman, majordomo, uucp are good candidates
+ EOF
+ cat <<- EOF > "${D}"/etc/mail/access
+ # Check the /usr/share/doc/sendmail/README.cf file for a description
+ # of the format of this file. (search for access_db in that file)
+ # The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
+ # package.
+ #
+
+ EOF
+ cat <<- EOF > "${D}"/etc/conf.d/sendmail
+ # Config file for /etc/init.d/sendmail
+ # add start-up options here
+ SENDMAIL_OPTS="-bd -q30m -L sm-mta" # default daemon mode
+ CLIENTMQUEUE_OPTS="-Ac -q30m -L sm-cm" # clientmqueue
+ KILL_OPTS="" # add -9/-15/your favorite evil SIG level here
+
+ EOF
+ if use sasl; then
+ dodir /etc/sasl2
+ cat <<- EOF > "${D}"/etc/sasl2/Sendmail.conf
+ pwcheck_method: saslauthd
+ mech_list: PLAIN LOGIN
+
+ EOF
+ fi
+
+ doinitd "${FILESDIR}"/sendmail
+ systemd_dounit "${FILESDIR}"/sendmail.service
+ systemd_dounit "${FILESDIR}"/sm-client.service
+
+ keepdir /usr/adm/sm.bin
+}
diff --git a/mail-mta/ssmtp/Manifest b/mail-mta/ssmtp/Manifest
new file mode 100644
index 000000000000..b606b2b7b19d
--- /dev/null
+++ b/mail-mta/ssmtp/Manifest
@@ -0,0 +1,8 @@
+DIST ssmtp-2.64-patches-3.tar.bz2 5128 SHA256 8414329b529b58197e6425ec75387f9bfc02e088cbef7ee83be80bf549ca4140 SHA512 140ca571705ee45ca2d6718b456ab028e3aaeb910a64230d8143a29de837eb3be8f16641f21f56f2c5112867512fabdc952886701d596f0bb303fc1524a1ad46 WHIRLPOOL e4ae24baaa91a424b32cced5111f640e9c3265b2f077f220f894884a7973b3ee4a887bf1113d36a167404c8e6a7123d9bb1bcd95e1a79aada3fd494b2d8b2a0f
+DIST ssmtp-2.64-patches-4.tar.xz 6928 SHA256 b7552a16f61b0a4a7a32a1aaeb77248ef94e061eadc1e545835b9ffb1ada9e6e SHA512 6fa57c0bc5ad363e21bf69fb60f1cbb87ad1ead393a53ab5bd25b709303c321a29ed37ce7fe95b94dae748703bba3b0631fc2a95e40957c5241b5d9f42bc0c4a WHIRLPOOL 0ea1333abb6493a7ede9f89f105e12354be9b23f2f422be375ac592f90a2c3a2a5a9b464d9115131c1e120393a50c905d1b5ebdee9acc57db430aa9754b88c9f
+DIST ssmtp_2.64.orig.tar.bz2 52501 SHA256 22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36 SHA512 911752e744420adf58552b9cf3a6e558d8b39103e5ad33a9ed4429b9a3a2091f7674aac11fe9bbd66747a61cdabe6bd638b80efcaadc86b057c12e2e235cca72 WHIRLPOOL afa8d41b18c5be632b5b85ca483f1d2ef889d943a5a99fe0c4fe877655148313e3f031308a4126e23c6fa7bcbae009a5804071f6c77f36b092a51aeba259fea8
+EBUILD ssmtp-2.64-r2.ebuild 2971 SHA256 92a153601a1065ae6f95e0ed8411df1875e2f061586a8f0d59f97324a5941f1b SHA512 31048f9164bfa27577bcc48571084c7d044f6c4eff82f8bf3d96223e1872f5e604850634ce873f8034b11fb0075f1354113faccad81e220381d258e500a02205 WHIRLPOOL 5880a68b779989aa131cbe27ff66d85fb51bf48b774811948c5802158095a99378a16944af6e119e95c0ad2df04334de3b09fd4ece7037ae2eb574ae68ef6596
+EBUILD ssmtp-2.64-r3.ebuild 3062 SHA256 787dc955ed302e180384f66d5faa5d76e8265adc2bca4a0807c8d6d056087bcf SHA512 c03fdb619860a81e251291843adba85e7eb0dc60987138c50a6103b4acdc57311629f4d34da07a9d32d454f142c0a74f53df23312c8197d00107b8650e8756d5 WHIRLPOOL 1eacabb8494e9861b9727572ffb6919c965259b334517aadd9bb261d61f61c4b044ef28d01f290d343b0d186b6d25b8ec463992c46bcac37d283ee4103300591
+MISC ChangeLog 3530 SHA256 e9a242507baff1b0a672f0e3ce402e8099582518cc78f84618726b931ad3a056 SHA512 f56a510288136740b5694ff5310164f7f94246f89e3959be8fb4f455c9e4e117ac25c34e69ee51f334d3bf4d7affc28f736846355f118644c20f18fe08485ef8 WHIRLPOOL af808cc088a963ef1d9d0538799de1ea16415a4cc330dfb05fc57db602f6730521edc18a7b554d3253af98f6753d52f18f0c45c429703df0df557d615c41bc03
+MISC ChangeLog-2015 22822 SHA256 102d49cd85f054ee675f3d8323899669076b52c80a72d8d954417b4248dbe5f5 SHA512 a8061aa9ae73877b8a49e41fe3586cac9d975de4fe10f8c0e15ad53fc9a93d596b3e42d512bc93038440a887167f1c1e08d9d1aa54f95ee0a4435c9162a42464 WHIRLPOOL 1ad14b61ac71cc453552e1abf60e74099433d7c0434a0944380ec43867f839956e79276b2c0febe644a679d6232fe558bc0e0cd96a978082e60b71f7caddbebb
+MISC metadata.xml 341 SHA256 3a4879ce9fe9e00df9adb8ac01dee1fe3584a4f452eef5d6780724a7d6b22bd6 SHA512 68ab75d2293915559f73ad87f7a6b6b0533795a0e79cea2aa835cba84cbcbfbeb3ea9e3bc02e71028431e2e2022936041b75ca2e0beb749ba49afd8f134f6a92 WHIRLPOOL 470f68d03a80ba3329a8a33670d0cee21a2aded46e15a89d062b3e13def85c5ea07eeeb65332e789f699f86ba322383a1619a8529fc3ac4b4fa702f4877a58a3
diff --git a/mail-mta/ssmtp/metadata.xml b/mail-mta/ssmtp/metadata.xml
new file mode 100644
index 000000000000..9b3d1228bf01
--- /dev/null
+++ b/mail-mta/ssmtp/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <use>
+ <flag name="mta">Install symlinks for sendmail-compatible MTA.</flag>
+ </use>
+</pkgmetadata>
diff --git a/mail-mta/ssmtp/ssmtp-2.64-r2.ebuild b/mail-mta/ssmtp/ssmtp-2.64-r2.ebuild
new file mode 100644
index 000000000000..e7ac7adcfc1a
--- /dev/null
+++ b/mail-mta/ssmtp/ssmtp-2.64-r2.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+PATCHSET=3
+
+WANT_AUTOMAKE=none
+
+inherit eutils autotools user
+
+DESCRIPTION="Extremely simple MTA to get mail off the system to a Mailhub"
+HOMEPAGE="ftp://ftp.debian.org/debian/pool/main/s/ssmtp/"
+SRC_URI="mirror://debian/pool/main/s/ssmtp/${P/-/_}.orig.tar.bz2
+ https://dev.gentoo.org/~flameeyes/ssmtp/${P}-patches-${PATCHSET}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="ipv6 +ssl gnutls +mta"
+
+DEPEND="ssl? (
+ !gnutls? ( dev-libs/openssl:0 )
+ gnutls? ( net-libs/gnutls[openssl] )
+ )"
+RDEPEND="${DEPEND}
+ net-mail/mailbase
+ mta? (
+ !net-mail/mailwrapper
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/nbsmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ )"
+
+REQUIRED_USE="gnutls? ( ssl )"
+
+pkg_setup() {
+ if ! use prefix; then
+ enewgroup ssmtp
+ fi
+}
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" EPATCH_SOURCE="${WORKDIR}/patches" \
+ epatch
+ epatch_user
+
+ # let's start by not using configure.in anymore as future autoconf
+ # versions will not support it.
+ mv configure.in configure.ac || die
+
+ eautoconf
+}
+
+src_configure() {
+ econf \
+ --sysconfdir="${EPREFIX}"/etc/ssmtp \
+ $(use_enable ssl) $(use_with gnutls) \
+ $(use_enable ipv6 inet6) \
+ --enable-md5auth
+}
+
+src_compile() {
+ emake etcdir="${EPREFIX}"/etc || die
+}
+
+src_install() {
+ dosbin ssmtp
+
+ doman ssmtp.8 ssmtp.conf.5
+ dodoc ChangeLog CHANGELOG_OLD INSTALL README TLS
+ newdoc ssmtp.lsm DESC
+
+ insinto /etc/ssmtp
+ doins ssmtp.conf revaliases
+
+ local conffile="${ED}etc/ssmtp/ssmtp.conf"
+
+ # Sorry about the weird indentation, I couldn't figure out a cleverer way
+ # to do this without having horribly >80 char lines.
+ sed -i -e "s:^hostname=:\n# Gentoo bug #47562\\
+# Commenting the following line will force ssmtp to figure\\
+# out the hostname itself.\n\\
+# hostname=:" \
+ "${conffile}" || die "sed failed"
+
+ # Comment rewriteDomain (bug #243364)
+ sed -i -e "s:^rewriteDomain=:#rewriteDomain=:" "${conffile}"
+
+ # Set restrictive perms on ssmtp.conf as per #187841, #239197
+ # Protect the ssmtp configfile from being readable by regular users as it
+ # may contain login/password data to auth against a the mailhub used.
+ if ! use prefix; then
+ fowners root:ssmtp /etc/ssmtp/ssmtp.conf
+ fperms 640 /etc/ssmtp/ssmtp.conf
+ fowners root:ssmtp /usr/sbin/ssmtp
+ fperms 2711 /usr/sbin/ssmtp
+ fi
+
+ if use mta; then
+ dosym ../sbin/ssmtp /usr/lib/sendmail
+ dosym ../sbin/ssmtp /usr/bin/sendmail
+ dosym ssmtp /usr/sbin/sendmail
+ dosym ../sbin/ssmtp /usr/bin/mailq
+ dosym ../sbin/ssmtp /usr/bin/newaliases
+ fi
+}
diff --git a/mail-mta/ssmtp/ssmtp-2.64-r3.ebuild b/mail-mta/ssmtp/ssmtp-2.64-r3.ebuild
new file mode 100644
index 000000000000..f6f5d29763b8
--- /dev/null
+++ b/mail-mta/ssmtp/ssmtp-2.64-r3.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHSET=4
+
+WANT_AUTOMAKE=none
+
+inherit eutils autotools user
+
+DESCRIPTION="Extremely simple MTA to get mail off the system to a Mailhub"
+HOMEPAGE="ftp://ftp.debian.org/debian/pool/main/s/ssmtp/"
+SRC_URI="mirror://debian/pool/main/s/ssmtp/${P/-/_}.orig.tar.bz2
+ https://dev.gentoo.org/~pinkbyte/distfiles/patches/${P}-patches-${PATCHSET}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="ipv6 libressl +ssl gnutls +mta"
+
+DEPEND="ssl? (
+ gnutls? ( net-libs/gnutls[openssl] )
+ !gnutls? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
+ )"
+RDEPEND="${DEPEND}
+ net-mail/mailbase
+ mta? (
+ !net-mail/mailwrapper
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/nbsmtp
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ )"
+
+REQUIRED_USE="gnutls? ( ssl )"
+
+pkg_setup() {
+ if ! use prefix; then
+ enewgroup ssmtp
+ fi
+}
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" EPATCH_SOURCE="${WORKDIR}/patches" \
+ epatch
+ epatch_user
+
+ # let's start by not using configure.in anymore as future autoconf
+ # versions will not support it.
+ mv configure.in configure.ac || die
+
+ eautoconf
+}
+
+src_configure() {
+ econf \
+ --sysconfdir="${EPREFIX}"/etc/ssmtp \
+ $(use_enable ssl) $(use_with gnutls) \
+ $(use_enable ipv6 inet6) \
+ --enable-md5auth
+}
+
+src_compile() {
+ emake etcdir="${EPREFIX}"/etc || die
+}
+
+src_install() {
+ dosbin ssmtp
+
+ doman ssmtp.8 ssmtp.conf.5
+ dodoc ChangeLog CHANGELOG_OLD INSTALL README TLS
+ newdoc ssmtp.lsm DESC
+
+ insinto /etc/ssmtp
+ doins ssmtp.conf revaliases
+
+ local conffile="${ED}etc/ssmtp/ssmtp.conf"
+
+ # Sorry about the weird indentation, I couldn't figure out a cleverer way
+ # to do this without having horribly >80 char lines.
+ sed -i -e "s:^hostname=:\n# Gentoo bug #47562\\
+# Commenting the following line will force ssmtp to figure\\
+# out the hostname itself.\n\\
+# hostname=:" \
+ "${conffile}" || die "sed failed"
+
+ # Comment rewriteDomain (bug #243364)
+ sed -i -e "s:^rewriteDomain=:#rewriteDomain=:" "${conffile}"
+
+ # Set restrictive perms on ssmtp.conf as per #187841, #239197
+ # Protect the ssmtp configfile from being readable by regular users as it
+ # may contain login/password data to auth against a the mailhub used.
+ if ! use prefix; then
+ fowners root:ssmtp /etc/ssmtp/ssmtp.conf
+ fperms 640 /etc/ssmtp/ssmtp.conf
+ fowners root:ssmtp /usr/sbin/ssmtp
+ fperms 2711 /usr/sbin/ssmtp
+ fi
+
+ if use mta; then
+ dosym ../sbin/ssmtp /usr/lib/sendmail
+ dosym ../sbin/ssmtp /usr/bin/sendmail
+ dosym ssmtp /usr/sbin/sendmail
+ dosym ../sbin/ssmtp /usr/bin/mailq
+ dosym ../sbin/ssmtp /usr/bin/newaliases
+ fi
+}