diff options
author | perky <perky@FreeBSD.org> | 2002-06-27 02:54:03 +0800 |
---|---|---|
committer | perky <perky@FreeBSD.org> | 2002-06-27 02:54:03 +0800 |
commit | ffddb7fe430e59d9805e9baa15888258de1440dc (patch) | |
tree | de7d78f8ced05050bf1218bcd60734e0bb0627fb /mail | |
parent | e699bf10d5134771bff25b0f01f857ec6772e564 (diff) | |
download | freebsd-ports-gnome-ffddb7fe430e59d9805e9baa15888258de1440dc.tar.gz freebsd-ports-gnome-ffddb7fe430e59d9805e9baa15888258de1440dc.tar.zst freebsd-ports-gnome-ffddb7fe430e59d9805e9baa15888258de1440dc.zip |
Add spamass-milter 0.1.1,
sendmail Milter (mail filter) for SpamAssassin.
PR: 37577
Submitted by: Eugene M. Kim <ab@astralblue.net>
Diffstat (limited to 'mail')
-rw-r--r-- | mail/Makefile | 1 | ||||
-rw-r--r-- | mail/spamass-milter/Makefile | 42 | ||||
-rw-r--r-- | mail/spamass-milter/distinfo | 1 | ||||
-rw-r--r-- | mail/spamass-milter/files/activation.txt | 86 | ||||
-rw-r--r-- | mail/spamass-milter/files/patch-Makefile.am | 31 | ||||
-rw-r--r-- | mail/spamass-milter/files/spamass-milter.sh.dist | 25 | ||||
-rw-r--r-- | mail/spamass-milter/pkg-comment | 1 | ||||
-rw-r--r-- | mail/spamass-milter/pkg-descr | 5 | ||||
-rw-r--r-- | mail/spamass-milter/pkg-message | 5 | ||||
-rw-r--r-- | mail/spamass-milter/pkg-plist | 4 |
10 files changed, 201 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile index e7f51eb2438a..8138c2e9a65b 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -224,6 +224,7 @@ SUBDIR += smunge SUBDIR += solidpop3d SUBDIR += sonicmail + SUBDIR += spamass-milter SUBDIR += spambnc SUBDIR += spruce SUBDIR += squirrelmail diff --git a/mail/spamass-milter/Makefile b/mail/spamass-milter/Makefile new file mode 100644 index 000000000000..06310c44ea28 --- /dev/null +++ b/mail/spamass-milter/Makefile @@ -0,0 +1,42 @@ +# New ports collection makefile for: spamass-milter +# Date created: 29 April 2002 +# Whom: Eugene M. Kim <ab@astralblue.net> +# +# $FreeBSD$ +# + +PORTNAME= spamass-milter +PORTVERSION= 0.1.1 +CATEGORIES= mail +MASTER_SITES= http://freesoftware.fsf.org/download/spamass-milt/ + +MAINTAINER= ab@astralblue.net + +BUILD_DEPENDS= spamc:${PORTSDIR}/mail/p5-Mail-SpamAssassin +RUN_DEPENDS= spamc:${PORTSDIR}/mail/p5-Mail-SpamAssassin + +.if !exists(/usr/lib/libmilter.a) +IGNORE= requires Sendmail 8.12; upgrade the base system +.endif + +USE_AUTOMAKE= YES +MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ + PTHREAD_LIBS="${PTHREAD_LIBS}" PORT_CFLAGS="${CFLAGS}" +PLIST_SUB= DOCSDIR=${DOCSDIR} + +post-patch: +.for f in spamass-milter.sh.dist activation.txt + ${SED} -e 's|/usr/local|${PREFIX}|g' \ + ${FILESDIR}/${f} > ${WRKDIR}/${f} +.endfor + +post-install: + ${INSTALL_DATA} ${WRKDIR}/spamass-milter.sh.dist \ + ${PREFIX}/etc/rc.d/spamass-milter.sh.dist +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKDIR}/activation.txt ${DOCSDIR}/activation.txt +.endif + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/mail/spamass-milter/distinfo b/mail/spamass-milter/distinfo new file mode 100644 index 000000000000..79998059edbd --- /dev/null +++ b/mail/spamass-milter/distinfo @@ -0,0 +1 @@ +MD5 (spamass-milter-0.1.1.tar.gz) = 9dfb1316a60c7ddecff9acbdc9e9476b diff --git a/mail/spamass-milter/files/activation.txt b/mail/spamass-milter/files/activation.txt new file mode 100644 index 000000000000..c44a8edffbad --- /dev/null +++ b/mail/spamass-milter/files/activation.txt @@ -0,0 +1,86 @@ +In order to activate spamass-milter, follow these steps: + +1. Review and customize your system-wide SpamAssassin preference, by + editing /etc/mail/spamassassin/local.cf. Refer to the SpamAssassin + manpage Mail::SpamAssassin::Conf(3) for details on what to put in it. + +2. If you didn't activate spamd (the SpamAssassin daemon), do so now: + + cd /usr/local/etc/rc.d + cp -p spamd.sh-dist spamd.sh + chmod 755 spamd.sh + /usr/local/etc/rc.d/spamd.sh start + +3. Activate spamass-milter: + + cd /usr/local/etc/rc.d + cp -p spamass-milter.sh.dist spamass-milter.sh + chmod 755 spamass-milter.sh + /usr/local/etc/rc.d/spamass-milter.sh start + +4. Backup your sendmail.cf (in /etc/mail). + +5. If you didn't create your own customized version of Sendmail .mc + file, create one from the default template (replace YOURNAME with a + suitable name; a good candidate is the output of `hostname -s'): + + cd /etc/mail + cp -p freebsd.mc YOURNAME.mc + echo "SENDMAIL_MC = /etc/mail/YOURNAME.mc" >> /etc/make.conf + + The last line tells the system to use your customized version instead + of the default freebsd.mc when you run mergemaster(8) later on. + +6. Add the spamass-milter hook to your Sendmail .mc file. The magic + line to add is: + + INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass-milter.sock, F=, T=C:15m;S:4m;R:4m;E:10m') + + Everything should go on a single line, no line break/continuation is + allowed! + + The best place to add this is right after the dnsbl-related comments. + (Hint: Every comment in an .mc file starts with `dnl'.) + +7. Rebuild the sendmail.cf from your .mc file: + + cd /etc/mail + make + make install + + Or you can run mergemaster(8) instead if you want, although it's an + overkill. + +8. Restart Sendmail: + + kill -HUP `head -1 /var/run/sendmail.pid` + +9. Test the whole piece: + + /usr/sbin/sendmail root < /usr/local/share/doc/Mail-SpamAssassin/sample-nonspam.txt + /usr/sbin/sendmail root < /usr/local/share/doc/Mail-SpamAssassin/sample-spam.txt + + Each of these commands might take a long time to finish (up to about + 10-20 seconds), so please be patient. + + You should receive two messages, one from `Keith Dawson' and the + other from xl6Ety00V@fismat1.fcfm.buap.mx. The one from Keith Dawson + shouldn't be tagged as a spam, bearing this header line: + + X-Spam-Status: No, ... + + On the other hand, the one from xl6Ety00V@fismat1.fcfm.buap.mx should + be tagged as a spam, bearing these two header lines: + + X-Spam-Status: Yes, ... + X-Spam-Flag: YES + + If things don't work as expected, promptly restore your sendmail.cf + from the backup copy then restart sendmail as shown on step 9; you + may lose incoming mail otherwise! + + +Now all messages received by Sendmail are filtered through +SpamAssassin, and probable spam messages are tagged with the header +`X-Spam-Flag: YES'. Tell your users about this so they can set up +appropriate filters on their mail reader. diff --git a/mail/spamass-milter/files/patch-Makefile.am b/mail/spamass-milter/files/patch-Makefile.am new file mode 100644 index 000000000000..4a07784d2b1c --- /dev/null +++ b/mail/spamass-milter/files/patch-Makefile.am @@ -0,0 +1,31 @@ +--- Makefile.am Fri Feb 1 01:05:09 2002 ++++ Makefile.am.new Tue Apr 30 04:03:10 2002 +@@ -6,21 +6,21 @@ + SPAMC = @SPAMC@ + + INCLUDES = +-LIBS = @LIBS@ /usr/lib/libmilter/libmilter.a /usr/lib/libmilter/libsm.a ++LIBS = @LIBS@ /usr/lib/libmilter.a + + CLEANFILES=*~ .deps/* .libs/* .deps .libs + + if DEBUG +-DEBUGFLAGS += -g -Wall ++DEBUGFLAGS += $(PORT_CFLAGS) -O0 -g -Wall + else +-DEBUGFLAGS += -O2 -Wall ++DEBUGFLAGS += $(PORT_CFLAGS) + endif + +-CXXFLAGS = $(DEBUGFLAGS) +-CFLAGS = $(DEBUGFLAGS) +-LDFLAGS += ++CXXFLAGS = $(DEBUGFLAGS) $(PTHREAD_CFLAGS) ++CFLAGS = $(DEBUGFLAGS) $(PTHREAD_CFLAGS) ++LDFLAGS += $(PTHREAD_LIBS) + + +-bin_PROGRAMS = spamass-milter ++sbin_PROGRAMS = spamass-milter + spamass_milter_SOURCES = spamass-milter.cpp + diff --git a/mail/spamass-milter/files/spamass-milter.sh.dist b/mail/spamass-milter/files/spamass-milter.sh.dist new file mode 100644 index 000000000000..9147be9812ad --- /dev/null +++ b/mail/spamass-milter/files/spamass-milter.sh.dist @@ -0,0 +1,25 @@ +#!/bin/sh + +DAEMON=/usr/local/sbin/spamass-milter +SOCKET=/var/run/spamass-milter.sock +PIDFILE=/var/run/spamass-milter.pid + +case "$1" in +start) + if [ -f "${DAEMON}" -a -x "${DAEMON}" ] + then + "${DAEMON}" "${SOCKET}" & + echo $! > "${PIDFILE}" + echo -n ' spamass-milter' + fi +;; +stop) + if [ -f "${PIDFILE}" ] + then + read -r pid junk < "${PIDFILE}" + kill ${pid} + rm -f "${SOCKET}" "${PIDFILE}" + echo -n ' spamass-milter' + fi +;; +esac diff --git a/mail/spamass-milter/pkg-comment b/mail/spamass-milter/pkg-comment new file mode 100644 index 000000000000..5b47d608b897 --- /dev/null +++ b/mail/spamass-milter/pkg-comment @@ -0,0 +1 @@ +Sendmail Milter (mail filter) for SpamAssassin diff --git a/mail/spamass-milter/pkg-descr b/mail/spamass-milter/pkg-descr new file mode 100644 index 000000000000..6b286b4298e8 --- /dev/null +++ b/mail/spamass-milter/pkg-descr @@ -0,0 +1,5 @@ +spamass-milter is a little plugin for the Sendmail Milter (Mail Filter) +library that pipes all incoming mail (including things received by +rmail/UUCP) through the SpamAssassin, a highly customizable SpamFilter. + +WWW: http://savannah.gnu.org/projects/spamass-milt/ diff --git a/mail/spamass-milter/pkg-message b/mail/spamass-milter/pkg-message new file mode 100644 index 000000000000..796b7ccd6616 --- /dev/null +++ b/mail/spamass-milter/pkg-message @@ -0,0 +1,5 @@ +------------------------------------------------------------------------ +spamass-milter has been installed, but you have to activate it manually +to use it. Refer to ${PREFIX}/share/doc/spamass-milter/activation.txt +for details. +------------------------------------------------------------------------ diff --git a/mail/spamass-milter/pkg-plist b/mail/spamass-milter/pkg-plist new file mode 100644 index 000000000000..ef50241cd4d4 --- /dev/null +++ b/mail/spamass-milter/pkg-plist @@ -0,0 +1,4 @@ +sbin/spamass-milter +etc/rc.d/spamass-milter.sh.dist +%%PORTDOCS%%share/doc/spamass-milter/activation.txt +%%PORTDOCS%%@dirrm share/doc/spamass-milter |