summaryrefslogtreecommitdiff
path: root/mail-mta
diff options
context:
space:
mode:
Diffstat (limited to 'mail-mta')
-rw-r--r--mail-mta/Manifest.gzbin2376 -> 2384 bytes
-rw-r--r--mail-mta/courier/Manifest1
-rw-r--r--mail-mta/courier/courier-1.2.3-r1.ebuild311
-rw-r--r--mail-mta/postfix/Manifest6
-rw-r--r--mail-mta/postfix/postfix-3.8.0_rc1.ebuild297
-rw-r--r--mail-mta/postfix/postfix-3.9_pre20230412.ebuild (renamed from mail-mta/postfix/postfix-3.8_pre20230409.ebuild)2
6 files changed, 614 insertions, 3 deletions
diff --git a/mail-mta/Manifest.gz b/mail-mta/Manifest.gz
index 376cda847b77..90f54fcdd0f8 100644
--- a/mail-mta/Manifest.gz
+++ b/mail-mta/Manifest.gz
Binary files differ
diff --git a/mail-mta/courier/Manifest b/mail-mta/courier/Manifest
index 7b55ff193226..b1969cb0aeca 100644
--- a/mail-mta/courier/Manifest
+++ b/mail-mta/courier/Manifest
@@ -11,5 +11,6 @@ EBUILD courier-1.1.5-r3.ebuild 9233 BLAKE2B d0c7f609140f624ee3b971f240766b80bc46
EBUILD courier-1.1.8-r2.ebuild 9239 BLAKE2B 37bdf7f22ac01545fe89f6a3d63a58ab984c5f27efd0d8a6a5d751b15bd184afb53e92ad04e7fce78cae5557dc960e22ca3135aee5334603804ab00e29a02b47 SHA512 46489020884af61bac01a18dca9704a931ba81ad07f08873511baa15fc401c722c52f882c136eadc36cc46d3f590e48bb7aacff54b129b265384baaf0618da3f
EBUILD courier-1.2.2-r1.ebuild 9457 BLAKE2B 4a8e8dcc45fd9381fb735419c3ba0b445b1f3585d525992f8b165cad294732b3190059374b917a00b38625445b0d574ac9d42697ae2d4af613a918770f483b43 SHA512 5b89f7e14d600edcd90f98eadd1ac0774c83905fa77607884a447ed2a2bd8a1552b91ef3c87e5afa5fc46975a0cda15c8a5b5729a4166501c58b35dea2cb32f2
EBUILD courier-1.2.2.ebuild 9263 BLAKE2B e5656abf60207172da2e27674b32e4a45d6874c20130c13634c0df07e5e4049ce9bb398eb4e2a0397b94839257cf0cf043d63b3cd2f40d18a974079cfa24f367 SHA512 1ac12e88befc9f6f1e7f9a2ee4e72697c47b4f4575b9ed7dc1ef3df67ee4fe7d9976786f993d394da1956b2fa1f59a8d26739788f16b025e29dee6fed7ee66fc
+EBUILD courier-1.2.3-r1.ebuild 9264 BLAKE2B dc4c4fd2545f16a65437845481230c770a8c180580d67d375927e07d4b1e0462362aa709b6ca29577aaf7573d78920872b5a0e133365875d6bb332a9606ff83e SHA512 e19eb3febe4e230845e11909289562df9b2d92d873a5bd5a549bc60e846dd880f825ac78446f259a6324f1ce59bca6d0acfbc828df1b9e6b648ca1eca661b9e4
EBUILD courier-1.2.3.ebuild 9263 BLAKE2B e5656abf60207172da2e27674b32e4a45d6874c20130c13634c0df07e5e4049ce9bb398eb4e2a0397b94839257cf0cf043d63b3cd2f40d18a974079cfa24f367 SHA512 1ac12e88befc9f6f1e7f9a2ee4e72697c47b4f4575b9ed7dc1ef3df67ee4fe7d9976786f993d394da1956b2fa1f59a8d26739788f16b025e29dee6fed7ee66fc
MISC metadata.xml 756 BLAKE2B e3d128790b1620d9005c9a14cef1c452488fc8e465b235791cc196f431cb2ea8348aba342b0867282878d0c73392694be0db0686dc048d9345b286c3bccf1cab SHA512 c3fcd1ba4b22f91b1acf49faeee41562a7963b51d37e1593156086b79a1eb4172a12e7226b71a9aa55b5a4ef7d734351752451a2300375d061ae20481778b273
diff --git a/mail-mta/courier/courier-1.2.3-r1.ebuild b/mail-mta/courier/courier-1.2.3-r1.ebuild
new file mode 100644
index 000000000000..5a2068123d54
--- /dev/null
+++ b/mail-mta/courier/courier-1.2.3-r1.ebuild
@@ -0,0 +1,311 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic
+
+DESCRIPTION="An MTA designed specifically for maildirs"
+HOMEPAGE="https://www.courier-mta.org/"
+SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite \
+ fam web webmail gnutls"
+
+DEPEND="
+ >=net-libs/courier-authlib-0.72.0
+ >=net-libs/courier-unicode-2.2.6:=
+ net-dns/libidn2:=
+ gnutls? ( net-libs/gnutls:= )
+ !gnutls? (
+ dev-libs/openssl:0=
+ )
+ >=sys-libs/gdbm-1.8.0:=
+ dev-libs/libpcre2
+ app-misc/mime-types
+ fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
+ pam? ( sys-libs/pam )
+ mysql? ( dev-db/mysql-connector-c )
+ 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/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/sendmail
+ !mail-mta/ssmtp[mta]
+ !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/courier-imap
+ !net-mail/cyrus-imapd"
+
+PDEPEND="pam? ( net-mail/mailbase )
+ crypt? ( >=app-crypt/gnupg-1.0.4 )"
+
+src_prepare() {
+ use norewrite && eapply "${FILESDIR}/norewrite.patch"
+ default
+}
+
+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) \
+ --with-notice=unicode \
+ --enable-mimetypes=/etc/mime.types \
+ --prefix=/usr \
+ --disable-root-check \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc/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"
+}
+
+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 DESTDIR="${D}" || 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:mail ldapaliasrc ; chmod 640 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 ../share/courier/pop3d /usr/sbin/courier-pop3d
+ dosym ../share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
+ dosym ../share/courier/imapd /usr/sbin/courier-imapd
+ dosym ../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 ../bin/sendmail /usr/sbin/sendmail
+}
+
+src_test() {
+ if [ `whoami` != 'root' ]; then
+ # Disable valgrind checks
+ echo '#!/bin/sh' > libs/imap/testsuitevalgrind
+ echo '#!/bin/sh' > libs/maildir/testsuitevalgrind
+ sed -i -e 's:VALGRIND=:#VALGRIND=:g' libs/maildrop/Makefile*
+ emake -j1 check
+ 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 [[ -z "${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/postfix/Manifest b/mail-mta/postfix/Manifest
index 9bc1c402f595..0643920005ca 100644
--- a/mail-mta/postfix/Manifest
+++ b/mail-mta/postfix/Manifest
@@ -3,7 +3,9 @@ AUX postfix.service 662 BLAKE2B dcf9ceb71ad483b580d126fcb5ac68889cdeb898df3333d3
AUX smtp.pass 29 BLAKE2B 589915bd2856fa64e22caa12fca54ef342eb07606de38d3879c13ac395413c84de6c3b733c83cc0625a4433167efcc7d504b2f87fa26c05b2facde9c3d103021 SHA512 a8a940099a77ea0547004daf5392a6efc0cd643f10072803d65e37763012464ad25b1b925ae9e32bffb3c3e8a5d4b2d3bb5619a174d58fdc4ea5d4090db0d365
AUX smtp.sasl 42 BLAKE2B 67e9108101779b6027fa1e5cc7c9256a606d440e15bb037a0da186e6b4983ab26e88ede2f0604737c78144c03e182f66005062f1d49e10443d1ddb9757461d1f SHA512 a48e2bd173c4443dd2c389f6973a541dbcba4223b52b42b409a68d934a7fc82a98d4027267befcd5db6ec628cce6a9dffdf044e6fbd774b6e748f07f4106db47
DIST postfix-3.7.4.tar.gz 4833834 BLAKE2B edb716ef4576d339189f11b535a62f3c6f8f28613723d916f13cdd2d37228aa8768dacdb9d8616c83f0ded3a3c801c45747375ea6cfa505b668a7163c4637128 SHA512 972738291b960c90fe83861d55b1288900416167adb353418956e69bcc709a6daf84fbfde11d573eebba030654d27abc8d55f90661a2b880ccfb3a334064c236
-DIST postfix-3.8-20230409.tar.gz 4825559 BLAKE2B 5bf02050c396b11ea2825a274418949615c928d44bc30e60a76f0873348f16d67fef972ba1b9616c3872874fc43825b9734e4d3b7752eef38ade32427042bd4b SHA512 77f0eb14a04fe4ac1f836856c7da1976e5a7a04fe032718fc19bd06bf5b08d152cb2747e93b8563d6c51662f0c6e77d81baafce3fd438b2bd4cd84cf7e627cfc
+DIST postfix-3.8.0-RC1.tar.gz 4856059 BLAKE2B 9059099d2abfa1dd7e17ebfef07a96eaac36fde3c406e85ef219cba6ce39d8abd5ca9a955d8eaec4f8a8db0497adba975fb48a4c900476b2d2333993c8880b4d SHA512 70e11dd99c21c9ab86b02fea123011c936fc4ad360fc934dda9037ea4a65bba52044fba4b6287dcebcd07c07734164e7fdb34f974df980ee2f16911f2ba47da5
+DIST postfix-3.9-20230412.tar.gz 4826826 BLAKE2B 7a2f40de42ee0d5203d9b81de7eda5b4ca7fe4d1229042ef8d794222f72b720201d265dc527513fac45406fe4aa6bbe3483f8794b6e85afc9cd40355a43c92d1 SHA512 6f965cd03042c674743c129f7482ccc7ff96195952d324997a7871539d8789bdb1433a9a6a30ac3fb7c9689a9a61935bc9460952f272dcc5f39188b176c26ed9
EBUILD postfix-3.7.4.ebuild 8023 BLAKE2B f1ed37c430536e96591beceb346144d28bf5eee3a1f93d7d41d4db3f3ed36b9fea7847cbf0c3b278a8ee99ec93ad91797a8fccfad5104717deec5bf4ef18396e SHA512 0676646a5d0bc5187779b707593b8c6ac438c2f13524c4105bc4955feb57ed40aa86df78b740bec4cfa651ce22e44075d8fe6bbecbe44ad591842634856403cf
-EBUILD postfix-3.8_pre20230409.ebuild 8198 BLAKE2B 3a4bad841ef4154c8ac20c78ebe4e2bcae9023f92d52bf2d94945aae20bda2ca214942e58c598b7646f755bb0aebcf0966ac1dad334d4996b454d78f062c974a SHA512 c7d29ef876d85afcfc8c3e6d9e888e0f266cd30c0552c6f1e8ac3b462ec3c76b7244a202bf379053728264322b559f60aff0f5484fc7abdf9576e82af0155406
+EBUILD postfix-3.8.0_rc1.ebuild 8196 BLAKE2B cd5dd1fead1f37a73ca3b2ffd232db629b617470d6543cd3d6b0fd34ce6b82a2bcfd7cac91a81719fcbb5097cd478548227cc01aa16aa71249ea7c923ee61c64 SHA512 38285f7690cc46d9adb91dfa0d49e58987b45f673b85d09e5acc65658c5cb865129e8c279a95d5eeb4276bcea7ea72e6c293c071cc05639710686681591a2b15
+EBUILD postfix-3.9_pre20230412.ebuild 8199 BLAKE2B 4415e28f87a7a5a1df454e45f4d296845f7cc1947a7df900cf25d4fa1c4c73158e831d78e5d0d427ab5d09f96536803a56d2dcb2a71f142d288a631a4219e5ed SHA512 50a2464559afd3582603876caeb44db9a733344d7ff9524b8b68015b0ee5412526703db6b4b62a955f60e4e7bd4545a811ce0552d69e9346c0196e05fc1be86a
MISC metadata.xml 853 BLAKE2B 96b2b5c531692f1eba1bc4c543ba4df77754d11802e9754ac102907d00dc1284fe449384d3c8c4e53c343e3424f79cf654b7a0c6a112d0ec973f8da585045ff7 SHA512 15c4521a70f25d8d5261c1c981d7ab41cdf542a1630c6857037e0b3e3ab0a51f6dbb4edee9ee9857d0b7a130c5da6f475e1be6a02728edecb23defa004be48eb
diff --git a/mail-mta/postfix/postfix-3.8.0_rc1.ebuild b/mail-mta/postfix/postfix-3.8.0_rc1.ebuild
new file mode 100644
index 000000000000..60e7bcd6704e
--- /dev/null
+++ b/mail-mta/postfix/postfix-3.8.0_rc1.ebuild
@@ -0,0 +1,297 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit pam systemd toolchain-funcs
+
+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 EPL-2.0 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="+berkdb cdb dovecot-sasl +eai ldap ldap-bind lmdb mbox memcached mysql nis pam postgres sasl selinux sqlite ssl"
+
+DEPEND="
+ acct-group/postfix
+ acct-group/postdrop
+ acct-user/postfix
+ dev-libs/libpcre2:0
+ 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? ( dev-db/mysql-connector-c:0= )
+ nis? ( net-libs/libnsl:= )
+ pam? ( sys-libs/pam )
+ postgres? ( dev-db/postgresql:* )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? ( >=dev-libs/openssl-1.1.1:0= )
+ "
+
+RDEPEND="${DEPEND}
+ memcached? ( net-misc/memcached )
+ net-mail/mailbase
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !mail-mta/ssmtp[mta]
+ selinux? ( sec-policy/selinux-postfix )"
+
+# require at least one of db implementations for newalias (and postmap)
+# command to function correctly
+REQUIRED_USE="
+ || ( berkdb cdb lmdb )
+ ldap-bind? ( ldap sasl )
+ "
+
+S="${WORKDIR}/${MY_SRC}"
+
+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"
+}
+
+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="" mylibs="${LDFLAGS} -ldl"
+
+ # libpcre is EOL. prefer libpcre2
+ mycc=" -DHAS_PCRE=2"
+ AUXLIBS_PCRE="$(pcre2-config --libs8)"
+
+ 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"
+ # change default database type
+ if use lmdb; then
+ mycc="${mycc} -DDEF_DB_TYPE=\\\"lmdb\\\""
+ elif use cdb; then
+ 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
+ AUXLIBS_CDB="-lcdb"
+ else
+ 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
+
+ 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() {
+ 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" \
+ || 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, collate and tlstype
+ 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
+ dobin auxiliary/collate/tlstype.pl
+ dodoc auxiliary/collate/README.tlstype
+
+ # 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
+ keepdir /var/lib/postfix
+ fowners -R postfix:postfix /var/lib/postfix
+ fperms 0750 /var/lib/postfix
+ fowners root:postdrop /usr/sbin/post{drop,queue,log}
+ fperms 02755 /usr/sbin/post{drop,queue,log}
+
+ keepdir /etc/postfix
+ keepdir /etc/postfix/postfix-files.d
+ if use mbox; then
+ mypostconf="mail_spool_directory=/var/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*
+ dodoc -r README_FILES/ examples/
+ # postfix set-permissions expects uncompressed man files
+ docompress -x /usr/share/man
+
+ if use pam; then
+ pamd_mimic_system smtp auth account
+ fi
+
+ if use sasl; then
+ insinto /etc/sasl2
+ newins "${FILESDIR}"/smtp.sasl smtpd.conf
+ fi
+
+ # header files
+ insinto /usr/include/postfix
+ doins include/*.h
+
+ 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() {
+ # do not assume berkdb
+ if [[ ! -e /etc/mail/aliases.db \
+ && ! -e /etc/mail/aliases.cdb \
+ && ! -e /etc/mail/aliases.lmdb ]] ; 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
+
+ # check and fix file permissions
+ "${EROOT}"/usr/sbin/postfix set-permissions
+
+ # hint for configuring tls
+ if use ssl ; then
+ if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
+ elog "To configure client side TLS settings, please run:"
+ 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, please run:"
+ elog "${EROOT}"/usr/sbin/postfix tls enable-server
+ fi
+ fi
+}
diff --git a/mail-mta/postfix/postfix-3.8_pre20230409.ebuild b/mail-mta/postfix/postfix-3.9_pre20230412.ebuild
index 3921e4699e0e..809c17c943f1 100644
--- a/mail-mta/postfix/postfix-3.8_pre20230409.ebuild
+++ b/mail-mta/postfix/postfix-3.9_pre20230412.ebuild
@@ -16,7 +16,7 @@ SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
LICENSE="|| ( IBM EPL-2.0 )"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-IUSE="berkdb cdb dovecot-sasl +eai ldap ldap-bind lmdb mbox memcached mysql nis pam postgres sasl selinux sqlite ssl"
+IUSE="+berkdb cdb dovecot-sasl +eai ldap ldap-bind lmdb mbox memcached mysql nis pam postgres sasl selinux sqlite ssl"
DEPEND="
acct-group/postfix