diff options
author | Alin Năstac <mrness@gentoo.org> | 2007-10-12 20:31:23 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2007-10-12 20:31:23 +0000 |
commit | 9fe272b6d24abb039557630b57f5dbed041c211c (patch) | |
tree | 22b067fdfe8cd658fb156c03b445d4005be62940 /mail-filter/dk-milter | |
parent | as-needed fix thanks to Andrei Slavoiu <ansla80@yahoo.com> in bug 195144 (diff) | |
download | gentoo-2-9fe272b6d24abb039557630b57f5dbed041c211c.tar.gz gentoo-2-9fe272b6d24abb039557630b57f5dbed041c211c.tar.bz2 gentoo-2-9fe272b6d24abb039557630b57f5dbed041c211c.zip |
Redesign the ebuild taking dkim-milter as model (#178501). Add myself as maintainer. Add ~amd64 keyword.
(Portage version: 2.1.3.9)
Diffstat (limited to 'mail-filter/dk-milter')
-rw-r--r-- | mail-filter/dk-milter/ChangeLog | 14 | ||||
-rw-r--r-- | mail-filter/dk-milter/dk-milter-0.4.1.ebuild | 73 | ||||
-rw-r--r-- | mail-filter/dk-milter/dk-milter-0.6.0.ebuild | 134 | ||||
-rw-r--r-- | mail-filter/dk-milter/files/digest-dk-milter-0.4.1 | 3 | ||||
-rw-r--r-- | mail-filter/dk-milter/files/digest-dk-milter-0.6.0 | 3 | ||||
-rw-r--r-- | mail-filter/dk-milter/files/dk-filter.conf | 17 | ||||
-rwxr-xr-x | mail-filter/dk-milter/files/dk-filter.init | 92 | ||||
-rw-r--r-- | mail-filter/dk-milter/files/dk-milter-0.4.1-queueID.patch | 16 | ||||
-rw-r--r-- | mail-filter/dk-milter/files/gentoo.config.m4 | 4 | ||||
-rwxr-xr-x | mail-filter/dk-milter/files/gentxt.sh | 52 | ||||
-rw-r--r-- | mail-filter/dk-milter/files/site.config.m4 | 2 | ||||
-rw-r--r-- | mail-filter/dk-milter/metadata.xml | 5 |
12 files changed, 184 insertions, 231 deletions
diff --git a/mail-filter/dk-milter/ChangeLog b/mail-filter/dk-milter/ChangeLog index 2d0d7e4011f1..b99c02e4efe9 100644 --- a/mail-filter/dk-milter/ChangeLog +++ b/mail-filter/dk-milter/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for mail-filter/dk-milter -# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/ChangeLog,v 1.8 2006/07/30 16:25:17 swegener Exp $ +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/ChangeLog,v 1.9 2007/10/12 20:31:22 mrness Exp $ + +*dk-milter-0.6.0 (12 Oct 2007) + + 12 Oct 2007; Alin Năstac <mrness@gentoo.org> + -files/dk-milter-0.4.1-queueID.patch, files/dk-filter.conf, + files/dk-filter.init, +files/gentoo.config.m4, -files/gentxt.sh, + -files/site.config.m4, metadata.xml, -dk-milter-0.4.1.ebuild, + +dk-milter-0.6.0.ebuild: + Redesign the ebuild taking dkim-milter as model (#178501). + Add myself as maintainer. Add ~amd64 keyword. 20 Jul 2006; Tuấn Văn <langthang@gentoo.org> files/dk-filter.init: add some sanity checking. diff --git a/mail-filter/dk-milter/dk-milter-0.4.1.ebuild b/mail-filter/dk-milter/dk-milter-0.4.1.ebuild deleted file mode 100644 index 90d2bf93363e..000000000000 --- a/mail-filter/dk-milter/dk-milter-0.4.1.ebuild +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/dk-milter-0.4.1.ebuild,v 1.7 2007/07/15 02:43:38 mr_bones_ Exp $ - -inherit eutils - -DESCRIPTION="A milter-based application provide DomainKeys service" - -HOMEPAGE="http://sourceforge.net/projects/dk-milter/" - -SRC_URI="mirror://sourceforge/dk-milter/${P}.tar.gz" - -LICENSE="Sendmail-Open-Source" - -SLOT="0" - -KEYWORDS="~x86" - -IUSE="" - -DEPEND="dev-libs/openssl - >=sys-libs/db-3.2 - mail-filter/libmilter" - -S=${WORKDIR}/${P} - -pkg_setup() { - enewgroup milter - enewuser milter -1 -1 -1 milter -} - -src_unpack() { - unpack "${A}" && cd "${S}" - - # Postfix queue ID patch. See MILTER_README.html#workarounds - epatch "${FILESDIR}"/${P}-queueID.patch - - confCCOPTS="${CFLAGS}" - conf_libmilter_INCDIRS="-I/usr/include/libmilter" - sed -e "s:@@confCCOPTS@@:${confCCOPTS}:" \ - -e "s:@@conf_libmilter_INCDIRS@@:${conf_libmilter_INCDIRS}:" \ - "${FILESDIR}"/site.config.m4 > "${S}"/devtools/Site/site.config.m4 \ - || die "sed failed" -} - -src_install() { - OBJDIR="obj.`uname -s`.`uname -r`.`arch`" - - # prepare directory for private keys. - dodir /etc/mail/dk-filter - keepdir /etc/mail/dk-filter - fowners milter:milter /etc/mail/dk-filter - fperms 700 /etc/mail/dk-filter - - dodir /usr/bin /usr/share/man/man8 - - make DESTDIR=${D} MANROOT=/usr/share/man/man \ - install -C "${OBJDIR}"/dk-filter \ - || die "make install failed" - - doman dk-filter/dk-filter.8 - dobin "$FILESDIR"/gentxt.sh || die "dobin failed" - - newinitd "${FILESDIR}/dk-filter.init" dk-filter \ - || die "newinitd failed" - newconfd "${FILESDIR}/dk-filter.conf" dk-filter \ - || die "newconfd failed" -} - -pkg_postinst() { - enewgroup milter - enewuser milter -1 -1 -1 milter -} diff --git a/mail-filter/dk-milter/dk-milter-0.6.0.ebuild b/mail-filter/dk-milter/dk-milter-0.6.0.ebuild new file mode 100644 index 000000000000..bee6054c2f09 --- /dev/null +++ b/mail-filter/dk-milter/dk-milter-0.6.0.ebuild @@ -0,0 +1,134 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/dk-milter-0.6.0.ebuild,v 1.1 2007/10/12 20:31:22 mrness Exp $ + +inherit eutils toolchain-funcs + +DESCRIPTION="A milter-based application provide DomainKeys service" +HOMEPAGE="http://sourceforge.net/projects/dk-milter/" +SRC_URI="mirror://sourceforge/dk-milter/${P}.tar.gz" + +LICENSE="Sendmail-Open-Source" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ipv6" + +RDEPEND="dev-libs/openssl + >=sys-libs/db-3.2 + || ( mail-filter/libmilter mail-mta/sendmail )" +DEPEND="${RDEPEND}" + +pkg_setup() { + enewgroup milter + enewuser milter -1 -1 -1 milter +} + +src_unpack() { + unpack ${A} + + local ENVDEF="" + use ipv6 && ENVDEF="${ENVDEF} -DNETINET6" + sed -e "s:@@CFLAGS@@:${CFLAGS}:" -e "s/@@ENVDEF@@/${ENVDEF}/" \ + "${FILESDIR}/gentoo.config.m4" > "${S}/devtools/Site/site.config.m4" \ + || die "failed to generate site.config.m4" +} + +src_compile() { + emake -j1 CC="$(tc-getCC)" || die "emake failed" +} + +src_install() { + # no other program need to read from here + dodir /etc/mail/dk-filter + fowners milter:milter /etc/mail/dk-filter + fperms 700 /etc/mail/dk-filter + + newinitd "${FILESDIR}/dk-filter.init" dk-filter \ + || die "newinitd failed" + newconfd "${FILESDIR}/dk-filter.conf" dk-filter \ + || die "newconfd failed" + + # prepare directory for .pid and .sock files + dodir /var/run/dk-filter + fowners milter:milter /var/run/dk-filter + + dodir /usr/bin + emake -j1 DESTDIR="${D}" \ + SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \ + install || die "make install failed" + + # man build is broken; do man page installation by hand + doman */*.8 + + # some people like docs + dodoc RELEASE_NOTES *.txt +} + +pkg_postinst() { + pkg_setup # create milter user + + ewarn "DomainKeys RFC is obsoleted by DKIM and therefore you should only use" + ewarn "dk-milter for verifying mail signed with DomainKeys-Signature." + echo + elog "However, if you still want to use this in sign mode, you should run" + elog " emerge --config ${CATEGORY}/${PN}" + elog "It will help you create your key and give you hints on how" + elog "to configure your DNS and MTA." +} + +pkg_config() { + local selector pubkey + + read -p "Enter the selector name (default ${HOSTNAME}): " selector + [[ -n "${selector}" ]] || selector=${HOSTNAME} + if [[ -z "${selector}" ]]; then + eerror "Oddly enough, you don't have a HOSTNAME." + return 1 + fi + if [[ -f "${ROOT}"etc/mail/dk-filter/${selector}.private ]]; then + ewarn "The private key for this selector already exists." + else + einfo "Select the size of private key:" + einfo " [1] 512 bits" + einfo " [2] 1024 bits" + while read -n 1 -s -p " Press 1 or 2 on the keyboard to select the key size " keysize ; do + [[ "${keysize}" == "1" || "${keysize}" == "2" ]] && echo && break + done + case ${keysize} in + 1) keysize=512 ;; + *) keysize=1024 ;; + esac + + # generate the private and public keys + openssl genrsa -out "${ROOT}"etc/mail/dk-filter/${selector}.private ${keysize} && \ + chown milter:milter "${ROOT}"etc/mail/dk-filter/${selector}.private && chmod u=r,g-rwx,o-rwx "${ROOT}"etc/mail/dk-filter/${selector}.private && + openssl rsa -in "${ROOT}"etc/mail/dk-filter/${selector}.private -out "${ROOT}"etc/mail/dk-filter/${selector}.public -pubout -outform PEM || \ + { eerror "Failed to create private and public keys." ; return 1; } + fi + + # dk-filter selector configuration + echo + einfo "Make sure you add these parameters to your dk-filter command line:" + einfo " -b sv -d your-domain.com -H -s /etc/mail/dk-filter/${selector}.private -S ${selector}" + + # MTA configuration + echo + einfo "If you are using Postfix, add following lines to your main.cf:" + einfo " smtpd_milters = unix:/var/run/dk-filter/dk-filter.sock" + einfo " non_smtpd_milters = unix:/var/run/dk-filter/dk-filter.sock" + + # DNS configuration + { + local line + pubkey= + while read line; do + [[ "${line}" == "--"* ]] || pubkey="${pubkey}${line}" + done + } < "${ROOT}"etc/mail/dk-filter/${selector}.public + echo + einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:" + einfo " ${selector}._domainkey IN TXT \"g=\\; k=rsa\\; t=y\\; o=~\\; p=${pubkey}\"" + echo + einfo "t=y signifies you only test the DK on your domain." + einfo "See the DomainKeys specification for more info." +} diff --git a/mail-filter/dk-milter/files/digest-dk-milter-0.4.1 b/mail-filter/dk-milter/files/digest-dk-milter-0.4.1 deleted file mode 100644 index ef46e75ee010..000000000000 --- a/mail-filter/dk-milter/files/digest-dk-milter-0.4.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 ec5f4fa17d53a2f39ebb0025caccabe0 dk-milter-0.4.1.tar.gz 313092 -RMD160 fc75a6884b91466e97fd4830107baa43777f768b dk-milter-0.4.1.tar.gz 313092 -SHA256 51f19981cbd1f4fea343982912a92cee7e2e302b7b48fe1703430afa414bcfb1 dk-milter-0.4.1.tar.gz 313092 diff --git a/mail-filter/dk-milter/files/digest-dk-milter-0.6.0 b/mail-filter/dk-milter/files/digest-dk-milter-0.6.0 new file mode 100644 index 000000000000..2ef2cb3a337c --- /dev/null +++ b/mail-filter/dk-milter/files/digest-dk-milter-0.6.0 @@ -0,0 +1,3 @@ +MD5 f0fb37e503d34d13893c259867463dd8 dk-milter-0.6.0.tar.gz 350417 +RMD160 aabc4fa34c4f6b3e03b39260471da5e91736b930 dk-milter-0.6.0.tar.gz 350417 +SHA256 1114e9e548a341eda66da92fcca903d665e77763ee63d67e690606af4acce683 dk-milter-0.6.0.tar.gz 350417 diff --git a/mail-filter/dk-milter/files/dk-filter.conf b/mail-filter/dk-milter/files/dk-filter.conf index 9b34f1a02b92..89ca30d3ca28 100644 --- a/mail-filter/dk-milter/files/dk-filter.conf +++ b/mail-filter/dk-milter/files/dk-filter.conf @@ -1,10 +1,7 @@ -# Additional options for the Domain Key Milter -# see dk-filter(8) for more information. -DK_FILTER_OPTS="" -SOCKETSPEC="inet:8025@localhost" -DOMAIN="example.com" -SELECTOR="domainkey" -KEYPATH="/etc/mail/dk-filter/$SELECTOR.private" -USER="milter" -CANON="nofws" -DK_FILTER_OPTS="-u milter -l -p $SOCKETSPEC -c $CANON -d $DOMAIN -s $KEYPATH -S $SELECTOR" +# dk-filter parameters; following ones are mandatory +DAEMON_USER="milter" +SOCKET_SPEC="local:/var/run/dk-filter/dk-filter.sock" + +# Additional options for the Domain Key Milter see dk-filter(8) for more information. +ADDITIONAL_OPTS="-l -b v \ + -C badsignature=reject,dnserror=tempfail,internal=tempfail,nosignature=accept,signaturemissing=reject" diff --git a/mail-filter/dk-milter/files/dk-filter.init b/mail-filter/dk-milter/files/dk-filter.init index e61117ce5189..77dabec2b70c 100755 --- a/mail-filter/dk-milter/files/dk-filter.init +++ b/mail-filter/dk-milter/files/dk-filter.init @@ -1,99 +1,47 @@ #!/sbin/runscript -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/files/dk-filter.init,v 1.3 2006/07/20 01:27:05 langthang Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/files/dk-filter.init,v 1.4 2007/10/12 20:31:23 mrness Exp $ depend() { - # need net use dns logger net } -warn_msg() { - echo - ewarn "$1 parameter is not set!" - ewarn "dk-filter starts with" - ewarn "$1=${!1}" - ewarn "please set it in /etc/conf.d/dk-filter" - echo -} -die_msg() { - echo - eerror "please set paramter $1 in" - eerror "/etc/conf.d/dk-filter then start again" - echo -} +PIDFILE="/var/run/dk-filter/${SVCNAME}.pid" check_cfg() { - if [[ ! -f /etc/conf.d/dk-filter ]] ; then - eerror "/etc/conf.d/dk-filter is missing" - return 1 - fi - - source /etc/conf.d/dk-filter || { - eerror "Prolem sourcing /etc/conf.d/dk-filter" - eerror "Please correct them then start dk-filter again" - return 1 - } - - if [[ -z "${DK_FILTER_OPTS}" ]] ; then - die_msg DK_FILTER_OPTS - return 1 - fi - - if [[ -z "${SELECTOR}" ]] ; then - die_msg SELECTOR + if [ -z "${DAEMON_USER}" ] ; then + eerror "DAEMON_USER is unset" return 1 fi - if [[ -z "${KEYPATH}" ]] ; then - die_msg KEYPATH + SOCKET_TYPE=${SOCKET_SPEC%%:*} + SOCKET_ADDRESS=${SOCKET_SPEC#*:} + if [ -z "${SOCKET_TYPE}" -o -z "${SOCKET_ADDRESS}" ]; then + eerror "SOCKET_SPEC is invalid" return 1 fi - if [[ ! -f "${KEYPATH}" ]] ; then - echo - eerror "run gentxt.sh to generate a private key first" - eerror "then set KEYPATH in /etc/conf.d/dk-filter to" - eerror "the location of your private key" - echo - return 1 - fi - - if [[ -z "${SOCKETSPEC}" ]] ; then - SOCKETSPEC="inet:8025@localhost" - warn_msg SOCKETSPEC - fi - - if [[ -z "${DOMAIN}" ]] ; then - DOMAIN=$(domainname) - warn_msg DOMAIN + if [[ " ${ADDITIONAL_OPTS} " == *" -"[fpP]" "* ]]; then + eerror "-f, -p or -P are not allowed in ADDITIONAL_OPTS" + return 1 fi - - if [[ -z "${CANON}" ]] ; then - CANON="simple" - warn_msg CANON - fi - - if [[ -z "${CANON}" ]] ; then - USER="milter" - warn_msg USER - fi - - source /etc/conf.d/dk-filter } start() { + local SOCKET_TYPE SOCKET_ADDRESS check_cfg || return 1 - einfo "DK_FILTER_OPTS: $DK_FILTER_OPTS" - ebegin "Starting DomainKeys Filter" - start-stop-daemon --start --quiet --background \ - --exec /usr/bin/dk-filter -- ${DK_FILTER_OPTS} + + ebegin "Starting DomainKeys filter" + start-stop-daemon --start --pidfile "${PIDFILE}" \ + --exec /usr/bin/dk-filter -- -u "${DAEMON_USER}" -p "${SOCKET_SPEC}" -P "${PIDFILE}" ${ADDITIONAL_OPTS} && \ + [ "${SOCKET_TYPE}" != "local" -a "${SOCKET_TYPE}" != "unix" ] || chmod a+rwx "${SOCKET_ADDRESS}" eend $? } stop() { - ebegin "Stopping DomainKeys Filter" - start-stop-daemon --stop --quiet --name dk-filter + ebegin "Stopping DomainKeys filter" + start-stop-daemon --stop --pidfile "${PIDFILE}" eend $? } diff --git a/mail-filter/dk-milter/files/dk-milter-0.4.1-queueID.patch b/mail-filter/dk-milter/files/dk-milter-0.4.1-queueID.patch deleted file mode 100644 index 9ab2e4c2ace3..000000000000 --- a/mail-filter/dk-milter/files/dk-milter-0.4.1-queueID.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- dk-filter/dk-filter.c.orig 2006-07-17 16:33:44.000000000 -0700 -+++ dk-filter/dk-filter.c 2006-07-17 16:35:45.000000000 -0700 -@@ -2076,6 +2076,13 @@ - dfc = cc->cctx_msg; - assert(dfc != NULL); - -+ /* Determine the job ID for logging. */ -+ if (dfc->mctx_jobid == 0 || strcmp(dfc->mctx_jobid, JOBIDUNKNOWN) == 0) { -+ char *jobid = smfi_getsymval(ctx, "i"); -+ if (jobid != 0) -+ dfc->mctx_jobid = jobid; -+ } -+ - /* get hostname; used in the X header and in new MIME boundaries */ - hostname = smfi_getsymval(ctx, "j"); - if (hostname == NULL) diff --git a/mail-filter/dk-milter/files/gentoo.config.m4 b/mail-filter/dk-milter/files/gentoo.config.m4 new file mode 100644 index 000000000000..3b1e94ec44b7 --- /dev/null +++ b/mail-filter/dk-milter/files/gentoo.config.m4 @@ -0,0 +1,4 @@ +define(`confNO_MAN_BUILD',`') +define(`confOPTIMIZE', `@@CFLAGS@@') +define(`confENVDEF', `@@ENVDEF@@') +define(`bld_USE_ARLIB', `true') diff --git a/mail-filter/dk-milter/files/gentxt.sh b/mail-filter/dk-milter/files/gentxt.sh deleted file mode 100755 index f612fb5d968b..000000000000 --- a/mail-filter/dk-milter/files/gentxt.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -## -## $Id: gentxt.sh,v 1.1 2006/07/15 23:47:38 langthang Exp $ -## -## Copyright (c) 2004, 2005 Sendmail, Inc. and its suppliers. -## All rights reserved. -## -## gentxt.csh -- generate a TXT record for DomainKeys service -## -## Usage: gentext.csh <selector> [<domain>] -## -## This will write a TXT record suitable for insertion into a DNS zone file -## on standard output, and the matching public/private keys will be in -## PEM-formatted files called <selector>.public and <selector>.private, -## respectively, in the current directory. -## -## To translate the record produced by this script, see the DomainKeys -## draft. The script will output a record which advertises an RSA-style -## public key in test mode. - -## langthang@gentoo.org (15 July 2006) -## bash is gentoo default shell -## convert to bash - -# verify usage -if [[ "$3" != "" || "$1" == "" ]] ; then - echo "usage: $0 selector [domain]" - exit 1 -fi - -# copy the argument -selector="$1" -domain="$2" - -# generate a private key -openssl genrsa -out ${selector}.private 512 >& /dev/null - -# generate a public key based on the private key -openssl rsa -in ${selector}.private -out ${selector}.public -pubout \ - -outform PEM >& /dev/null - -# prepare the data -keydata=`grep -v '^-' ${selector}.public` -pubkey=`echo $keydata | sed 's/ //'` - -# output the record -echo -n ${selector}._domainkey IN TXT '"'g=\; k=rsa\; t=y\; p=$pubkey'"' -if [[ "$domain" != "" ]] ; then - echo " ; ----- DomainKey $selector for $domain" -else - echo "" -fi diff --git a/mail-filter/dk-milter/files/site.config.m4 b/mail-filter/dk-milter/files/site.config.m4 deleted file mode 100644 index 20dd5abce625..000000000000 --- a/mail-filter/dk-milter/files/site.config.m4 +++ /dev/null @@ -1,2 +0,0 @@ -define(`confCCOPTS', `@@confCCOPTS@@') -APPENDDEF(`confINCDIRS', `@@conf_libmilter_INCDIRS@@') diff --git a/mail-filter/dk-milter/metadata.xml b/mail-filter/dk-milter/metadata.xml index dda87916e233..d324818d97dc 100644 --- a/mail-filter/dk-milter/metadata.xml +++ b/mail-filter/dk-milter/metadata.xml @@ -2,5 +2,8 @@ <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <herd>net-mail</herd> -<maintainer><email>net-mail@gentoo.org</email></maintainer> +<maintainer> + <email>mrmess@gentoo.org</email> + <name>Alin Năstac</name> +</maintainer> </pkgmetadata> |