Bug 103404 - [update][maintainer] mail/dkim-milter update to 0.5.2
Summary: [update][maintainer] mail/dkim-milter update to 0.5.2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-19 18:00 UTC by Hirohisa Yamaguchi
Modified: 2006-09-24 18:10 UTC (History)
0 users

See Also:


Attachments
file.diff (3.14 KB, patch)
2006-09-19 18:00 UTC, Hirohisa Yamaguchi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hirohisa Yamaguchi 2006-09-19 18:00:35 UTC
	The new version of mail/dkim-milter has been released.
	Release note: http://sourceforge.net/project/shownotes.php?group_id=139420&release_id=448359

	This is a bug-fix release.
	My patch contains support for mail/postfix (2.3.x) milter.

Fix: My patch follows.

	files/patch-libar-Makefile.m4 needs to be removed.
	There's a new file pkg-message.postfix
How-To-Repeat: 	N/A
Comment 1 Hirohisa Yamaguchi 2006-09-23 14:19:09 UTC
Here I merged the patch with another patch I sent as ports/103417.


diff -Npru ports.orig/mail/dkim-milter/Makefile ports/mail/dkim-milter/Makefile
--- ports.orig/mail/dkim-milter/Makefile	Wed Aug  2 11:47:05 2006
+++ ports/mail/dkim-milter/Makefile	Sat Sep 23 20:53:11 2006
@@ -4,9 +4,16 @@
 #
 # $FreeBSD: ports/mail/dkim-milter/Makefile,v 1.7 2006/08/02 02:47:05 clsung Exp $
 #
+## 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}
@@ -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 -Npru ports.orig/mail/dkim-milter/distinfo ports/mail/dkim-milter/distinfo
--- ports.orig/mail/dkim-milter/distinfo	Wed Aug  2 11:47:05 2006
+++ ports/mail/dkim-milter/distinfo	Sat Sep 23 20:53:11 2006
@@ -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 -Npru ports.orig/mail/dkim-milter/files/milter-dkim.sh.in ports/mail/dkim-milter/files/milter-dkim.sh.in
--- ports.orig/mail/dkim-milter/files/milter-dkim.sh.in	Tue May  2 00:05:44 2006
+++ ports/mail/dkim-milter/files/milter-dkim.sh.in	Sat Sep 23 22:09:26 2006
@@ -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 -Npru ports.orig/mail/dkim-milter/files/patch-libar-Makefile.m4 ports/mail/dkim-milter/files/patch-libar-Makefile.m4
--- ports.orig/mail/dkim-milter/files/patch-libar-Makefile.m4	Wed Jan 11 22:50:22 2006
+++ ports/mail/dkim-milter/files/patch-libar-Makefile.m4	Thu Jan  1 09:00:00 1970
@@ -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 -Npru ports.orig/mail/dkim-milter/pkg-install ports/mail/dkim-milter/pkg-install
--- ports.orig/mail/dkim-milter/pkg-install	Thu Jan  1 09:00:00 1970
+++ ports/mail/dkim-milter/pkg-install	Sat Sep 23 20:53:08 2006
@@ -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 -Npru ports.orig/mail/dkim-milter/pkg-message ports/mail/dkim-milter/pkg-message
--- ports.orig/mail/dkim-milter/pkg-message	Tue Jan 17 22:55:55 2006
+++ ports/mail/dkim-milter/pkg-message	Sat Sep 23 22:06:52 2006
@@ -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 -Npru ports.orig/mail/dkim-milter/pkg-message.postfix ports/mail/dkim-milter/pkg-message.postfix
--- ports.orig/mail/dkim-milter/pkg-message.postfix	Thu Jan  1 09:00:00 1970
+++ ports/mail/dkim-milter/pkg-message.postfix	Sat Sep 23 22:07:04 2006
@@ -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.
+
+************************************************************************
Comment 2 dfilter service freebsd_committer 2006-09-24 18:01:21 UTC
pav         2006-09-24 17:01:15 UTC

  FreeBSD ports repository

  Modified files:
    mail/dkim-milter     Makefile distinfo pkg-message 
    mail/dkim-milter/files milter-dkim.sh.in 
  Added files:
    mail/dkim-milter     pkg-install pkg-message.postfix 
  Removed files:
    mail/dkim-milter/files patch-libar-Makefile.m4 
  Log:
  - 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)
  
  Revision  Changes    Path
  1.8       +16 -2     ports/mail/dkim-milter/Makefile
  1.6       +3 -3      ports/mail/dkim-milter/distinfo
  1.4       +29 -9     ports/mail/dkim-milter/files/milter-dkim.sh.in
  1.2       +0 -10     ports/mail/dkim-milter/files/patch-libar-Makefile.m4 (dead)
  1.1       +18 -0     ports/mail/dkim-milter/pkg-install (new)
  1.3       +1 -1      ports/mail/dkim-milter/pkg-message
  1.1       +16 -0     ports/mail/dkim-milter/pkg-message.postfix (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Pav Lucistnik freebsd_committer 2006-09-24 18:01:37 UTC
State Changed
From-To: open->closed

Committed, thanks!