diff options
author | pav <pav@FreeBSD.org> | 2006-09-25 01:01:15 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2006-09-25 01:01:15 +0800 |
commit | 1bac94ce4a087c5277c20f6841a088c80cbd76d0 (patch) | |
tree | a198a70b19da5ba92d48c5b6ec5623f1b91d4e76 /mail/dkim-milter | |
parent | e6787d83d5fea55f1f626ada656fb39d4cb0dc6b (diff) | |
download | freebsd-ports-gnome-1bac94ce4a087c5277c20f6841a088c80cbd76d0.tar.gz freebsd-ports-gnome-1bac94ce4a087c5277c20f6841a088c80cbd76d0.tar.zst freebsd-ports-gnome-1bac94ce4a087c5277c20f6841a088c80cbd76d0.zip |
- Update to 0.5.2
- Add an option for Postfix milter
- Run under unpriviledged user
PR: ports/103404, ports/103417
Submitted by: Hirohisa Yamaguchi <umq@ueo.co.jp> (maintainer)
Diffstat (limited to 'mail/dkim-milter')
-rw-r--r-- | mail/dkim-milter/Makefile | 18 | ||||
-rw-r--r-- | mail/dkim-milter/distinfo | 6 | ||||
-rw-r--r-- | mail/dkim-milter/files/milter-dkim.sh.in | 36 | ||||
-rw-r--r-- | mail/dkim-milter/files/patch-libar-Makefile.m4 | 10 | ||||
-rw-r--r-- | mail/dkim-milter/pkg-install | 18 | ||||
-rw-r--r-- | mail/dkim-milter/pkg-message | 2 | ||||
-rw-r--r-- | mail/dkim-milter/pkg-message.postfix | 16 |
7 files changed, 82 insertions, 24 deletions
diff --git a/mail/dkim-milter/Makefile b/mail/dkim-milter/Makefile index 9d595d636574..3d8cce1e6fde 100644 --- a/mail/dkim-milter/Makefile +++ b/mail/dkim-milter/Makefile @@ -4,9 +4,16 @@ # # $FreeBSD$ # +## There is a new option WITH_POSTFIX_MILTER +## to make this port work with mail/postfix port. + +## WITH_POSTFIX_MILTER knob implicitly defines +## SENDMAIL_MILTER_IN_BASE, to build with libmilter* +## in base system. If you have deleted sendamil in +## base system, building this port may fail. PORTNAME= dkim-milter -PORTVERSION= 0.5.1 +PORTVERSION= 0.5.2 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} @@ -16,6 +23,12 @@ COMMENT= Domainkeys milter for Sendmail USE_RC_SUBR= milter-dkim.sh +.if defined(WITH_POSTFIX_MILTER) +SENDMAIL_MILTER_IN_BASE= yes +RUN_DEPENDS+= postfix>=2[3-9]*:${PORTSDIR}/mail/postfix +PKGMESSAGE= pkg-message.postfix +.endif + .if !defined(SENDMAIL_MILTER_IN_BASE) .if defined(SENDMAIL_WITH_SHARED_MILTER) LIB_DEPENDS+= milter.3:${PORTSDIR}/mail/${SENDMAIL_MILTER_PORT} @@ -28,7 +41,7 @@ SENDMAIL_MILTER_PORT?= sendmail SUB_FILES= milter-dkim.sh WCONF= ${WRKSRC}/devtools/Site MAN8= dkim-filter.8 -PLIST_FILES= libexec/dkim-filter sbin/gentxt +PLIST_FILES= lib/libar.a libexec/dkim-filter sbin/gentxt PORTDOCS= FEATURES INSTALL KNOWNBUGS LICENSE README RELEASE_NOTES \ autorespond.csh @@ -74,6 +87,7 @@ post-install: ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} .endfor .endif + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/mail/dkim-milter/distinfo b/mail/dkim-milter/distinfo index 5c5be39e215f..7a7788223868 100644 --- a/mail/dkim-milter/distinfo +++ b/mail/dkim-milter/distinfo @@ -1,3 +1,3 @@ -MD5 (dkim-milter-0.5.1.tar.gz) = f42599642ab230a89bdb69bdd8453dda -SHA256 (dkim-milter-0.5.1.tar.gz) = 03053781e0b1a7b056dd54660aa14c1903f5999fec1bb87e4b75b62a0c8e27d0 -SIZE (dkim-milter-0.5.1.tar.gz) = 406286 +MD5 (dkim-milter-0.5.2.tar.gz) = 9118cd6b280cd17ad82d43f3b4b51065 +SHA256 (dkim-milter-0.5.2.tar.gz) = d0a62b93a52b893daa545f05d34cc46c28f6b37e70cc6bf4eec3f44630ac6de9 +SIZE (dkim-milter-0.5.2.tar.gz) = 445510 diff --git a/mail/dkim-milter/files/milter-dkim.sh.in b/mail/dkim-milter/files/milter-dkim.sh.in index 9adfb171f201..28e98c2493d4 100644 --- a/mail/dkim-milter/files/milter-dkim.sh.in +++ b/mail/dkim-milter/files/milter-dkim.sh.in @@ -15,6 +15,7 @@ # # milterdkim_enable (bool): Set to "NO" by default. # Set it to "YES" to enable dkim-milter +# milterdkim_uid (str): Set username to run milter. # milterdkim_profiles (list): Set to "" by default. # Define your profiles here. # milterdkim_socket (str): Path to the milter socket. @@ -30,8 +31,9 @@ # DO NOT CHANGE THESE DEFAULT VALUES HERE # milterdkim_enable=${milterdkim_enable:-"NO"} +milterdkim_uid=${milterdkim_uid:-"dkimfilter"} milterdkim_profiles=${milterdkim_profiles:-} -milterdkim_socket=${milterdkim_socket:-"local:/var/run/dkim-filter"} +milterdkim_socket=${milterdkim_socket:-"local:/var/run/milterdkim/filter"} milterdkim_domain=${milterdkim_domain:-"example.com"} milterdkim_key=${milterdkim_key:-"/var/db/domainkeys/default.key.pem"} milterdkim_selector=${milterdkim_selector:-"default"} @@ -45,17 +47,17 @@ name="milterdkim" rcvar=`set_rcvar` start_precmd="dkim_prepcmd" -stop_postcmd="dkim_prepcmd" +stop_postcmd="dkim_postcmd" command="%%PREFIX%%/libexec/dkim-filter" -_pidprefix="/var/run/dkim-filter" -pidfile="${_pidprefix}.pid" +_piddir="/var/run/milterdkim" +pidfile="${_piddir}/pid" load_rc_config $name if [ -n "$2" ]; then profile="$2" if [ "x${milterdkim_profiles}" != "x" ]; then - pidfile="${_pidprefix}.${profile}.pid" + pidfile="${_piddir}/${profile}.pid" eval milterdkim_enable="\${milterdkim_${profile}_enable:-${milterdkim_enable}}" eval milterdkim_socket="\${milterdkim_${profile}_socket:-}" if [ "x${milterdkim_socket}" = "x" ];then @@ -65,7 +67,7 @@ if [ -n "$2" ]; then eval milterdkim_domain="\${milterdkim_${profile}_domain:-${milterdkim_domain}}" eval milterdkim_key="\${milterdkim_${profile}_key:-${milterdkim_key}}" eval milterdkim_flags="\${milterdkim_${profile}_flags:-${milterdkim_flags}}" - command_args="-l -p ${milterdkim_socket} -P ${pidfile}" + command_args="-l -p ${milterdkim_socket} -u ${milterdkim_uid} -P ${pidfile}" else echo "$0: extra argument ignored" fi @@ -74,7 +76,7 @@ else if [ "x$1" != "xrestart" ]; then for profile in ${milterdkim_profiles}; do echo "===> milterdkim profile: ${profile}" - %%PREFIX%%/etc/rc.d/milter-dkim.sh $1 ${profile} + $0 $1 ${profile} retcode="$?" if [ "0${retcode}" -ne 0 ]; then failed="${profile} (${retcode}) ${failed:-}" @@ -88,7 +90,7 @@ else fi else milterdkim_flags=${milterdkim_flags} - command_args="-l -p ${milterdkim_socket} -P ${pidfile}" + command_args="-l -p ${milterdkim_socket} -u ${milterdkim_uid} -P ${pidfile}" fi fi @@ -99,6 +101,24 @@ dkim_prepcmd () elif [ -S ${milterdkim_socket##unix:} ] ; then rm -f ${milterdkim_socket##unix:} fi + if [ -d ${_piddir} ] ; then + return; + fi + mkdir -p ${_piddir} + if [ -n "${milterdkim_uid}" ] ; then + chown ${milterdkim_uid} ${_piddir} + fi +} + +dkim_postcmd() +{ + if [ -S ${milterdkim_socket##local:} ] ; then + rm -f ${milterdkim_socket##local:} + elif [ -S ${milterdkim_socket##unix:} ] ; then + rm -f ${milterdkim_socket##unix:} + fi + # just if the directory is empty + rmdir ${_piddir} > /dev/null 2>&1 } run_rc_command "$1" diff --git a/mail/dkim-milter/files/patch-libar-Makefile.m4 b/mail/dkim-milter/files/patch-libar-Makefile.m4 deleted file mode 100644 index 7a19358fb1f1..000000000000 --- a/mail/dkim-milter/files/patch-libar-Makefile.m4 +++ /dev/null @@ -1,10 +0,0 @@ ---- libar/Makefile.m4.orig Tue Jul 19 06:18:09 2005 -+++ libar/Makefile.m4 Tue Jan 10 14:57:04 2006 -@@ -11,7 +11,6 @@ - - bldPRODUCT_START(`library', `libar') - define(`bldSOURCES', `ar.c fix.c ') --define(`bldINSTALLABLE', `true') - bldPRODUCT_END - - bldPRODUCT_START(`manpage', `ar') diff --git a/mail/dkim-milter/pkg-install b/mail/dkim-milter/pkg-install new file mode 100644 index 000000000000..763eedcadc1c --- /dev/null +++ b/mail/dkim-milter/pkg-install @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ "$2" != "POST-INSTALL" ] +then + exit 0; +fi + +# check if dkimfilter user exists +pw user show dkimfilter > /dev/null 2>&1 + +if [ $? != 0 ] +then + echo "===> Adding user dkimfilter" + pw useradd dkimfilter -c "milter-dkim" -s /sbin/nologin \ + -d /nonexistent +else + echo "===> Using existing user dkimfilter" +fi diff --git a/mail/dkim-milter/pkg-message b/mail/dkim-milter/pkg-message index 52b302977dcc..bda6e108405d 100644 --- a/mail/dkim-milter/pkg-message +++ b/mail/dkim-milter/pkg-message @@ -3,7 +3,7 @@ In order to run this port, please add the following lines to /etc/mail/<your_configuration>.mc: -INPUT_MAIL_FILTER(`dkim-filter', `S=unix:/var/run/dkim-filter, F=T, T=R:2m') +INPUT_MAIL_FILTER(`dkim-filter', `S=unix:/var/run/milterdkim/filter, F=T, T=R:2m') define(`confMILTER_MACROS_CONNECT', `j, {daemon_name}') define(`confMILTER_MACROS_ENVFROM', `i, {auth_type}') diff --git a/mail/dkim-milter/pkg-message.postfix b/mail/dkim-milter/pkg-message.postfix new file mode 100644 index 000000000000..9fd8257c205d --- /dev/null +++ b/mail/dkim-milter/pkg-message.postfix @@ -0,0 +1,16 @@ +************************************************************************ + +In order to run this port, please add the following lines to +${PREFIX}/etc/mail/main.cf: + +smtpd_milters = unix:/var/run/milterdkim/filter + +And to run the milter from startup, add milterdkim_enable="YES" in +your /etc/rc.conf. +Extra options can be found in startup script. + +Note: milter sockets must be accessible from postfix/smtpd; + setting milterdkim_user appropriate or using inet sockets might be + required. + +************************************************************************ |