Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mail-filter/dk-milter-1.0.1 and removal of obsolete dk-milter-0.6.0

  • Loading branch information...
commit 2770ae17209c49e3ef9b114c711cd20653053cda 1 parent 9f9b9ef
@wmark authored
View
33 mail-filter/dk-milter/Manifest
@@ -1,28 +1,5 @@
-AUX dk-filter.conf 347 RMD160 ae7051d91da468904fbc93be0c8f8dbdf9d436f7 SHA1 15b56a71edd3d8a62b76b74d9caf25b97630dc67 SHA256 250a60b7e838c222697049cccf1db0586742751878d399379ce372ff421361ff
-MD5 c753cb9c9a8f87c87597df7327c38ffb files/dk-filter.conf 347
-RMD160 ae7051d91da468904fbc93be0c8f8dbdf9d436f7 files/dk-filter.conf 347
-SHA256 250a60b7e838c222697049cccf1db0586742751878d399379ce372ff421361ff files/dk-filter.conf 347
-AUX dk-filter.init 1954 RMD160 b4967db9e283bb31cef96a5bb40e19e0680beca4 SHA1 17c254d9e5f98feb0721215b6af3c14e0f52c58a SHA256 fc2243d8b275c4ffe78f06556b972e0e09753e9676e8d13b5a7f57e292759df5
-MD5 5e5325136196e4922faecbc0eaabd1bc files/dk-filter.init 1954
-RMD160 b4967db9e283bb31cef96a5bb40e19e0680beca4 files/dk-filter.init 1954
-SHA256 fc2243d8b275c4ffe78f06556b972e0e09753e9676e8d13b5a7f57e292759df5 files/dk-filter.init 1954
-AUX dk-milter-0.4.1-queueID.patch 547 RMD160 a189b7098a47b7fc8451a29c99ec49cfcf16fbed SHA1 ba7227a8529220093752952f16db5c8714bb90cd SHA256 b0ef0f941644dc8c02bcaf845ba51112b08e2f605a5f7b9dc07d1930c8d59fe2
-MD5 bdc8199b16d38d4b48a3e9f7a62f15e7 files/dk-milter-0.4.1-queueID.patch 547
-RMD160 a189b7098a47b7fc8451a29c99ec49cfcf16fbed files/dk-milter-0.4.1-queueID.patch 547
-SHA256 b0ef0f941644dc8c02bcaf845ba51112b08e2f605a5f7b9dc07d1930c8d59fe2 files/dk-milter-0.4.1-queueID.patch 547
-AUX gentxt.sh 1484 RMD160 1c33d806702341be3e28a1c1ea81693e7aa1bd68 SHA1 4393133609b34d1e97e26d51284d95196ce0adcb SHA256 0d0d6b1d813a58ddcc7d0700d58ca9f57d351792687ee88b511dbff8d66b2985
-MD5 53ea44bf7e888c970a6740c561fd9112 files/gentxt.sh 1484
-RMD160 1c33d806702341be3e28a1c1ea81693e7aa1bd68 files/gentxt.sh 1484
-SHA256 0d0d6b1d813a58ddcc7d0700d58ca9f57d351792687ee88b511dbff8d66b2985 files/gentxt.sh 1484
-AUX site.config.m4 94 RMD160 d9de9bfcaaf69bb39f0597e3b59e0195e513559e SHA1 cb3e5528e791716f03541a1e18e403e2f0d9a8bf SHA256 4e177b598ebc524febfcabf0a1da37df8d3d7e4d0d51051476cdde4bee3b5b93
-MD5 daafe563fbfe874bb0d92c1ac2698735 files/site.config.m4 94
-RMD160 d9de9bfcaaf69bb39f0597e3b59e0195e513559e files/site.config.m4 94
-SHA256 4e177b598ebc524febfcabf0a1da37df8d3d7e4d0d51051476cdde4bee3b5b93 files/site.config.m4 94
-DIST dk-milter-0.6.0.tar.gz 350417 RMD160 aabc4fa34c4f6b3e03b39260471da5e91736b930 SHA1 4ee16bdf8f11c040e0a4db62ca84c1e3dae53492 SHA256 1114e9e548a341eda66da92fcca903d665e77763ee63d67e690606af4acce683
-EBUILD dk-milter-0.6.0.ebuild 1634 RMD160 cb20bbb2d39edd1b3a339b2bbbf3e169422fd921 SHA1 070f49b14b92522cabb5d3ad74543f129803feea SHA256 1f988367684c6458c39f80d4ac9109b939dd0c5770256d677240fded9632ce6c
-MD5 c0756cb8671bee4230b1a1a270df1403 dk-milter-0.6.0.ebuild 1634
-RMD160 cb20bbb2d39edd1b3a339b2bbbf3e169422fd921 dk-milter-0.6.0.ebuild 1634
-SHA256 1f988367684c6458c39f80d4ac9109b939dd0c5770256d677240fded9632ce6c dk-milter-0.6.0.ebuild 1634
-MD5 40df416886a77e85b35de0e916f51a18 files/digest-dk-milter-0.6.0 247
-RMD160 ab9fa351a7fafae6361c9344e1dbe6af4a74ad40 files/digest-dk-milter-0.6.0 247
-SHA256 18ebc0e0a5b0a4cf21d621854d7f30a8afa00622003babe73aaebf46fa6e0352 files/digest-dk-milter-0.6.0 247
+AUX dk-filter.conf 346 RMD160 9a247255de0200e34cca4a4df03f73252ac1d5b6 SHA1 4e8548264e4513de98992f8523d5adefa54ea2f5 SHA256 b2e1ed85f0c05bb3fccc4fafaabb8b169919f0b2256e70d8e777f5241912192c
+AUX dk-filter.init 1218 RMD160 1bf649a3147087c88c11def02dbb30ca465fde02 SHA1 45ba3c262c75da02c1a04fbc1a674b9c28a9da5e SHA256 01efa58dc6de954d80f571da960072367e9da8d3c4e8fdb8a3c47a61e54526f2
+AUX gentoo.config.m4 134 RMD160 fa59a3250591c29d575e828deb4c3bb0ebfafd60 SHA1 5a1f335a7dde4665344e92dd9cb55d65585e50d5 SHA256 9c640f53626f42256bc1616d3adcbfc7fb3e37a3bb74863ab2292d9e8658b3df
+DIST dk-milter-1.0.1.tar.gz 362193 RMD160 08f37caa1a54ac29cea8a2c25899934bcb2eaef4 SHA1 124ec9087fe2c11bc1cb386e5b5002c2c32d7068 SHA256 80ea4563643c27da390d7a013b2f65a1502ec7be69c68ad6dfcae3b2f82dcd4e
+EBUILD dk-milter-1.0.1.ebuild 4369 RMD160 53222d80f9ed53a43f62e7ac6460931737af7594 SHA1 32d4a54172eca70bb29ecdce1086bd375691a377 SHA256 3e96e57d82997d3820ddcca52f3b6b0d404cebc4389edaabaaf10340c3ff2489
View
62 mail-filter/dk-milter/dk-milter-0.6.0.ebuild
@@ -1,62 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-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 >=mail-mta/sendmail-8.12 )"
-
-S=${WORKDIR}/${P}
-
-pkg_setup() {
- enewgroup milter
- enewuser milter -1 -1 /var/milter milter
-}
-
-src_unpack() {
- unpack "${A}" && cd "${S}"
-
- # Postfix queue ID patch. See MILTER_README.html#workarounds
- epatch "${FILESDIR}"/${PN}-0.4.1-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"
-}
View
132 mail-filter/dk-milter/dk-milter-1.0.1.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/dk-milter-1.0.0.ebuild,v 1.1 2008/06/08 09:26:53 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"
+DEPEND="${RDEPEND}
+ || ( mail-filter/libmilter mail-mta/sendmail )" # libmilter is a static library
+
+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 README RELEASE_NOTES KNOWNBUGS *.txt
+}
+
+pkg_postinst() {
+ 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."
+}
View
3  mail-filter/dk-milter/files/digest-dk-milter-0.6.0
@@ -1,3 +0,0 @@
-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
View
16 mail-filter/dk-milter/files/dk-filter.conf
@@ -1,9 +1,7 @@
-# Additional options for the Domain Key Milter
-# see dk-filter(8) for more information.
-SOCKETSPEC="inet:8025@localhost"
-DOMAIN="example.com"
-SELECTOR="domainkey"
-KEYPATH="/etc/mail/dk-filter/$SELECTOR.private"
-USER="milter"
-CANON="nofws"
-DK_FILTER_OPTS="-H -u milter -l -p $SOCKETSPEC -c $CANON -d $DOMAIN -s $KEYPATH -S $SELECTOR -o X-Greylist"
+# 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"
View
92 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 $?
}
View
16 mail-filter/dk-milter/files/dk-milter-0.4.1-queueID.patch
@@ -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)
View
4 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')
View
52 mail-filter/dk-milter/files/gentxt.sh
@@ -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
View
2  mail-filter/dk-milter/files/site.config.m4
@@ -1,2 +0,0 @@
-define(`confCCOPTS', `@@confCCOPTS@@')
-APPENDDEF(`confINCDIRS', `@@conf_libmilter_INCDIRS@@')
Please sign in to comment.
Something went wrong with that request. Please try again.