From 752d6256e5204b958b0ef7905675a940b5e9172f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 12 May 2022 16:42:50 +0300 Subject: gentoo resync : 12.05.2022 --- mail-mta/courier/Manifest | 4 +- mail-mta/courier/courier-1.1.5-r2.ebuild | 312 ------------------------------ mail-mta/courier/courier-1.1.5-r3.ebuild | 312 ++++++++++++++++++++++++++++++ mail-mta/courier/courier-1.1.8-r1.ebuild | 313 ------------------------------- mail-mta/courier/courier-1.1.8-r2.ebuild | 313 +++++++++++++++++++++++++++++++ 5 files changed, 627 insertions(+), 627 deletions(-) delete mode 100644 mail-mta/courier/courier-1.1.5-r2.ebuild create mode 100644 mail-mta/courier/courier-1.1.5-r3.ebuild delete mode 100644 mail-mta/courier/courier-1.1.8-r1.ebuild create mode 100644 mail-mta/courier/courier-1.1.8-r2.ebuild (limited to 'mail-mta/courier') diff --git a/mail-mta/courier/Manifest b/mail-mta/courier/Manifest index b1bdcca8df88..9eff1df572eb 100644 --- a/mail-mta/courier/Manifest +++ b/mail-mta/courier/Manifest @@ -4,6 +4,6 @@ AUX norewrite.patch 488 BLAKE2B 663b52ff5936d5c8aa24ce2a226cd803f09a972a2f358b7f AUX password.dist 247 BLAKE2B 1803a6663c32ccc74c4dfb1d591a01d4416f9de9c4bf35c9a7ca277c2007b8c29a8899f4285c78eeb8592766457eef0caf377a344adee7a61be15bbf8b80c7de SHA512 f488b0ab1a909c9b878b9f3f3147641a9ed6d8d2ad44c67cd641934b800b18a62de2a7f5f51fdbecfbbcdd7c39c753734984cc0836c905a3b708858e1b91093d DIST courier-1.1.5.tar.bz2 7654159 BLAKE2B 7ad09b4b3c8ec201ea275851aec4efb34861a2881c765228b58063d26f17580fbe8ffe4e882d43b74ed048c3bf711e0eb08cb45eb1ba25ab2073a8c411a6cd4f SHA512 6b7040a73b09a4fc0ad4d93c576d7d7026aa743e5bbfe3ae14d2474dd9cffdb3419eceb14000cc0beeae40886796d9973e9f8611a7ea925cf2e0ab928904038a DIST courier-1.1.8.tar.bz2 7655220 BLAKE2B 189c87e416fe8d232e1fab8be47ff8258a54de2a6eccf1b02bd2839c6925018ee5b0ff3172ba791076c979d5c15a9dbcac1e7f515b0683066f3ff55369ea91a9 SHA512 9a0d96a20a75794fba57df11305326eb990091bd503763cd091ad29a4b34d9c1576d40c2e2d6eb81f3705e2d4b0a265c174df6e307a60fbbc1dc26110d931133 -EBUILD courier-1.1.5-r2.ebuild 9234 BLAKE2B 4122d0f243ccbdea905a2ee5d5de94477746965f10253da2063bf0ecbaeee0a73afd93d5f8fa32b334ef8c2676073452e7bc9f16313791c8f1138fe090b04839 SHA512 e9d0ce3cb7196a8fcdd611e3ef7182554510c6ef4d5f2d7c1f86cbb04036f02c57a6f09754968250d20e678626f326b8260cd2c5b15c51feb430d4dc9b4308ff -EBUILD courier-1.1.8-r1.ebuild 9240 BLAKE2B ed240f38e8d32ce3e0055d8119ad2a38e18c236ca2af594cb84ab5cfa2d1529a7ce1c26b8a24dbc9bb48abaec045557a78004afed1b117249a250dfaf19a375c SHA512 4037f388235dc6847944c150e0bf5ee8ee7d0ac10719f95a1ad08bf7d9f8a33686ae47fbbfab6226144ee9853822e77de033a7cd9b64d22baf37026e701d95b4 +EBUILD courier-1.1.5-r3.ebuild 9233 BLAKE2B d0c7f609140f624ee3b971f240766b80bc467d5f9ce649b2ff4591096d48eea997e2a9951fd56bbbb5511557609bcc21c7a5e992931597e52d0a584141eb9c90 SHA512 6563cd00e122b641f4b2147b02edcda05dd6bc6e662a2d4a55fa9f4d5327c3c48931bd4c8d6d536eae05726f91f405d20d534e70a50f1d2193d22a53ba5f6d6f +EBUILD courier-1.1.8-r2.ebuild 9239 BLAKE2B 37bdf7f22ac01545fe89f6a3d63a58ab984c5f27efd0d8a6a5d751b15bd184afb53e92ad04e7fce78cae5557dc960e22ca3135aee5334603804ab00e29a02b47 SHA512 46489020884af61bac01a18dca9704a931ba81ad07f08873511baa15fc401c722c52f882c136eadc36cc46d3f590e48bb7aacff54b129b265384baaf0618da3f MISC metadata.xml 756 BLAKE2B e3d128790b1620d9005c9a14cef1c452488fc8e465b235791cc196f431cb2ea8348aba342b0867282878d0c73392694be0db0686dc048d9345b286c3bccf1cab SHA512 c3fcd1ba4b22f91b1acf49faeee41562a7963b51d37e1593156086b79a1eb4172a12e7226b71a9aa55b5a4ef7d734351752451a2300375d061ae20481778b273 diff --git a/mail-mta/courier/courier-1.1.5-r2.ebuild b/mail-mta/courier/courier-1.1.5-r2.ebuild deleted file mode 100644 index 3ef7bf19c50c..000000000000 --- a/mail-mta/courier/courier-1.1.5-r2.ebuild +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic multilib - -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.71.3 - >=net-libs/courier-unicode-2.2.3:= - net-dns/libidn:= - gnutls? ( net-libs/gnutls:= ) - !gnutls? ( - dev-libs/openssl:0= - ) - >=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? ( 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/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] - !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 && 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" - 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: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 - 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 [ "${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-1.1.5-r3.ebuild b/mail-mta/courier/courier-1.1.5-r3.ebuild new file mode 100644 index 000000000000..6011e0efbe2e --- /dev/null +++ b/mail-mta/courier/courier-1.1.5-r3.ebuild @@ -0,0 +1,312 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic multilib + +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.71.3 + >=net-libs/courier-unicode-2.2.3:= + net-dns/libidn:= + gnutls? ( net-libs/gnutls:= ) + !gnutls? ( + dev-libs/openssl:0= + ) + >=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? ( 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/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] + !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 && 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" + 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: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 + 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/courier/courier-1.1.8-r1.ebuild b/mail-mta/courier/courier-1.1.8-r1.ebuild deleted file mode 100644 index 55023ee74943..000000000000 --- a/mail-mta/courier/courier-1.1.8-r1.ebuild +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic multilib - -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.71.3 - >=net-libs/courier-unicode-2.2.3:= - net-dns/libidn:= - gnutls? ( net-libs/gnutls:= ) - !gnutls? ( - dev-libs/openssl:0= - ) - >=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? ( 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/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] - !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 && 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 - 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 [ "${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-1.1.8-r2.ebuild b/mail-mta/courier/courier-1.1.8-r2.ebuild new file mode 100644 index 000000000000..6862c3007f92 --- /dev/null +++ b/mail-mta/courier/courier-1.1.8-r2.ebuild @@ -0,0 +1,313 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic multilib + +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.71.3 + >=net-libs/courier-unicode-2.2.3:= + net-dns/libidn:= + gnutls? ( net-libs/gnutls:= ) + !gnutls? ( + dev-libs/openssl:0= + ) + >=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? ( 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/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] + !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 && 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 + 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 +} -- cgit v1.2.3