ports/121840: [patch] Proposed update to mail/dcc-dccd port

Craig Green cgreen at sentex.net
Tue Mar 18 20:40:01 UTC 2008


>Number:         121840
>Category:       ports
>Synopsis:       [patch] Proposed update to mail/dcc-dccd port
>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 Mar 18 20:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Craig Green
>Release:        RELENG_6
>Organization:
Sentex
>Environment:
N/A
>Description:
This is a proposed update to the mail/dcc-dccd port, both updating the port to the latest DCC release version, 1.3.86 (the current port is stuck at 1.3.50), as well as improving it with the addition of several configuration options.

This work has been done over the last couple of weeks with the intention of assuming the DCC port maintainership, with support and assistance from both Vernon Schryver, DCC's developer, and Michael Scheidell, the current FreeBSD port maintainer of SpamAssassin.


During the course of discussions with Vernon, we were able to sort out a compilation issue on RELENG_7, as well as have implemented a couple of changes to DCC itself for improved compatibility with FreeBSD's ports tree.  These changes are reflected in the updated port, and are detailed below.


The current port is monolithic, compiling and installing all DCC's modules regardless of what the admin will be using DCC for.  For clarity, the DCC package includes the following modules: the DCC server, dccd; the DCC greylisting server, dccd-grey; the DCC Sendmail milter, dccm; and the DCC client interface daemon, dccifd.

Of the four, dccifd is probably the most commonly used as it is the interface that SpamAssassin preferentially uses to communicate with DCC.  Postfix can also use it as a before-queue filter.

The DCC server itself is likely the least used, as most installations will use the public DCC servers instead.  Even if the DCC server is run, the site will likely have a single server providing service to multiple clients.  As such, both security and simple space concerns would dictate that the DCC server only be compiled and installed on boxes where it will actually be used.

With this in mind, the updated port uses Port's Options capability to allow admins to selectively enable and disable the installation of the individual DCC modules.  This was fairly easy to implement as DCC's configure already had such underlying options available.

To support the installation of the individual modules, rcNG scripts were created for each of dccd, dccd-grey, dccm and dccifd.  DCC supplies its own startup script, rcDCC, which carries out various checks and sets up the environment for the daemons.  Prior, rcDCC would simply automatically start up all DCC daemons, but one of the enhancements that Vernon implemented was the ability to tell rcDCC which daemon to act upon.  The rcNG scripts use this to have the daemons start up in the manner the daemons expect, but still within the standard rcNG framework and ultimately controlled through the usual *_enable="YES" entries in /etc/rc.conf.

The other enhancement to DCC was the addition of an optional suffix for installed configuration files.  This functionality allows the removal of the Ports tree patch that essentially did the same thing.  The configuration files are now installed with the usual .sample extension, and again if the actual configuration file isn't present.  For example, on a new installation, dcc_conf is installed as both dcc_conf and dcc_conf.sample, but on an update/reinstall where dcc_conf as previously been modified by the admin (and thus was preserved on deinstall), the updated dcc_conf will only be installed as dcc_conf.sample.

The current port's ability to compile dccm against either a base or ports Sendmail has been preserved, but was added to the Options screen to make it easy for admins to select.  Appropriate warnings are issued (via INGORE=) if the selected options don't make sense (e.g. if dccm is selected for installation but neither a base nor ports milter library can be found, or if compilation against ports is selected by a ports Sendmail hasn't been installed).


As per a suggestion by Michael Scheidell, the ability to change DCC's home directory has been added.  DCC is relatively inflexible about where some of its files are located; client maps and other status info shared between the DCC modules must be located in the same directory as DCC's config files, which is DCC's homedir. The same goes for dccd's and dccd-grey's databases.  As expected, the standard DCC homedir on FreeBSD is /usr/local/dcc, but since the status and database files are written in this directory, this means that /usr cannot be mounted read-only, a concern for some admins.

The libexec and cgi-bin programs, though, have their own directories which can be manipulated via configure.  Using this, DCC's homedir can be set to /var/dcc (which is actually DCC's default homedir), while libexec and cgi-bin can be put in /usr/local/dcc/libexec and /usr/local/dcc/cgi-bin respectively.

While this allows the read-only parts to be in /usr and the writable parts to be in /var, it's not perfect in that DCC config files are also now in /var, and rather far away from the expected etc directory.  To help ameliorate this, a soft link could be created between /usr/local/etc/dcc and /var/dcc, so at least the config files would appear to be in /usr/local/etc.  The port does not do this automatically, though obviously it could if so desired.

The port default is, of course, the same as the current port, with everything in /usr/local/dcc.  The alternate home option gives those admins who might need it more flexibility.  The option is described in detail within Makefile comments.


Since DCC supports it, the last minor change is to expose an option to disable IPv6 support.


At Vernon's request, I've also updated the Master Sites list, and the name of tarball fetched (dcc-dccd is a legacy name; it's just dcc now).


To eat my own dogfood, I'm current running the new port on RELENG_6 i386, RELENG_6 AMD64, and RELENG_7 i386 boxes.


As this is my first attempt at a port--and a PR for that matter--any comments or criticisms would be appreciated.

I've probably generated the attached patch incorrectly (though 'cd /usr/ports/mail; path -p0 -E < /path/to/patch' works for me); gentle applications of a clue-stick welcome.

If worst comes to worst, a tarball of the updated port is available at:

http://www.sentex.ca/freebsd/ports/dcc-dccd/dcc-dccd-port-1.3.86.tar.gz


Cheers,

Craig.
------


Removed files:

files/dcc-start.sh.in
files/patch-configure
files/patch-homedir::Makefile.in

Added files:

files/dccd.sh.in
files/dccgrey.sh.in
files/dccifd.sh.in
files/dccm.sh.in
files/pkg-message.in
>How-To-Repeat:
N/A
>Fix:
N/A

Patch attached with submission follows:

diff -bBruN /tmp/dcc-dccd/Makefile dcc-dccd/Makefile
--- /tmp/dcc-dccd/Makefile	2007-11-13 23:01:22.000000000 -0500
+++ dcc-dccd/Makefile	2008-03-18 13:33:38.000000000 -0400
@@ -6,15 +6,18 @@
 #
 
 PORTNAME=	dcc-dccd
-PORTVERSION=	1.3.50
-PORTREVISION=	1
+PORTVERSION=	1.3.86
+PORTREVISION=	0
 CATEGORIES=	mail
-MASTER_SITES=	http://www.rhyolite.com/anti-spam/dcc/source/ \
-		http://www.wa.apana.org.au/~dean/sources/
+MASTER_SITES=	http://www.dcc-servers.net/dcc/source/old/ \
+		http://www.rhyolite.com/anti-spam/dcc/source/old/ \
+		ftp://ftp.dcc-servers.net/src/dcc/old/ \
+		ftp://ftp.rhyolite.com/src/dcc/old/
+DISTNAME=	dcc-1.3.86
 EXTRACT_SUFX=	.tar.Z
 
 MAINTAINER=	dean at odyssey.apana.org.au
-COMMENT=	Distributed Checksum Clearinghouse procmail, sendmail support
+COMMENT=	Distributed Checksum Clearinghouse bulk email detector
 
 HAS_CONFIGURE=	yes
 MANCOMPRESSED=	yes
@@ -24,45 +27,89 @@
 PKGINSTALL=	${WRKDIR}/pkg-install
 PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
 
-USE_RC_SUBR=	dcc-start.sh
+USE_RC_SUBR=
 
 #
-# User for dcc files and SUID binaries
+# ALT_HOME -	DCC keeps its config files in its home direcotry but writes 
+#		status and database files there as well.  This latter point 
+#		means that the FreeBSD default home directory for DCC, 
+#		/usr/local/dcc, cannot be mounted read-only.
+#
+#		DCC's default home dir is /var/dcc breaks FreeBSD hierarchy
+#		conventions, but allows for a read-only /usr.
+#
+#		Setting ALT_HOME on will set DCC's home to /var/dcc, but
+#		keep its binaries in /usr/local/dcc/libexec.  Since this
+#		also means DCC's config files will be in /var/dcc, for 
+#		convenience a soft link from /usr/local/etc/dcc to /var/dcc 
+#		may be created.
+#
+#		Note also that dccifd's default socket location is DCC's
+#		home, so if /var/dcc is used for the home, then programs
+#		like SpamAssassin may need to be explicitly told where
+#		to find dccifd's socket.
+#
+OPTIONS=	DCCIFD	"DCC interface daemon (for SpamAssassin etc)"	on \
+		DCCM	"DCC milter (for Sendmail only)"	off \
+		DCCD	"DCC server"	off \
+		DCCGREY	"DCC greylisting server"	off \
+		IPV6	"IPv6 support"	on  \
+		ALT_HOME	"DCC home in /var/dcc"	off \
+		PORTS_SENDMAIL	"Use base Sendmail if off, ports if on"	off 
+
+
+
+## User for DCC files and SUID binaries
 #
 DCCUSER?=	dcc
 DCCUID?=	112
 DCCGROUP?=	dcc
 DCCGID?=	112
 
-#
-# Use configure script to set locations of all files. Use of
-# sed scripting breaks things.
-#
 
-CONFIGURE_ARGS=	--homedir=${PREFIX}/dcc --bindir=${PREFIX}/bin --mandir=${MANPREFIX}/man --with-rundir=/var/run/dcc
+## Use the configure script to explicitly set the locations of all files, 
+## in case the standard locations have been locally overridden
+#
+CONFIGURE_ARGS=	--with-uid=${DCCUSER} --bindir=${PREFIX}/bin --mandir=${MANPREFIX}/man --with-configsuffix=.sample
 
 .include <bsd.port.pre.mk>
 
-.if !defined(WITH_SENDMAIL_BASE) && !defined(WITH_SENDMAIL_PORT) && !exists(${LOCALBASE}/lib/libmilter.a)
-WITH_SENDMAIL_BASE=yes
-.endif
+SUB_FILES=		pkg-message
+SUB_LIST+=		WRKSRC=${WRKSRC}
 
-.if defined(WITH_SENDMAIL_BASE)
-.if exists(/usr/lib/libmilter.a)
-MILTERBASE=	/usr
-WITH_SENDMAIL=	yes
+## /var/dcc home support
+#
+.if defined(WITH_ALT_HOME)
+CONFIGURE_ARGS+=	--homedir=/var/dcc --libexecdir=${PREFIX}/dcc/libexec --with-cgibin=${PREFIX}/dcc/cgi-bin
+SUB_LIST+=		DCCHOME=/var/dcc
+PLIST_SUB+=		WITH_ALT_HOME=""
 .else
-.if !defined(WITHOUT_SENDMAIL)
-IGNORE=		base system sendmail not found or too old, rebuild with WITH_SENDMAIL_PORT=yes or WITHOUT_SENDMAIL=yes
+CONFIGURE_ARGS+=	--homedir=${PREFIX}/dcc
+SUB_LIST+=		DCCHOME=${PREFIX}/dcc
+PLIST_SUB+=		WITH_ALT_HOME="@comment "
 .endif
+
+## dccm milter support
+#
+.if defined(WITH_DCCM)
+
+.if !exists(/usr/lib/libmilter.a) && !exists(${LOCALBASE}/lib/libmilter.a)
+IGNORE=		Neither base system nor Ports version of Sendmail installed, cannot build milter
+.endif
+.if defined(WITHOUT_PORTS_SENDMAIL) && !exists(/usr/lib/libmilter.a)
+IGNORE=		Base system Sendmail not found or too old, rebuild with WITH_PORTS_SENDMAIL=yes or WITHOUT_DCCM=yes
 .endif
+.if defined(WITH_PORTS_SENDMAIL) && !exists(${LOCALBASE}/lib/libmilter.a)
+IGNORE=		Ports Sendmail not found, rebuild with WITHOUT_PORTS_SENDMAIL=yes or WITHOUT_DCCM=yes
+.endif
+
+.if defined(WITHOUT_PORTS_SENDMAIL)
+MILTERBASE=	/usr
 .else
 BUILD_DEPENDS+=	${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
 MILTERBASE?=	${LOCALBASE}
-WITH_SENDMAIL=	yes
 .endif
 
-.if !defined(WITHOUT_SENDMAIL) && defined(WITH_SENDMAIL)
 MILTERINC=	${MILTERBASE}/include
 MILTERLIB=	${MILTERBASE}/lib
 
@@ -71,35 +118,73 @@
 
 CONFIGURE_ENV+=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
 CONFIGURE_ARGS+=	--with-sendmail=${MILTERBASE}
-PLIST_SUB+=	WITH_SENDMAIL=""
+
+PLIST_SUB+=	WITH_DCCM=""
+
+USE_RC_SUBR+=	dccm.sh
+
 .else
 CONFIGURE_ARGS+=	--disable-dccm
-PLIST_SUB+=	WITH_SENDMAIL="@comment "
+PLIST_SUB+=	WITH_DCCM="@comment "
 .endif
 
+## dccifd client interface daemon support
+#
 .if defined(WITHOUT_DCCIFD)
 CONFIGURE_ARGS+=	--disable-dccifd
 PLIST_SUB+=	WITH_DCCIFD="@comment "
 .else
 PLIST_SUB+=	WITH_DCCIFD=""
+USE_RC_SUBR+=	dccifd.sh
 .endif
 
-CONFIGURE_ARGS+=	--with-uid=${DCCUSER}
+## dccd server support
+#
+.if defined(WITHOUT_DCCD) && defined(WITHOUT_DCCGREY)
+CONFIGURE_ARGS+=	--disable-server
+PLIST_SUB+=	WITH_DCCD="@comment "
+.else
+PLIST_SUB+=	WITH_DCCD=""
+.endif
+
+## IPV6 support
+#
+.if defined(WITHOUT_IPV6)
+CONFIGURE_ARGS+=	--disable-IPv6
+.endif
 
+
+## Packing list and rcNG script fixups
+#
+.if defined(WITHOUT_DCCIFD) && defined(WITHOUT_DCCM)
+PLIST_SUB+=	WITH_IFD_MILT="@comment "
+.else
+PLIST_SUB+=	WITH_IFD_MILT=""
+.endif
+
+.if defined(WITH_DCCD)
+USE_RC_SUBR+=	dccd.sh
+.endif
+
+.if defined(WITH_DCCGREY)
+USE_RC_SUBR+=	dccgrey.sh
+PLIST_SUB+=	WITH_DCCGREY=""
+.else
+PLIST_SUB+=	WITH_DCCGREY="@comment "
+.endif
+
+## Substitutions in pkg-install and pkg-deinstall
+#
 SED_SCRIPT=	-e 's|%%PREFIX%%|${PREFIX}|g' \
 		-e 's|%%DCCUSER%%|${DCCUSER}|g' -e 's|%%DCCUID%%|${DCCUID}|g' \
-		-e 's|%%DCCGROUP%%|${DCCGROUP}|g' -e 's|%%DCCGID%%|${DCCGID}|g'
+		-e 's|%%DCCGROUP%%|${DCCGROUP}|g' -e 's|%%DCCGID%%|${DCCGID}|g' \
+		-e 's|%%DCCHOME%%|${DCCHOME}|g'
+
 
 pre-everything::
 	@${ECHO_MSG} ' '
-	@${ECHO_MSG} 'You can choose the sendmail to be used by specifying:'
+	@${ECHO_MSG} 'A description of ALT_HOME may be found in the port's Makefile.'
 	@${ECHO_MSG} ' '
-	@${ECHO_MSG} 'WITH_SENDMAIL_BASE=yes'
-	@${ECHO_MSG} 'or'
-	@${ECHO_MSG} 'WITH_SENDMAIL_PORT=yes'
-	@${ECHO_MSG} 'or'
-	@${ECHO_MSG} 'WITHOUT_SENDMAIL=yes'
-	@${ECHO_MSG} ''
 
 post-build:
 	@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL}
@@ -109,4 +194,20 @@
 	@${SETENV} PKG_PREFIX=${PREFIX} \
 	${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
 
+
+post-install:
+
+## Make certain DCC's config files are owned by DCC's user
+#
+.if defined(WITH_ALT_HOME)
+	@${CHOWN} ${DCCUSER} /var/dcc/*
+.else
+	@${CHOWN} ${DCCUSER} ${PREFIX}/dcc/*
+.endif
+
+## Print DCC installation notes and RESTRICTIONS file info
+#
+	@${CAT} ${PKGMESSAGE}
+
+
 .include <bsd.port.post.mk>
diff -bBruN /tmp/dcc-dccd/distinfo dcc-dccd/distinfo
--- /tmp/dcc-dccd/distinfo	2007-03-07 10:20:26.000000000 -0500
+++ dcc-dccd/distinfo	2008-03-18 13:27:53.000000000 -0400
@@ -1,3 +1,3 @@
-MD5 (dcc-dccd-1.3.50.tar.Z) = 4306df4a05d04f926995ddc0c1d480e1
-SHA256 (dcc-dccd-1.3.50.tar.Z) = 942c9be56f3ff765b524e6c49d85dd84aa4a22c1514afe096d34e246cbf6cc21
-SIZE (dcc-dccd-1.3.50.tar.Z) = 1448485
+MD5 (dcc-1.3.86.tar.Z) = 2d6c0ff3b1a7e56e95862a8a74c2d95c
+SHA256 (dcc-1.3.86.tar.Z) = 019b1efd2ac373a982ef2913aaf3629137efcf6623c0664ceccdb14bda5f3441
+SIZE (dcc-1.3.86.tar.Z) = 1514689
diff -bBruN /tmp/dcc-dccd/files/dcc-start.sh.in dcc-dccd/files/dcc-start.sh.in
--- /tmp/dcc-dccd/files/dcc-start.sh.in	2007-11-13 23:01:22.000000000 -0500
+++ dcc-dccd/files/dcc-start.sh.in	1969-12-31 19:00:00.000000000 -0500
@@ -1,57 +0,0 @@
-#!/bin/sh
-#
-# PROVIDE: dccifd
-# REQUIRE: LOGIN
-# BEFORE: mail
-# KEYWORD: shutdown
-
-#
-# Add the following lines to /etc/rc.conf to enable dccifd:
-#
-#dccifd_enable="YES"
-#
-# See dccifd(8) for flags
-#
-
-. %%RC_SUBR%%
-
-name=dccifd
-rcvar=`set_rcvar`
-
-load_rc_config $name
-
-# Set defaults
-: ${dccifd_enable:="NO"}
-: ${dccifd_flags=""}
-: ${dccifd_home="%%PREFIX%%/dcc"}
-: ${dccifd_conf="$dccifd_home/dcc_conf"}
-
-
-pidfile=${dccifd_pidfile:-"/var/run/dcc/dccifd.pid"}
-command="${dccifd_home}/libexec/start-dccifd"
-procname="${dccifd_home}/libexec/dccifd"
-required_dirs="$dccifd_home"
-required_files="${dccifd_conf}"
-
-stop_postcmd="stop_postcmd"
-start_precmd="start_precmd"
-
-
-stop_postcmd()
-{
- rm -f $pidfile
-}
-
-start_precmd()
-{
-X=`grep DCCIFD_ENABLE ${dccifd_conf}`
-eval $X
-if [ "$DCCIFD_ENABLE"  != "on" ]
-then
-	echo "Warning ${X} needs to be on in ${dccifd_conf}"
-	return 1
-fi
-}
-
-run_rc_command "$1"
-
diff -bBruN /tmp/dcc-dccd/files/dccd.sh.in dcc-dccd/files/dccd.sh.in
--- /tmp/dcc-dccd/files/dccd.sh.in	1969-12-31 19:00:00.000000000 -0500
+++ dcc-dccd/files/dccd.sh.in	2008-03-18 12:23:36.000000000 -0400
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+# PROVIDE: dccd
+# REQUIRE: LOGIN
+# BEFORE: mail
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf:
+#
+#dccd_enable="YES"
+#
+# and in %%DCCHOME%%/dcc_conf change:
+#
+#DCCD_ENABLE=off
+#
+# to:
+#
+#DCCD_ENABLE=on
+#
+#
+# See %%DCCHOME%%/dcc_conf to configure startup options
+#
+
+. %%RC_SUBR%%
+
+name=dccd
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+# Set defaults
+: ${dccd_enable:="NO"}
+: ${dccd_home="%%DCCHOME%%"}
+: ${dccd_libexec="%%PREFIX%%/dcc/libexec"}
+: ${dccd_conf="$dccd_home/dcc_conf"}
+
+
+procname="${dccd_libexec}/dccd"
+required_dirs="${dccd_home} ${dccd_libexec}"
+required_files="${dccd_conf} ${dccd_libexec}/rcDCC"
+
+start_cmd="start_dccd"
+stop_cmd="stop_dccd"
+start_precmd="start_precmd"
+
+
+start_precmd()
+{
+X=`grep ^DCCD_ENABLE ${dccd_conf}`
+eval $X
+if [ "$DCCD_ENABLE"  != "on" ]
+then
+	echo "Warning ${X} needs to be on in ${dccd_conf} to start the dccd server"
+	return 1
+fi
+}
+
+start_dccd()
+{
+	echo Starting dccd.
+	${dccd_libexec}/rcDCC -m dccd start
+}
+
+stop_dccd()
+{
+	echo Stopping dccd.
+	${dccd_libexec}/rcDCC -m dccd stop
+}
+
+run_rc_command "$1"
+
diff -bBruN /tmp/dcc-dccd/files/dccgrey.sh.in dcc-dccd/files/dccgrey.sh.in
--- /tmp/dcc-dccd/files/dccgrey.sh.in	1969-12-31 19:00:00.000000000 -0500
+++ dcc-dccd/files/dccgrey.sh.in	2008-03-18 12:23:36.000000000 -0400
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+# PROVIDE: dccgrey
+# REQUIRE: LOGIN
+# BEFORE: mail
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf:
+#
+#dccgrey_enable="YES"
+#
+# and in %%DCCHOME%%/dcc_conf change:
+#
+#GREY_ENABLE=
+#
+# to:
+#
+#GREY_ENABLE=on
+#
+#
+# See %%DCCHOME%%/dcc_conf to configure startup options
+#
+
+. %%RC_SUBR%%
+
+name=dccgrey
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+# Set defaults
+: ${dccgrey_enable:="NO"}
+: ${dccgrey_home="%%DCCHOME%%"}
+: ${dccgrey_libexec="%%PREFIX%%/dcc/libexec"}
+: ${dccgrey_conf="$dccgrey_home/dcc_conf"}
+
+
+procname="${dccgrey_libexec}/dccd"
+required_dirs="${dccgrey_home} ${dccgrey_libexec}"
+required_files="${dccgrey_conf} ${dccgrey_libexec}/rcDCC"
+
+start_cmd="start_dccgrey"
+stop_cmd="stop_dccgrey"
+start_precmd="start_precmd"
+
+
+start_precmd()
+{
+X=`grep ^GREY_ENABLE ${dccgrey_conf}`
+eval $X
+if [ "$GREY_ENABLE" != "on" ]
+then
+	echo "Warning ${X} needs to be on in ${dccgrey_conf} to start the DCC greylisting server"
+	return 1
+fi
+}
+
+start_dccgrey()
+{
+	echo Starting dccgrey.
+	${dccgrey_libexec}/rcDCC -m grey start
+}
+
+stop_dccgrey()
+{
+	echo Stopping dccgrey.
+	${dccgrey_libexec}/rcDCC -m grey stop
+}
+
+run_rc_command "$1"
+
diff -bBruN /tmp/dcc-dccd/files/dccifd.sh.in dcc-dccd/files/dccifd.sh.in
--- /tmp/dcc-dccd/files/dccifd.sh.in	1969-12-31 19:00:00.000000000 -0500
+++ dcc-dccd/files/dccifd.sh.in	2008-03-18 12:23:36.000000000 -0400
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# PROVIDE: dccifd
+# REQUIRE: LOGIN
+# BEFORE: mail
+# KEYWORD: shutdown
+
+#
+# To enable dccifd add the following lines to /etc/rc.conf:
+#
+#dccifd_enable="YES"
+#
+# and in %%DCCHOME%%/dcc_conf change:
+#
+#DCCIFD_ENABLE=off
+#
+# to:
+#
+#DCCIFD_ENABLE=on
+#
+#
+# See %%DCCHOME%%/dcc_conf to configure startup options
+#
+
+. %%RC_SUBR%%
+
+name=dccifd
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+# Set defaults
+: ${dccifd_enable:="NO"}
+: ${dccifd_home="%%DCCHOME%%"}
+: ${dccifd_libexec="%%PREFIX%%/dcc/libexec"}
+: ${dccifd_conf="$dccifd_home/dcc_conf"}
+
+pidfile=${dccifd_pidfile:-"/var/run/dcc/dccifd.pid"}
+procname="${dccifd_libexec}/dccifd"
+required_dirs="${dccifd_home} ${dccifd_libexec}"
+required_files="${dccifd_conf} ${dccifd_libexec}/rcDCC"
+
+start_precmd="start_precmd"
+start_cmd="start_dcc"
+
+start_precmd()
+{
+X=`grep ^DCCIFD_ENABLE ${dccifd_conf}`
+eval $X
+if [ "$DCCIFD_ENABLE"  != "on" ]
+then
+	echo "Warning ${X} needs to be on in ${dccifd_conf} to start dccifd"
+	return 1
+fi
+}
+
+start_dcc()
+{
+	echo Starting dccifd.
+	${dccifd_libexec}/rcDCC -m dccifd start
+}
+
+run_rc_command "$1"
diff -bBruN /tmp/dcc-dccd/files/dccm.sh.in dcc-dccd/files/dccm.sh.in
--- /tmp/dcc-dccd/files/dccm.sh.in	1969-12-31 19:00:00.000000000 -0500
+++ dcc-dccd/files/dccm.sh.in	2008-03-18 12:23:36.000000000 -0400
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# PROVIDE: dccm
+# REQUIRE: LOGIN
+# BEFORE: mail
+# KEYWORD: shutdown
+
+#
+# To enable dccm add the following lines to /etc/rc.conf:
+#
+#dccm_enable="YES"
+#
+# and in %%DCCHOME%%/dcc_conf change:
+#
+#DCCM_ENABLE=off
+#
+# to:
+#
+#DCCM_ENABLE=on
+#
+#
+# See %%DCCHOME%%/dcc_conf to configure startup options
+#
+
+. %%RC_SUBR%%
+
+name=dccm
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+# Set defaults
+: ${dccm_enable:="NO"}
+: ${dccm_home="%%DCCHOME%%"}
+: ${dccm_libexec="%%PREFIX%%/dcc/libexec"}
+: ${dccm_conf="$dccm_home/dcc_conf"}
+
+pidfile=${dccm_pidfile:-"/var/run/dcc/dccm.pid"}
+procname="${dccm_libexec}/dccm"
+required_dirs="${dccm_home} ${dccm_libexec}"
+required_files="${dccm_conf} ${dccm_libexec}/rcDCC"
+
+start_precmd="start_precmd"
+start_cmd="start_dcc"
+
+start_precmd()
+{
+X=`grep ^DCCM_ENABLE ${dccm_conf}`
+eval $X
+if [ "$DCCM_ENABLE"  != "on" ]
+then
+	echo "Warning ${X} needs to be on in ${dccm_conf} to start dccm"
+	return 1
+fi
+}
+
+start_dcc()
+{
+	echo Starting dccm.
+	${dccm_libexec}/rcDCC -m dccm start
+}
+
+run_rc_command "$1"
diff -bBruN /tmp/dcc-dccd/files/patch-configure dcc-dccd/files/patch-configure
--- /tmp/dcc-dccd/files/patch-configure	2005-09-07 18:06:04.000000000 -0400
+++ dcc-dccd/files/patch-configure	1969-12-31 19:00:00.000000000 -0500
@@ -1,25 +0,0 @@
---- configure.orig	Sun Jul 31 18:57:46 2005
-+++ configure	Thu Sep  8 00:02:36 2005
-@@ -998,7 +998,7 @@
- 	;;
-     FreeBSD)
- 	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
--	PTHREAD_LIBS="$PTHREAD_LIBS -lc_r"
-+	PTHREAD_LIBS="$PTHREAD_LIBS"
- 	;;
-     DragonFly)
- 	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
-@@ -2487,6 +2487,13 @@
-     SENDMAIL="$with_sendmail"
-     SENDMAIL_EVAL="$SENDMAIL"
-     with_sendmail=yes
-+fi
-+if test -n "$SENDMAIL" -a "$SENDMAIL" != "no"; then
-+    if test -f $SENDMAIL/include/libmilter/mfapi.h -a -f $SENDMAIL/lib/libmilter.a; then
-+    SENDMAIL_OBJ=$SENDMAIL/lib
-+    SENDMAIL_OBJ_EVAL=$SENDMAIL_OBJ
-+    SENDMAIL_LIB=$SENDMAIL_OBJ/libmilter.a
-+    fi
- fi
- if test -z "$SENDMAIL"; then
-     # prefer a parallel ../sendmail directory
diff -bBruN /tmp/dcc-dccd/files/patch-homedir::Makefile.in dcc-dccd/files/patch-homedir::Makefile.in
--- /tmp/dcc-dccd/files/patch-homedir::Makefile.in	2007-03-07 10:20:26.000000000 -0500
+++ dcc-dccd/files/patch-homedir::Makefile.in	1969-12-31 19:00:00.000000000 -0500
@@ -1,33 +0,0 @@
---- homedir/Makefile.in.orig	Sun Feb 11 09:05:45 2007
-+++ homedir/Makefile.in	Sun Feb 11 09:07:59 2007
-@@ -57,23 +57,19 @@
- 	  $(HINST) -m 755 -d $(DIR); fi
- 	if test ! -d $(DIR)/log; then\
- 	  $(HINST) -m 710 -d $(DIR)/log; fi
--	if test -s $(DIR)/dcc_conf; then\
--	  sh make-dcc_conf -h $(DIR);\
--	else\
--	  $(HINST) -m 644 dcc_conf $(DIR)/dcc_conf;\
--	fi
-+	$(INSTALL) -m 644 dcc_conf $(DIR)/dcc_conf.dist; \
- 	for nm in flod grey_flod whitelist grey_whitelist\
- 		whiteclnt whitecommon; do\
- 	  if test ! -f $(DIR)/$$nm; then\
--		$(HINST) -m 644 $$nm $(DIR)/$$nm; fi; done
-+		$(INSTALL) -m 644 $$nm $(DIR)/$$nm.dist; fi; done
- 	if test ! -f $(DIR)/ids -a ! -f $(DIR)/map -a ! -f $(DIR)/map.txt; then\
- 	  umask 077; PASSWD1=`$(RSTRING)`; PASSWD2=`$(RSTRING)`;\
--	  sed -e "s/secret1/$$PASSWD1/" map.txt >$(DIR)/map.txt;\
-+	  sed -e "s/secret1/$$PASSWD1/" map.txt >$(DIR)/map.txt.dist;\
- 	  sed -e "s/secret1/$$PASSWD1/" -e "s/secret2/$$PASSWD2/" ids\
--		>$(DIR)/ids;\
--	  ${DEPTH}/cdcc/cdcc -qh $(DIR) 'new map; load $(DIR)/map.txt';\
--	  set +e; chown $(DCC_SUID) $(DIR)/map.txt\
--			$(DIR)/map $(DIR)/ids;\
-+		>$(DIR)/ids.dist;\
-+	  ${DEPTH}/cdcc/cdcc -qh $(DIR) 'new map; load $(DIR)/map.txt.dist';\
-+	  set +e; chown $(DCC_SUID) $(DIR)/map.txt.dist\
-+			$(DIR)/map $(DIR)/ids.dist;\
- 	fi
- 
- deinstall:
diff -bBruN /tmp/dcc-dccd/files/pkg-message.in dcc-dccd/files/pkg-message.in
--- /tmp/dcc-dccd/files/pkg-message.in	1969-12-31 19:00:00.000000000 -0500
+++ dcc-dccd/files/pkg-message.in	2008-03-18 12:23:36.000000000 -0400
@@ -0,0 +1,47 @@
+
+==========================================================================
+
+Installation Notes
+------------------
+
+Make certain you edit %%DCCHOME%%/dcc_conf to enable the daemons you 
+wish to run, in addition to adding their respective dcc*_enable="YES" 
+lines to /etc/rc.conf or /etc/rc.conf.local.
+
+Daemon startup flags are also specified in %%DCCHOME%%/dcc_conf.
+
+
+If you run the DCC server, /usr/local/dcc/libexec/cron-dccd should be
+run at least daily from the crontab to clean old checksums from the DB.
+
+
+If your site handles more than 100,000 messages per day, to decrease the
+load on the public DCC servers and increase the responsiveness of your
+DCC clients, you should set up your own, local DCC server connected to 
+the global network of DCC servers.  See: 
+
+http://www.dcc-servers.net/dcc/#local-server
+
+
+==========================================================================
+
+
+DCC Usage Restrictions Notice
+-----------------------------
+
+The free DCC source is available only for non-commercial and some other
+uses.  It is not available to organizations that sell anti-spam appliances
+or provide managed email services as opposed to common Internet service.
+It has always been wrong to take and sell the CPU cycles, bandwidth, and
+human system administration labor of the public DCC servers.
+
+Please read the LICENSE file in the DCC source:
+
+%%WRKSRC%%/LICENSE
+
+or at:
+
+http://www.dcc-servers.net/dcc/dcc-tree/LICENSE
+
+
+==========================================================================
diff -bBruN /tmp/dcc-dccd/pkg-descr dcc-dccd/pkg-descr
--- /tmp/dcc-dccd/pkg-descr	2003-03-28 04:10:08.000000000 -0500
+++ dcc-dccd/pkg-descr	2008-03-18 12:23:36.000000000 -0400
@@ -1,7 +1,10 @@
-This package the DCC (Distributed Checksum Clearinghouse) procmail and 
-non-sendmail interface, dccproc; the sendmail DCC interface, dccm; and the 
-DCC server, dccd. Also included are utilities such as cdcc and all of the 
-manual pages and documentation.
+This is the Distributed Checksum Clearinghouse (DCC) package, including 
+the command line (e.g. procmail) interface, dccproc; the SpamAssassin 
+and Postfix interface, dccifd; the Sendmail milter interface, dccm; 
+the DCC server, dccd; and the DCC greylisting server, dccd-grey.
+
+Also included are utilities such as cdcc and all of the manual pages 
+and documentation.
 
 WWW: http://www.rhyolite.com/anti-spam/dcc/
 
diff -bBruN /tmp/dcc-dccd/pkg-plist dcc-dccd/pkg-plist
--- /tmp/dcc-dccd/pkg-plist	2007-03-11 11:34:51.000000000 -0400
+++ dcc-dccd/pkg-plist	2008-03-18 12:23:36.000000000 -0400
@@ -1,53 +1,29 @@
- at unexec if cmp -s %D/dcc/dcc_conf %D/dcc/dcc_conf.dist; then rm -f %D/dcc/dcc_conf; fi
-dcc/dcc_conf.dist
- at exec [ -f %B/dcc_conf ] || cp %B/%f %B/dcc_conf
- at unexec if cmp -s %D/dcc/flod %D/dcc/flod.dist; then rm -f %D/dcc/flod; fi
-dcc/flod.dist
- at exec [ -f %B/flod ] || cp %B/%f %B/flod
- at unexec if cmp -s %D/dcc/grey_flod %D/dcc/grey_flod.dist; then rm -f %D/dcc/grey_flod; fi
-dcc/grey_flod.dist
- at exec [ -f %B/grey_flod ] || cp %B/%f %B/grey_flod
- at unexec if cmp -s %D/dcc/grey_whitelist %D/dcc/grey_whitelist.dist; then rm -f %D/dcc/grey_whitelist; fi
-dcc/grey_whitelist.dist
- at exec [ -f %B/grey_whitelist ] || cp %B/%f %B/grey_whitelist
- at unexec if cmp -s %D/dcc/ids %D/dcc/ids.dist; then rm -f %D/dcc/ids; fi
-dcc/ids.dist
- at exec [ -f %B/ids ] || cp %B/%f %B/ids
- at unexec if cmp -s %D/dcc/map.txt %D/dcc/map.txt.dist; then rm -f %D/dcc/map.txt; fi
-dcc/map.txt.dist
- at exec [ -f %B/map.txt ] || cp %B/%f %B/map.txt
- at unexec if cmp -s %D/dcc/whiteclnt %D/dcc/whiteclnt.dist; then rm -f %D/dcc/whiteclnt; fi
-dcc/whiteclnt.dist
- at exec [ -f %B/whiteclnt ] || cp %B/%f %B/whiteclnt
- at unexec if cmp -s %D/dcc/whitecommon %D/dcc/whitecommon.dist; then rm -f %D/dcc/whitecommon; fi
-dcc/whitecommon.dist
- at exec [ -f %B/whitecommon ] || cp %B/%f %B/whitecommon
- at unexec if cmp -s %D/dcc/whitelist %D/dcc/whitelist.dist; then rm -f %D/dcc/whitelist; fi
-dcc/whitelist.dist
- at exec [ -f %B/whitelist ] || cp %B/%f %B/whitelist
 bin/cdcc
-bin/dccif-test
+%%WITH_DCCIFD%%bin/dccif-test
 bin/dccproc
 dcc/cgi-bin/README
 dcc/cgi-bin/chgpasswd
 dcc/cgi-bin/common
 dcc/cgi-bin/edit-whiteclnt
+dcc/cgi-bin/footer
+dcc/cgi-bin/header
 dcc/cgi-bin/http2https
 dcc/cgi-bin/list-log
 dcc/cgi-bin/list-msg
 dcc/cgi-bin/webuser-notify
 dcc/libexec/cron-dccd
 %%WITH_DCCIFD%%dcc/libexec/dccifd
-%%WITH_SENDMAIL%%dcc/libexec/dccm
-dcc/libexec/dbclean
-dcc/libexec/dblist
+%%WITH_DCCM%%dcc/libexec/dccm
+%%WITH_DCCD%%dcc/libexec/dbclean
+%%WITH_DCCD%%dcc/libexec/dblist
 dcc/libexec/dcc-stats-collect
 dcc/libexec/dcc-stats-graph
 dcc/libexec/dcc-stats-init
-dcc/libexec/dccd
+%%WITH_DCCD%%dcc/libexec/dccd
 dcc/libexec/dccsight
-dcc/libexec/dns-helper
+%%WITH_IFD_MILT%%dcc/libexec/dns-helper
 dcc/libexec/fetchblack
+dcc/libexec/fetchids
 dcc/libexec/fetch-testmsg-whitelist
 dcc/libexec/hackmc
 dcc/libexec/list-clients
@@ -63,10 +39,43 @@
 dcc/libexec/updatedcc
 dcc/libexec/uninstalldcc
 dcc/libexec/wlist
-dcc/cgi-bin/header
-dcc/cgi-bin/footer
-dcc/map
- at dirrm dcc/log
 @dirrm dcc/libexec
 @dirrm dcc/cgi-bin
 @dirrmtry dcc
+%%WITH_DCCIFD%%@stopdaemon dccifd
+%%WITH_DCCM%%@stopdaemon dccm
+%%WITH_DCCD%%@stopdaemon dccd
+%%WITH_DCCGREY%%@stopdaemon dccgrey
+%%WITH_ALT_HOME%%@cwd /var
+ at unexec if cmp -s %D/dcc/dcc_conf %D/dcc/dcc_conf.sample; then rm -f %D/dcc/dcc_conf; fi
+dcc/dcc_conf.sample
+ at exec [ -f %B/dcc_conf ] || cp %B/%f %B/dcc_conf
+ at unexec if cmp -s %D/dcc/flod %D/dcc/flod.sample; then rm -f %D/dcc/flod; fi
+dcc/flod.sample
+ at unexec if cmp -s %D/dcc/grey_flod %D/dcc/grey_flod.sample; then rm -f %D/dcc/grey_flod; fi
+dcc/grey_flod.sample
+ at unexec if cmp -s %D/dcc/grey_whitelist %D/dcc/grey_whitelist.sample; then rm -f %D/dcc/grey_whitelist; fi
+dcc/grey_whitelist.sample
+ at unexec if cmp -s %D/dcc/ids %D/dcc/ids.sample; then rm -f %D/dcc/ids; fi
+dcc/ids.sample
+ at unexec if cmp -s %D/dcc/map.txt %D/dcc/map.txt.sample; then rm -f %D/dcc/map.txt; fi
+dcc/map.txt.sample
+ at unexec if cmp -s %D/dcc/map %D/dcc/map.sample; then rm -f %D/dcc/map; fi
+dcc/map.sample
+ at unexec if cmp -s %D/dcc/whiteclnt %D/dcc/whiteclnt.sample; then rm -f %D/dcc/whiteclnt; fi
+dcc/whiteclnt.sample
+ at unexec if cmp -s %D/dcc/whitecommon %D/dcc/whitecommon.sample; then rm -f %D/dcc/whitecommon; fi
+dcc/whitecommon.sample
+ at unexec if cmp -s %D/dcc/whitelist %D/dcc/whitelist.sample; then rm -f %D/dcc/whitelist; fi
+dcc/whitelist.sample
+%%WITH_IFD_MILT%%@unexec [ -e %D/dcc/whiteclnt.dccw ] && rm -f %D/dcc/whiteclnt.dccw || true
+%%WITH_IFD_MILT%%@unexec [ -e %D/dcc/whiteclnt.dccx ] && rm -f %D/dcc/whiteclnt.dccx || true
+%%WITH_DCCD%%@unexec [ -e %D/dcc/dcc_db ] && rm -f %D/dcc/dcc_db || true
+%%WITH_DCCD%%@unexec [ -e %D/dcc/dcc_db.hash ] && rm -f %D/dcc/dcc_db.hash || true
+%%WITH_DCCD%%@unexec [ -e %D/dcc/flod.map ] && rm -f %D/dcc/flod.map || true
+%%WITH_DCCD%%@unexec [ -e %D/dcc/dccd_clients ] && rm -f %D/dcc/dccd_clients || true
+%%WITH_DCCGREY%%@unexec [ -e %D/dcc/grey_db.hash ] && rm -f %D/dcc/grey_db.hash || true
+%%WITH_DCCGREY%%@unexec [ -e %D/dcc/grey_flod.map ] && rm -f %D/dcc/grey_flod.map || true
+%%WITH_DCCGREY%%@unexec [ -e %D/dcc/grey_clients ] && rm -f %D/dcc/grey_clients || true
+ at dirrm dcc/log
+ at dirrmtry dcc


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



More information about the freebsd-ports-bugs mailing list