ports/70161: [NEW PORT] mail/spamass-rules_du_jour: Automatic updates of custom rulesets forSpamAssassin

Michael Ranner mranner at inode.at
Sun Aug 8 13:20:08 UTC 2004


The following reply was made to PR ports/70161; it has been noted by GNATS.

From: Michael Ranner <mranner at inode.at>
To: Mathieu Arnold <mat at FreeBSD.org>
Cc: gnats <freebsd-gnats-submit at FreeBSD.org>
Subject: Re: ports/70161: [NEW PORT] mail/spamass-rules_du_jour: =?iso-8859-1?q?Automatic=09updates_of_custom_rulesets_for?= SpamAssassin
Date: Sun, 8 Aug 2004 15:16:22 +0200

 Am Sonntag, 8. August 2004 14:55 schrieb Mathieu Arnold:
 > Well, it's your port, go ahead :-)
 >
 > ps: keep freebsd-gnats-submit at FreeBSD.org CCed so that the audit trail is
 > kept.
 
 # This is a shell archive.  Save it in a file, remove anything before
 # this line, and then unpack it by entering "sh file".  Note, it may
 # create directories; files and directories will be owned by you and
 # have default permissions.
 #
 # This archive contains:
 #
 #	spamass-rules_du_jour
 #	spamass-rules_du_jour/pkg-descr
 #	spamass-rules_du_jour/distinfo
 #	spamass-rules_du_jour/Makefile
 #	spamass-rules_du_jour/pkg-message
 #	spamass-rules_du_jour/files
 #	spamass-rules_du_jour/files/patch-rules_du_jour
 #	spamass-rules_du_jour/files/patch-config
 #	spamass-rules_du_jour/pkg-plist
 #
 echo c - spamass-rules_du_jour
 mkdir -p spamass-rules_du_jour > /dev/null 2>&1
 echo x - spamass-rules_du_jour/pkg-descr
 sed 's/^X//' >spamass-rules_du_jour/pkg-descr << 
 'END-of-spamass-rules_du_jour/pkg-descr'
 XAutomatic updates of custom rulesets for SpamAssassin which are not
 Xpart of the official distro.
 X
 XWWW: http://www.exit0.us/index.php/RulesDuJour
 END-of-spamass-rules_du_jour/pkg-descr
 echo x - spamass-rules_du_jour/distinfo
 sed 's/^X//' >spamass-rules_du_jour/distinfo << 
 'END-of-spamass-rules_du_jour/distinfo'
 XMD5 (rules_du_jour-1.17a.tar.gz) = ed54abc68d8fe15abc2936481ea43653
 XSIZE (rules_du_jour-1.17a.tar.gz) = 14276
 END-of-spamass-rules_du_jour/distinfo
 echo x - spamass-rules_du_jour/Makefile
 sed 's/^X//' >spamass-rules_du_jour/Makefile << 
 'END-of-spamass-rules_du_jour/Makefile'
 X# New ports collection makefile for: spamass-rules
 X# Date created:         20040802
 X# Whom:                 mranner at inode.at
 X#
 X# $FreeBSD$
 X#
 X
 XPORTNAME=	rules_du_jour
 XPORTVERSION=	1.17a
 XCATEGORIES=	mail
 XMASTER_SITES=	http://www.ranner.jawa.at/stuff/
 XPKGNAMEPREFIX=	spamass-
 X
 XMAINTAINER=	mranner at inode.at
 XCOMMENT=	Automatic updates of custom rulesets for SpamAssassin
 X
 XRUN_DEPENDS=	bash:${PORTSDIR}/shells/bash2 \
 X				spamc:${PORTSDIR}/mail/p5-Mail-SpamAssassin
 X
 XOPTIONS=	ANTIDRUG "Catch those pesky 'pill spams'" on \
 X		BOGUS_VIRUS "Catch 'collateral spam' caused by viruses" on \
 X		EVILNUMBERS "Phone numbers, PO boxes, ... from spam " on \
 X		RANDOM "Detects spamware mistakes like: %RANDOM_WORD" on \
 X		SARE "Installs safe SARE rules" on \
 X		TRIPWIRE "Matches 3 chars that shouldn't be together" off
 XPLIST_FILES=	bin/rules_du_jour etc/mail/rulesdujour.sample
 XPKGMESSAGE=		${WRKDIR}/pkg-message
 XNO_BUILD=		yes
 XSPAMASS_CONF=	etc/mail/spamassassin
 XSPAMASS_DIR=	${PREFIX}/${SPAMASS_CONF}
 X
 X.include <bsd.port.pre.mk>
 X
 X.if defined(WITH_ANTIDRUG)
 XSPAMASS_FILES+=	ANTIDRUG
 X.endif
 X
 X.if defined(WITH_BOGUS_VIRUS)
 XSPAMASS_FILES+=	BOGUSVIRUS
 X.endif
 X
 X.if defined(WITH_EVILNUMBERS)
 XSPAMASS_FILES+=	EVILNUMBERS
 X.endif
 X
 X.if defined(WITH_RANDOM)
 XSPAMASS_FILES+=	RANDOMVAL
 X.endif
 X
 X.if defined(WITH_SARE)
 X.for i in SARE_ADULT SARE_FRAUD SARE_BML SARE_RATWARE SARE_SPOOF \
 X	SARE_BAYES_POISON_NXM SARE_OEM SARE_RANDOM SARE_SPECIFIC
 XSPAMASS_FILES+=	$i
 X.endfor
 X.endif
 X
 X.if defined(WITH_TRIPWIRE)
 XSPAMASS_FILES+=	TRIPWIRE
 X.endif
 X
 Xdo-build:
 X	@${DO_NADA}
 X
 Xpre-install:
 X	@${SED} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
 X		-e 's|%%DOCSDIR%%|${DOCSDIR}|g' <${.CURDIR}/pkg-message >${PKGMESSAGE}
 X	@${SED} -e 's|TRIPWIRE EVILNUMBERS SARE_RANDOM|${SPAMASS_FILES}|' \
 X		-e 's|PREFIX="/usr/local"|PREFIX="${LOCALBASE}"|' \
 X		<${WRKSRC}/config >${WRKSRC}/config.sample
 X
 Xdo-install:
 X	@${INSTALL} -d -o root -g wheel -m 0755 ${SPAMASS_DIR}/RulesDuJour
 X	@${INSTALL} ${WRKSRC}/rules_du_jour ${LOCALBASE}/bin
 X	@${INSTALL_DATA} ${WRKSRC}/config.sample 
 ${LOCALBASE}/etc/mail/rulesdujour.sample
 X
 Xpost-install:
 X	@${CAT} ${PKGMESSAGE}
 X
 X.include <bsd.port.post.mk>
 END-of-spamass-rules_du_jour/Makefile
 echo x - spamass-rules_du_jour/pkg-message
 sed 's/^X//' >spamass-rules_du_jour/pkg-message << 
 'END-of-spamass-rules_du_jour/pkg-message'
 X*************************************************************************
 X
 XPlease edit the configuration in %%LOCALBASE%%/etc/mail/rulesdujour
 XRun %%LOCALBASE%%/bin/rules_du_jour to fetch the latest rulesets
 XThe custom rulesets are updated in %%LOCALBASE%%/etc/mail/spamassassin
 X
 XAfter updating the rules please do the following:
 X
 X1. Read any extra info available with the rules, including the comments
 X   in the .cf files.
 X2. Check to make sure that the default scores in these rules fit your
 X   installation. You might want to modify scores.
 X3. Test the new rulesets. Keep an eye on hits from the new rules to
 X   determine if the scoring is right for you.
 X4. Run %%LOCALBASE%%/bin/rules_du_jour ONLY once per day.
 X
 XYou may visit http://www.exit0.us/index.php/RulesDuJour before you use
 XRulesDuJour.
 X
 X*************************************************************************
 END-of-spamass-rules_du_jour/pkg-message
 echo c - spamass-rules_du_jour/files
 mkdir -p spamass-rules_du_jour/files > /dev/null 2>&1
 echo x - spamass-rules_du_jour/files/patch-rules_du_jour
 sed 's/^X//' >spamass-rules_du_jour/files/patch-rules_du_jour << 
 'END-of-spamass-rules_du_jour/files/patch-rules_du_jour'
 X--- rules_du_jour.orig	Mon Aug  2 20:38:44 2004
 X+++ rules_du_jour	Mon Aug  2 22:29:32 2004
 X@@ -1,4 +1,4 @@
 X-#!/bin/bash
 X+#!/usr/local/bin/bash
 X # Version 1.17a   Added support for curl by default (instead of wget). 
 Requires curl 7.10 or higher.  Integrated "email me only when RDJ has been 
 updated" patch (thanks, Daniel Cohen!) rev 17a: fixed extraneous debug print
 X 
 X ##########################
 X@@ -52,7 +52,7 @@
 X # (my_rules_du_jour wrapper script is no longer recommended)
 X # Reads persistent configuration files from /etc, if one exists.  
 X # /etc/rulesdujour/config is the recommended configuration file location.
 X-for i 
 in /etc/rulesdujour/config /etc/rulesdujour /etc/mail/rulesdujour /etc/sysconfig/RulesDuJour /etc/sysconfig/rulesdujour ; 
 do
 X+for i 
 in /usr/local/etc/rulesdujour/config /usr/local/etc/rulesdujour /usr/local/etc/mail/rulesdujour ; 
 do
 X     [ -f $i ] && source $i ;
 X done;
 X 
 X@@ -133,7 +133,7 @@
 X #### Here are settings for Tripwire. ####
 X TRIPWIRE=0; # Index of Tripwire data into the arrays is 0
 X               
 CF_URLS[0]="http://www.rulesemporium.com/rules/99_FVGT_Tripwire.cf";
 X-             CF_FILES[0]="tripwire.cf";
 X+             CF_FILES[0]="99_FVGT_Tripwire.cf";
 X              CF_NAMES[0]="TripWire";
 X PARSE_NEW_VER_SCRIPTS[0]="${PERL} -ne 'print if /^\s*#.*(vers?|version|rev|
 revision)[:\.\s]*[0-9]/i;' | sort | ${TAIL}";
 X #    CF_MUNGE_SCRIPTS[0]="nothing necessary for this ruleset.";
 END-of-spamass-rules_du_jour/files/patch-rules_du_jour
 echo x - spamass-rules_du_jour/files/patch-config
 sed 's/^X//' >spamass-rules_du_jour/files/patch-config << 
 'END-of-spamass-rules_du_jour/files/patch-config'
 X--- config.orig	Sun Aug  8 14:56:31 2004
 X+++ config	Sun Aug  8 14:58:41 2004
 X@@ -0,0 +1,55 @@
 X+TRUSTED_RULESETS="TRIPWIRE EVILNUMBERS SARE_RANDOM";
 X+PREFIX="/usr/local"
 X+
 X+#### Local SpamAssassin/system Settings ####
 X+#### Modify these to match your system. ####
 X+SA_DIR="/usr/local/etc/mail/spamassassin";	# Change this to your SA local 
 config 
 X+											# directory, probably /etc/mail/spamassassin.
 X+
 X+MAIL_ADDRESS="root";	# Where do Email notifications go
 X+
 X+SINGLE_EMAIL_ONLY="true";	# Set this to "true" to send only one notification
 X+							# email per RDJ run with "interesting"
 X+							# activity. Set to "" to send a separate
 X+							# for each interesting activity.
 X+
 X+EMAIL_RDJ_UPDATE_ONLY="true";	# Set this to "true" to send notifications 
 only 
 X+								# when an update for RDJ has been retrieved.  Set 
 X+								# to "" (default) to send notifications whenever a ruleset 
 X+								# has changed. (Has no effect unless SINGLE_EMAIL_ONLY is set)
 X+
 X+SA_LINT="$PREFIX/bin/spamassassin --lint";	# Command used to lint the rules
 X+
 X+SA_RESTART="$PREFIX/etc/rc.d/spamd.sh restart";	# Command used to restart 
 spamd
 X+												# May be /etc/rc.d/init.d/spamassassin restart
 X+												# For amavisd, may be /etc/init.d/amavisd restart
 X+												# For minedefang, may be /etc/init.d/mimedefang restart
 X+
 X+CURL_PROG="$PREFIX/bin/curl";								# Location of the curl program
 X+CURL_OPTS="-w %{http_code} --compressed -O -R -s -S -z";	# Parameters of the 
 curl program
 X+
 X+WGET_PROG="fetch";	# Use FreeBSD's fetch instead of wget
 X+WGET_OPTS="-m";		# Parameter of the fetch program
 X+
 X+#WGET_PROG="$PREFIX/bin/wget";	# Location of the wget program
 X+#WGET_OPTS="-N";					# Parameters of the wget program
 X+
 X+#PERL="perl";		# Location of the perl program
 X+#GREP="grep";		# Location of the grep program 
 X+#TAIL="tail -1";	# Location (and parameters) for 'tail -n1'
 X+#HEAD="head -1";	# Location (and parameters) for 'head -n1'
 X+#MAILCMD="mail";	# Location of the mail program 
 X+					# that takes and understand the -s flag
 X+#DEBUG="true";		# Uncomment this to force debug mode on (or use -D)
 X+#### End Local SpamAssassin Settings    ####
 X+
 X+#TMPDIR="${SA_DIR}/RulesDuJour";	# Where we store old rulesets.  If you 
 delete
 X+									# this directory, RuleSets may be detected as
 X+									# out of date the next time you run rules_du_jour.
 X+
 X+
 X+#### Do not change next lines        ####
 X+#### or script will break on FreeBSD ####
 X+
 X+DONT_CHECK_FOR_RDJ_UPDATES="true";	# Do not change, or periodic run will 
 break on FreeBSD
 X+RDJ_URL="http://sandgnat.com/rdj/rules_du_jour";	# URL to update this script
 END-of-spamass-rules_du_jour/files/patch-config
 echo x - spamass-rules_du_jour/pkg-plist
 sed 's/^X//' >spamass-rules_du_jour/pkg-plist << 
 'END-of-spamass-rules_du_jour/pkg-plist'
 X at unexec rmdir %D/etc/mail/spamassassin/RulesDuJour 2>/dev/null || true
 X at unexec rmdir %D/etc/mail/spamassassin 2>/dev/null || true
 X at unexec rmdir %D/etc/mail 2>/dev/null || true
 END-of-spamass-rules_du_jour/pkg-plist
 exit
 



More information about the freebsd-ports-bugs mailing list