diff options
author | clive <clive@FreeBSD.org> | 2004-10-14 18:16:14 +0800 |
---|---|---|
committer | clive <clive@FreeBSD.org> | 2004-10-14 18:16:14 +0800 |
commit | d31ab45a1b1a5f35f8c228b99fb88fcb9210a66f (patch) | |
tree | 7a35998466a57d206119fe2c4fbbc4b89e53df70 | |
parent | b01e7196ccd17a31bbde61f0e0d58cf84f1b94fc (diff) | |
download | freebsd-ports-gnome-d31ab45a1b1a5f35f8c228b99fb88fcb9210a66f.tar.gz freebsd-ports-gnome-d31ab45a1b1a5f35f8c228b99fb88fcb9210a66f.tar.zst freebsd-ports-gnome-d31ab45a1b1a5f35f8c228b99fb88fcb9210a66f.zip |
Add milter-spamc, a bridge between spamc from SpamAssassin and
sendmail. The libsnert stuff mentioned in the PR is not addressed
in this commit, since it is not a run time dependency, and is
strictly coupled with milter-spamc itself.
PR: ports/71486
Submitted by: Michael O. Boev <mike@tric.tomsk.gov.ru>
-rw-r--r-- | mail/Makefile | 1 | ||||
-rw-r--r-- | mail/milter-spamc/Makefile | 86 | ||||
-rw-r--r-- | mail/milter-spamc/distinfo | 4 | ||||
-rw-r--r-- | mail/milter-spamc/files/milter-spamc.sh | 44 | ||||
-rw-r--r-- | mail/milter-spamc/files/patch-aa | 10 | ||||
-rw-r--r-- | mail/milter-spamc/files/patch-ab | 72 | ||||
-rw-r--r-- | mail/milter-spamc/files/patch-ac | 11 | ||||
-rw-r--r-- | mail/milter-spamc/files/patch-ad | 10 | ||||
-rw-r--r-- | mail/milter-spamc/files/patch-ae | 11 | ||||
-rw-r--r-- | mail/milter-spamc/pkg-descr | 5 | ||||
-rw-r--r-- | mail/milter-spamc/pkg-message | 11 | ||||
-rw-r--r-- | mail/milter-spamc/pkg-plist | 34 |
12 files changed, 299 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile index 7fbab3e935ad..e4ba5ebbed31 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -190,6 +190,7 @@ SUBDIR += milter-regex SUBDIR += milter-sender SUBDIR += milter-skem + SUBDIR += milter-spamc SUBDIR += mimedefang SUBDIR += mini_sendmail SUBDIR += minimalist diff --git a/mail/milter-spamc/Makefile b/mail/milter-spamc/Makefile new file mode 100644 index 000000000000..91ce052fa582 --- /dev/null +++ b/mail/milter-spamc/Makefile @@ -0,0 +1,86 @@ +# New ports collection makefile for: milter-spamc +# Date created: 5 Sep 2004 +# Whom: Mike Boev +# +# $FreeBSD$ +# + +PORTNAME= milter-spamc +PORTVERSION= 0.25 +CATEGORIES= mail +MASTER_SITES= http://www.snert.com/Software/download/ +DISTFILES= libsnert-1.40.tgz milter-spamc-${PORTVERSION}.tgz + +MAINTAINER= mike@tric.tomsk.gov.ru +COMMENT= Yet Another Sendmail-SpamAssassin Interface Milter + +RESTRICTED= No redistribution allowed + +USE_REINPLACE= yes +GNU_CONFIGURE= yes + +WRKSRC= ${WRKDIR}/com/snert/src/milter-spamc +MAKEFILE= makefile + +.include <bsd.port.pre.mk> + +.if ( ${OSVERSION} < 440000 ) +BUILD_DEPENDS= gxargs:${PORTSBASE}/misc/findutils +.endif + +.if !exists(/usr/lib/libmilter.a) && !exists(${LOCALBASE}/lib/libmilter.a) +IGNORE= requires Sendmail 8.12 +.endif +.if exists(${LOCALBASE}/lib/libmilter.a) +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +.endif +CFLAGS+= ${PTHREAD_CFLAGS} +LDFLAGS+= ${PTHREAD_LIBS} + +DOCS= CHANGES.TXT index.shtml style.css mailto.js \ + LICENSE.TXT + +CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL} +CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" +CONFIGURE_ARGS+=--with-db --localstatedir=/var/spool +.if !defined(WITH_DEBUG) +CONFIGURE_ARGS+=--disable-debug +.endif + +USE_RC_SUBR= yes +RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} NAME=milter_spamc + +post-extract: + ${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/milter-spamc.sh > ${WRKSRC}/milter-spamc.sh.freebsd + +post-patch: +.if ( ${OSVERSION} < 440000 ) # please contact vs@ if in doubt + ${REINPLACE_CMD} 's/xargs -J{}/gxargs -i{}/' ${WRKSRC}/../lib/configure +.endif + ${REINPLACE_CMD} "s,-fvolatile,," ${WRKSRC}/configure + +pre-configure: + @cd ${WRKSRC}/../lib && \ + ${SETENV} CC="${CC}" CXX="${CXX}" \ + CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \ + INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \ + INSTALL_DATA="${INSTALL_DATA}" \ + INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ + INSTALL_SCRIPT="${INSTALL_SCRIPT}" \ + ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} + @cd ${WRKSRC}/../lib && \ + ${SETENV} ${MAKE_ENV} ${MAKE} \ + ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET} + +post-install: +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR}/Img + cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR} + @cd ${WRKSRC}/Img && \ + ${INSTALL_DATA} *.gif *.png ${DOCSDIR}/Img +.endif + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.post.mk> diff --git a/mail/milter-spamc/distinfo b/mail/milter-spamc/distinfo new file mode 100644 index 000000000000..76db8a4ff31a --- /dev/null +++ b/mail/milter-spamc/distinfo @@ -0,0 +1,4 @@ +MD5 (libsnert-1.40.tgz) = ee97d93f06304a87f54f1caf994cc91b +SIZE (libsnert-1.40.tgz) = 307456 +MD5 (milter-spamc-0.25.tgz) = f2538d47fa659e66c3b75da193e9ae34 +SIZE (milter-spamc-0.25.tgz) = 193311 diff --git a/mail/milter-spamc/files/milter-spamc.sh b/mail/milter-spamc/files/milter-spamc.sh new file mode 100644 index 000000000000..ea6f35555024 --- /dev/null +++ b/mail/milter-spamc/files/milter-spamc.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: %%NAME%% +# REQUIRE: syslogd +# BEFORE: sendmail +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable milter-spamc: +# +#%%NAME%%_enable="YES" +# +# See %%PREFIX%%/share/doc/milter-spamc/index.shtml for flags +# + +. %%RC_SUBR%% + +name=%%NAME%% +rcvar=`set_rcvar` + +# set defaults +%%NAME%%_enable=${%%NAME%%_enable:-"NO"} +%%NAME%%_chdir="/var/spool/milter-spamc" +%%NAME%%_pidfile=${%%NAME%%_pidfile:-"$%%NAME%%_chdir/pid"} +%%NAME%%_flags=${%%NAME%%_flags:-"-f /etc/mail/sendmail.cf unix:$%%NAME%%_chdir/socket"} + +command=%%PREFIX%%/sbin/milter-spamc +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 --git a/mail/milter-spamc/files/patch-aa b/mail/milter-spamc/files/patch-aa new file mode 100644 index 000000000000..a5d083339461 --- /dev/null +++ b/mail/milter-spamc/files/patch-aa @@ -0,0 +1,10 @@ +--- configure.orig Fri Jun 11 20:37:06 2004 ++++ configure Wed Jun 16 13:43:31 2004 +@@ -1617,6 +1617,6 @@ + COMPILE='$(CC) $(CFLAGS) $(CC_O)$*$O -c $<' + +- CFLAGS="$CFLAGS -pthread -fvolatile" ++ CFLAGS="$CFLAGS -Wall -fvolatile" + elif test "$OS" = 'SunOS'; then + # This used to be -I{}, but I've seen two different SunOS 5.8 + # systems in two different parts of the world with man pages diff --git a/mail/milter-spamc/files/patch-ab b/mail/milter-spamc/files/patch-ab new file mode 100644 index 000000000000..332dc4d7b4ef --- /dev/null +++ b/mail/milter-spamc/files/patch-ab @@ -0,0 +1,72 @@ +--- install.sh.in.orig Fri May 21 16:12:40 2004 ++++ install.sh.in Thu Oct 14 13:40:27 2004 +@@ -12,60 +12,20 @@ + STARTUP_EXT="@STARTUP_EXT@" + MAILDIR="@with_sendmail@" + +-if [ ! -d ${STATEDIR} ]; then +- mkdir -p ${STATEDIR} +-fi +-chown ${USER} ${STATEDIR} +-chgrp ${GROUP} ${STATEDIR} ++install -d -o $USER -g $USER -m 755 $STATEDIR + + RC="${STARTUP_DIR}/${MILTER}${STARTUP_EXT}" +-if [ ! -f $RC ]; then +- cp ${MILTER}.sh $RC +- chmod 540 $RC ++${BSD_INSTALL_SCRIPT} ${MILTER}.sh.freebsd $RC.sample ++[ ! -f $RC ] && cp $RC.sample $RC + +- case `uname -s` in +- Linux*) +- which chkconfig +- if test $? -eq 0; then +- chkconfig --add ${MILTER} +- 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} +- cd ../rc1.d +- 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} +- cd ../rc3.d +- ln -s ../init.d/${MILTER} S18${MILTER} +- cd ../rc4.d +- ln -s ../init.d/${MILTER} S18${MILTER} +- cd ../rc5.d +- ln -s ../init.d/${MILTER} S18${MILTER} +- fi +- ;; +- SunOS*) +- # Does SunOS have a chkconfig like tool? +- ln -s $RC /etc/rc2.d/S70${MILTER} +- ln -s $RC /etc/rcS.d/K30${MILTER} +- ;; +- esac +-fi +- +-cp -f ${MILTER} ${SBINDIR} +-chmod 550 ${SBINDIR}/${MILTER} +- +-cp -f ${MILTER}.mc ${MAILDIR}/${MILTER}.mc.sample +- +-chmod g+r ${MAILDIR} ${MAILDIR}/access.* ${MAILDIR}/aliases.* +-chgrp ${GROUP} ${MAILDIR} ${MAILDIR}/access.* ${MAILDIR}/aliases.* ++touch ${MAILDIR}/access.db ${MAILDIR}/aliases.db ++chgrp ${GROUP} ${MAILDIR}/access.db ${MAILDIR}/aliases.db ++chmod g+r ${MAILDIR}/access.db ${MAILDIR}/aliases.db + + echo '***************************************************************' + echo diff --git a/mail/milter-spamc/files/patch-ac b/mail/milter-spamc/files/patch-ac new file mode 100644 index 000000000000..cef4638a97d9 --- /dev/null +++ b/mail/milter-spamc/files/patch-ac @@ -0,0 +1,11 @@ +--- milter-spamc.c.orig Sun Sep 5 23:36:27 2004 ++++ milter-spamc.c Sun Sep 5 23:35:47 2004 +@@ -717,7 +717,7 @@ + return smfNullWorkspaceError("filterBody"); + + if (smfLogDetail & SMF_LOG_TRACE) +- syslog(LOG_DEBUG, TAG_FORMAT "filterBody(%lx, '%.20s...', %lu) maxBytes=%ld bytesSent=%lu", TAG_ARGS, (long) ctx, chunk, size, maxBytes, data->bytesSent); ++ syslog(LOG_DEBUG, TAG_FORMAT "filterBody(%lx, '%.20s...', %lu) maxBytes=%ld bytesSent=%lu", TAG_ARGS, (long) ctx, chunk, (unsigned long)size, maxBytes, (unsigned long)data->bytesSent); + + if (data->work.skipMessage) + goto error0; diff --git a/mail/milter-spamc/files/patch-ad b/mail/milter-spamc/files/patch-ad new file mode 100644 index 000000000000..611e79b2586b --- /dev/null +++ b/mail/milter-spamc/files/patch-ad @@ -0,0 +1,10 @@ +--- ../lib/configure.orig Wed Jun 16 13:56:11 2004 ++++ ../lib/configure Wed Jun 16 13:56:19 2004 +@@ -1621,7 +1621,6 @@ + + if test "$OS" = 'FreeBSD'; then + # Assume GCC. +- CFLAGS="${CFLAGS} -D_THREAD_SAFE -pthread" + COMPILE='$(CC) $(CFLAGS) $(CC_O)$*$O -c $<' + ARCHIVE='ar rc $(LIB) {}' + XARGSI='xargs -J{}' diff --git a/mail/milter-spamc/files/patch-ae b/mail/milter-spamc/files/patch-ae new file mode 100644 index 000000000000..d4731e8ef8c9 --- /dev/null +++ b/mail/milter-spamc/files/patch-ae @@ -0,0 +1,11 @@ +--- milter-spamc.mc.in.orig Wed Jun 16 13:58:58 2004 ++++ milter-spamc.mc.in Wed Jun 16 13:59:24 2004 +@@ -4,7 +4,7 @@ + dnl Example configuration to be added to sendmail.mc. + dnl + +-define(`_FFR_MILTER', `1')dnl ++dnl define(`_FFR_MILTER', `1')dnl + + dnl ------------------------------------------------------------------- + dnl Enable this for debug output from Sendmail. diff --git a/mail/milter-spamc/pkg-descr b/mail/milter-spamc/pkg-descr new file mode 100644 index 000000000000..a9467c483d6a --- /dev/null +++ b/mail/milter-spamc/pkg-descr @@ -0,0 +1,5 @@ +SpamAssassin is a well established free open-source mail classification tool, +however it has no means by which to interface with Sendmail. +milter-spamc provides such an interface between Sendmail and SpamAssassin. + +WWW: http://www.milter.info/milter-spamc/ diff --git a/mail/milter-spamc/pkg-message b/mail/milter-spamc/pkg-message new file mode 100644 index 000000000000..24ec35a99775 --- /dev/null +++ b/mail/milter-spamc/pkg-message @@ -0,0 +1,11 @@ +************************************************************************ + +In order to run this port, please add the following line to +/etc/mail/YOUR-CONF.mc: + +include(`milter-spamc.mc')dnl + +Don't forget to remake and reinstall the sendmail configuration file +after modifying YOUR-CONF.mc. + +************************************************************************ diff --git a/mail/milter-spamc/pkg-plist b/mail/milter-spamc/pkg-plist new file mode 100644 index 000000000000..781e1bc22b83 --- /dev/null +++ b/mail/milter-spamc/pkg-plist @@ -0,0 +1,34 @@ +@unexec if [ -f %D/etc/rc.d/milter-spamc.sh ] && cmp -s %D/etc/rc.d/milter-spamc.sh %D/etc/rc.d/milter-spamc.sh.sample; then rm -f %D/etc/rc.d/milter-spamc.sh; fi +etc/rc.d/milter-spamc.sh.sample +@exec if [ ! -f %D/etc/rc.d/milter-spamc.sh ] ; then cp %D/%F %B/milter-spamc.sh; fi +sbin/milter-spamc +@exec install -d -o smmsp -g smmsp -m 755 /var/spool/milter-spamc +@unexec rm -rf /var/spool/milter-spamc 2>&1 >/dev/null || true +%%PORTDOCS%%%%DOCSDIR%%/CHANGES.TXT +%%PORTDOCS%%%%DOCSDIR%%/Img/bg.gif +%%PORTDOCS%%%%DOCSDIR%%/Img/dilbert2003071742312.gif +%%PORTDOCS%%%%DOCSDIR%%/Img/dilbert2003228690821.gif +%%PORTDOCS%%%%DOCSDIR%%/Img/dilbert20040429.gif +%%PORTDOCS%%%%DOCSDIR%%/Img/mrpixel.gif +%%PORTDOCS%%%%DOCSDIR%%/Img/overview.png +%%PORTDOCS%%%%DOCSDIR%%/Img/sendmail-bat-left-142x38.png +%%PORTDOCS%%%%DOCSDIR%%/Img/sendmail-bat-right-142x38.png +%%PORTDOCS%%%%DOCSDIR%%/Img/sun.gif +%%PORTDOCS%%%%DOCSDIR%%/LICENSE.TXT +%%PORTDOCS%%%%DOCSDIR%%/index.shtml +%%PORTDOCS%%%%DOCSDIR%%/mailto.js +%%PORTDOCS%%%%DOCSDIR%%/style.css +@unexec echo +@unexec echo "If permanently deleting this package, don't forget to delete" +@unexec echo "the inclusion of milter-spamc.mc from /etc/mail/YOUR-CONF.mc" +@unexec echo "and then to rebuild and reinstall the sendmail configuration file!" +@unexec echo +%%PORTDOCS%%@dirrm %%DOCSDIR%%/Img +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@cwd / +@unexec if [ -f %D/etc/mail/milter-spamc.mc ] && cmp -s %D/etc/mail/milter-spamc.mc %D/etc/mail/milter-spamc.mc.sample; then rm -f %D/etc/mail/milter-spamc.mc; fi +etc/mail/milter-spamc.mc.sample +@exec if [ ! -f %D/etc/mail/milter-spamc.mc ] ; then cp %D/%F %B/milter-spamc.mc; fi +@exec touch %D/etc/mail/access.db %D/etc/mail/aliases.db +@exec chgrp smmsp %D/etc/mail/access.db %D/etc/mail/aliases.db +@exec chmod g+r %D/etc/mail/access.db %D/etc/mail/aliases.db |