Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Sep 2004 20:48:56 +0700
From:      "Michael O. Boev" <mike@tric.tomsk.gov.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/71466: update port mail/milter-sender to 0.62
Message-ID:  <413DBC48.6080109@tric.tomsk.gov.ru>
Resent-Message-ID: <200409071350.i87DoQPW012946@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         71466
>Category:       ports
>Synopsis:       update port mail/milter-sender
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 07 13:50:26 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Michael O. Boev
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
Tomsk Regional Information Center
>Environment:
System: FreeBSD isrv.tric.ru 4.10-RELEASE FreeBSD 4.10-RELEASE #3: Fri May 28 14:45:40 NOVST 2004 root@isrv.tric.ru:/usr/obj/usr/src/sys/ISRV i386


>Description:
	Update mail/milter-sender to 0.62.
	new features:
	1) Change default cache format from bdb to flatfile to prevent crashes
	2) rc.subr(8)-ified script
	
	Also, I've no objections on becoming a new maintainer of this port.

>How-To-Repeat:
	
>Fix:
diff -ruN milter-sender.orig/Makefile milter-sender/Makefile
--- milter-sender.orig/Makefile	Tue Aug 24 03:37:30 2004
+++ milter-sender/Makefile	Tue Sep  7 18:58:55 2004
@@ -6,10 +6,10 @@
  #

  PORTNAME=	milter-sender
-PORTVERSION=	0.61
+PORTVERSION=	0.62
  CATEGORIES=	mail
  MASTER_SITES=	http://www.snert.com/Software/download/
-DISTFILES=	libsnert-1.39.tgz milter-sender-${PORTVERSION}.tgz
+DISTFILES=	libsnert-1.40.tgz milter-sender-${PORTVERSION}.tgz

  MAINTAINER=	ports@FreeBSD.org
  COMMENT=	Real-time sender address verification, based on Milter API
@@ -43,13 +43,22 @@

  CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
  CONFIGURE_ENV+=	LDFLAGS="${LDFLAGS}"
-CONFIGURE_ARGS+=--with-db --localstatedir=/var/spool \
+CONFIGURE_ARGS+=--with-db --localstatedir=/var/spool --enable-cache=flatfile \
  		--enable-milter-cf="${PREFIX}/etc/milter-sender.cf"
+.if !defined(WITH_DEBUG)
+CONFIGURE_ARGS+=--disable-debug
+.endif
+
+USE_RC_SUBR=	yes
+RC_SCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} NAME=milter_sender
+
+post-extract:
+	${SED}	${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+		${FILESDIR}/milter-sender.sh > ${WRKSRC}/milter-sender.sh.freebsd

  post-patch:
  .if ( ${OSVERSION} < 440000 ) # please contact vs@ if in doubt
  	${REINPLACE_CMD} 's/xargs -J{}/gxargs -i{}/' ${WRKSRC}/../lib/configure
-	${REINPLACE_CMD} 's+/usr/sbin/daemon -f ++' ${WRKSRC}/milter-sender.sh.in
  .endif
  	${REINPLACE_CMD} "s,-fvolatile,," ${WRKSRC}/configure

diff -ruN milter-sender.orig/distinfo milter-sender/distinfo
--- milter-sender.orig/distinfo	Tue Aug 24 03:37:30 2004
+++ milter-sender/distinfo	Tue Sep  7 13:52:15 2004
@@ -1,4 +1,4 @@
-MD5 (libsnert-1.39.tgz) = 3017eaaa62c1c9f321f4d323dbb01c7e
-SIZE (libsnert-1.39.tgz) = 299689
-MD5 (milter-sender-0.61.tgz) = da277e57d858a37aaa8ba850e34cd498
-SIZE (milter-sender-0.61.tgz) = 263998
+MD5 (libsnert-1.40.tgz) = ee97d93f06304a87f54f1caf994cc91b
+SIZE (libsnert-1.40.tgz) = 307456
+MD5 (milter-sender-0.62.tgz) = 0717f2cf3387d993054c43633b21fc6e
+SIZE (milter-sender-0.62.tgz) = 239890
diff -ruN milter-sender.orig/files/milter-sender.sh milter-sender/files/milter-sender.sh
--- milter-sender.orig/files/milter-sender.sh	Thu Jan  1 07:00:00 1970
+++ milter-sender/files/milter-sender.sh	Tue Sep  7 20:47:56 2004
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: %%NAME%%
+# REQUIRE: syslogd
+# BEFORE:  sendmail
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable milter-sender:
+#
+#%%NAME%%_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name=%%NAME%%
+rcvar=`set_rcvar`
+
+# set defaults
+%%NAME%%_enable=${%%NAME%%_enable:-"NO"}
+%%NAME%%_chdir="/var/spool/milter-sender"
+%%NAME%%_pidfile=${%%NAME%%_pidfile:-"$%%NAME%%_chdir/pid"}
+%%NAME%%_flags=${%%NAME%%_flags:-"unix:$%%NAME%%_chdir/socket"}
+
+command=%%PREFIX%%/sbin/milter-sender
+required_dirs="$%%NAME%%_chdir"
+
+start_cmd=start_cmd
+start_cmd()
+{
+    if [ -s "$%%NAME%%_chdir/mutex" ]; then
+	ipcrm -s `cat $%%NAME%%_chdir/mutex`
+    fi
+    rm -f $%%NAME%%_chdir/{mutex,socket} $%%NAME%%_pidfile
+    cd $%%NAME%%_chdir && $command $%%NAME%%_flags >/dev/null &
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -ruN milter-sender.orig/files/patch-aa milter-sender/files/patch-aa
--- milter-sender.orig/files/patch-aa	Fri Jun 18 03:30:36 2004
+++ milter-sender/files/patch-aa	Tue Sep  7 18:39:00 2004
@@ -1,6 +1,6 @@
  --- configure.orig	Fri Jun 11 20:37:06 2004
  +++ configure	Wed Jun 16 13:43:31 2004
-@@ -1617,7 +1617,7 @@
+@@ -1647,7 +1647,7 @@
   	COMPILE='$(CC) $(CFLAGS) $(CC_O)$*$O -c $<'

   	# Assume GCC.
diff -ruN milter-sender.orig/files/patch-ab milter-sender/files/patch-ab
--- milter-sender.orig/files/patch-ab	Fri Jun 18 03:30:36 2004
+++ milter-sender/files/patch-ab	Tue Sep  7 20:45:49 2004
@@ -1,24 +1,18 @@
---- install.sh.in.orig	Sun May 30 11:26:05 2004
-+++ install.sh.in	Wed Jun 16 13:50:22 2004
-@@ -18,62 +18,22 @@
- MAILDIR="@with_sendmail@"
- MILTER_CF="@milter_cf@"
-
--if [ ! -d ${STATEDIR} ]; then
--	mkdir -p ${STATEDIR}
--fi
--chown ${USER} ${STATEDIR}
--chgrp ${GROUP} ${STATEDIR}
-+install -d -o ${USER} -g ${GROUP} -m 755 ${STATEDIR}
+--- install.sh.in.orig	Wed Aug 25 17:35:08 2004
++++ install.sh.in	Tue Sep  7 14:25:25 2004
+@@ -25,62 +25,27 @@
+ chgrp ${GROUP} ${STATEDIR}

   RC="${STARTUP_DIR}/${MILTER}${STARTUP_EXT}"
--if [ ! -f $RC ]; then
++${BSD_INSTALL_SCRIPT} ${MILTER}.sh.freebsd ${RC}.sample
+ if [ ! -f $RC ]; then
  -	cp ${MILTER}.sh $RC
  -	chmod 540 $RC
-+${BSD_INSTALL_SCRIPT} ${MILTER}.sh $RC.sample
-+[ ! -f $RC ] && cp $RC.sample $RC
-
+-
  -	case `uname -s` in
+-	FreeBSD)
+-		${BSD_INSTALL_PROGRAM} ${MILTER} ${SBINDIR}
+-		;;
  -	Linux*)
  -		which chkconfig
  -		if test $? -eq 0; then	
@@ -26,8 +20,7 @@
  -		else
  -			# Probably a stupid Debian system.
  -			cd ${STARTUP_DIR}
-+${BSD_INSTALL_PROGRAM} ${MILTER} ${SBINDIR}
-
+-
  -			# Create relative links
  -			cd ../rc0.d
  -			ln -s ../init.d/${MILTER} K20${MILTER}
@@ -35,9 +28,7 @@
  -			ln -s ../init.d/${MILTER} K20${MILTER}
  -			cd ../rc6.d
  -			ln -s ../init.d/${MILTER} K20${MILTER}
-+${BSD_INSTALL_DATA} ${MILTER}.mc ${MAILDIR}/${MILTER}.mc.sample
-+[ ! -f ${MAILDIR}/${MILTER}.mc ] && cp ${MAILDIR}/${MILTER}.mc.sample ${MAILDIR}/${MILTER}.mc
-
+-
  -			# Assume S20sendmail or higher.
  -			cd ../rc2.d
  -			ln -s ../init.d/${MILTER} S18${MILTER}
@@ -55,21 +46,32 @@
  -		ln -s $RC /etc/rcS.d/K30${MILTER}
  -		;;
  -	esac
--fi
-+./milter-sender help=1 | sed 's|^MilterSocket=.*|MilterSocket=unix:/var/spool/milter-sender/socket|' >${MILTER_CF}.sample
-+[ ! -f ${MILTER_CF} ] && cp ${MILTER_CF}.sample ${MILTER_CF}
++	cp ${RC}.sample $RC
+ fi

  -cp -f ${MILTER} ${SBINDIR}
  -chmod 550 ${SBINDIR}/${MILTER}
--
++${BSD_INSTALL_PROGRAM} ${MILTER} ${SBINDIR}
+
  -cp -f ${MILTER}.mc ${MAILDIR}/${MILTER}.mc.sample
--
++MILTER_MC=${MAILDIR}/${MILTER}.mc
++${BSD_INSTALL_DATA} ${MILTER}.mc ${MILTER_MC}.sample
++if [ ! -f $MILTER_MC ]; then
++	cp ${MILTER_MC}.sample ${MILTER_MC}
++fi
+
+ # Save the default configuration.
  -./milter-sender help=1 >${MILTER_CF}.sample
--
--chmod g+r ${MAILDIR} ${MAILDIR}/access.* ${MAILDIR}/aliases.* ${MILTER_CF}.sample*
++./milter-sender help=1 | sed "s|^MilterSocket=.*|MilterSocket=unix:$STATEDIR/socket|">${MILTER_CF}.sample
+
+ # Save the existing configuration with any new additions.
+-./milter-sender help=2 >${MILTER_CF}.new
++./milter-sender help=2 | sed "s|^MilterSocket=.*|MilterSocket=unix:$STATEDIR/socket|">${MILTER_CF}.new
+
  -chgrp ${GROUP} ${MAILDIR} ${MAILDIR}/access.* ${MAILDIR}/aliases.* ${MILTER_CF}.sample*
-+chgrp ${GROUP} ${MAILDIR}/access.db ${MAILDIR}/aliases.db ${MILTER_CF} ${MILTER_CF}.sample
-+chmod g+r ${MAILDIR}/access.db ${MAILDIR}/aliases.db ${MILTER_CF} ${MILTER_CF}.sample
+-chmod g+r ${MAILDIR} ${MAILDIR}/access.* ${MAILDIR}/aliases.* ${MILTER_CF}.sample*
++chgrp ${GROUP} ${MAILDIR}/access.db ${MAILDIR}/aliases.db ${MILTER_CF}.new ${MILTER_CF}.sample
++chmod g+r ${MAILDIR}/access.db ${MAILDIR}/aliases.db ${MILTER_CF}.new ${MILTER_CF}.sample

   echo '***************************************************************'
   echo
diff -ruN milter-sender.orig/files/patch-ac milter-sender/files/patch-ac
--- milter-sender.orig/files/patch-ac	Tue Aug 24 03:37:30 2004
+++ milter-sender/files/patch-ac	Thu Jan  1 07:00:00 1970
@@ -1,72 +0,0 @@
---- milter-sender.sh.in.orig	Thu Aug 12 09:44:49 2004
-+++ milter-sender.sh.in	Mon Aug 23 10:45:57 2004
-@@ -88,35 +88,25 @@
- 	rm -f $STATE_DIR/mutex
-
- 	NAME=`basename "$PROGRAM"`
--        printf "Starting %s" $NAME
-
- 	pid=`getpid "$PROGRAM"`
- 	if [ X"$pid" != X ]; then
--		printf '\r\033[71C['${FG_RED}'FAILED'${FG_NORMAL}']\n'
-+ 		echo " milter-sender:FAILED"
- 		return
- 	fi
-
- 	# Make sure the old socket has been removed, especially for FreeBSD.
- 	rm -f ${STATE_DIR}/socket
- 	
--	# Start the program in the background from a sub-shell
--	# so that process will appear in the ps output immediately.
--	sh -c "$PROGRAM $OPTIONS &"
--
--	pid=`getpid "$PROGRAM"`
--	if [ X"$pid" = X ]; then
--		printf '\r\033[71C['${FG_RED}'FAILED'${FG_NORMAL}']\n'
--		return
--	fi
--
--	printf '\r\033[71C['${FG_GREEN}'  OK  '${FG_NORMAL}']\n'
-+ 	cd $STATE_DIR && /usr/sbin/daemon -f $PROGRAM $OPTIONS &
-+
-+ 	echo -n " milter-sender"
- }
-
- unalias stop
- stop()
- {
- 	NAME=`basename "$PROGRAM"`
--        printf "Stopping %s" $NAME
-
- 	pid=`getpid "$PROGRAM"`
- 	if [ X"$pid" != X ]; then
-@@ -133,7 +123,7 @@
- 			
- 			pid=`getpid "$PROGRAM"`
- 			if [ X"$pid" != X ]; then					
--				printf '\r\033[71C['${FG_RED}'FAILED'${FG_NORMAL}']\n'
-+				echo " milter-sender:FAILED"
- 				return
- 			fi
- 			
-@@ -152,7 +142,7 @@
- 		fi
- 	fi
-
--	printf '\r\033[71C['${FG_GREEN}'  OK  '${FG_NORMAL}']\n'
-+	echo -n " milter-sender"
- }
-
- case "$1" in
-@@ -183,9 +173,9 @@
- status)
- 	pid=`getpid "$PROGRAM"`
- 	if [ X"$pid" != X ]; then
--		printf '\r\033[72C['${FG_GREEN}${pid}${FG_NORMAL}']\n'
-+		echo "milter-sender:${pid}"
- 	else
--		printf '\r\033[70C['${FG_RED}'STOPPED'${FG_NORMAL}']\n'
-+		echo "milter-sender:STOPPED"
- 	fi
- 	;;
- *)
diff -ruN milter-sender.orig/pkg-message milter-sender/pkg-message
--- milter-sender.orig/pkg-message	Sat Jun  5 03:35:12 2004
+++ milter-sender/pkg-message	Tue Sep  7 19:10:02 2004
@@ -8,4 +8,14 @@
  Don't forget to remake and reinstall the sendmail configuration file
  after modifying YOUR-CONF.mc.

+IMPORTANT NOTE for those updating from older releases:
+
+The default cachefile format has changed from bdb to flatfile, because
+the author has observed instabilities and cache corruption problems in
+milter-sender with the version of BerkeleyDB used in base FreeBSD.
+
+So, if one has observed such behaviour before, or just for the sake
+of stability, he should change the CacheType= setting to flatfile in
+milter-sender.cf and move the old cache file away.
+
  ************************************************************************
diff -ruN milter-sender.orig/pkg-plist milter-sender/pkg-plist
--- milter-sender.orig/pkg-plist	Tue Aug 24 03:37:30 2004
+++ milter-sender/pkg-plist	Tue Sep  7 19:40:48 2004
@@ -1,4 +1,5 @@
  @unexec if [ -f %D/etc/milter-sender.cf ] && cmp -s %D/etc/milter-sender.cf %D/etc/milter-sender.cf.sample; then rm -f %D/etc/milter-sender.cf; fi
+etc/milter-sender.cf.new
  etc/milter-sender.cf.sample
  @exec if [ ! -f %D/etc/milter-sender.cf ] ; then cp -p %D/%F %B/milter-sender.cf; fi
  @unexec if [ -f %D/etc/rc.d/milter-sender.sh ] && cmp -s %D/etc/rc.d/milter-sender.sh %D/etc/rc.d/milter-sender.sh.sample; then rm -f %D/etc/rc.d/milter-sender.sh; fi
@@ -6,7 +7,7 @@
  @exec if [ ! -f %D/etc/rc.d/milter-sender.sh ] ; then cp %D/%F %B/milter-sender.sh; fi
  sbin/milter-sender
  @exec install -d -o smmsp -g smmsp -m 755 /var/spool/milter-sender
-@unexec rm -rf /var/spool/milter-sender
+@unexec rm -rf /var/spool/milter-sender 2>&1 >/dev/null || true
  %%PORTDOCS%%%%DOCSDIR%%/CHANGES.TXT
  %%PORTDOCS%%%%DOCSDIR%%/Img/bg.gif
  %%PORTDOCS%%%%DOCSDIR%%/Img/dilbert2003071742312.gif

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?413DBC48.6080109>