DSPAM (as in De-Spam) is an extremely scalable, open-source statistical hybrid anti-spam filter. While most commercial solutions only provide a mere 95% accuracy (1 error in 20), a majority of DSPAM users frequently see between 99.95% (1 error in 2000) all the way up to 99.991% (2 errors in 22,786). DSPAM is currently effective as both a server-side agent for UNIX email servers and a developer's library for mail clients, other anti-spam tools, and similar projects requiring drop-in spam filtering. DSPAM has been implemented on many large and small scale systems with the largest systems being reported at about 125,000 mailboxes.
66 lines
1.2 KiB
Bash
66 lines
1.2 KiB
Bash
#!@RCD_SCRIPTS_SHELL@
|
|
#
|
|
# $NetBSD: dspam.sh,v 1.1.1.1 2010/03/10 19:12:52 marttikuparinen Exp $
|
|
#
|
|
|
|
# PROVIDE: dspam
|
|
# REQUIRE: SERVERS
|
|
# BEFORE: DAEMON
|
|
|
|
if [ -f /etc/rc.subr ]; then
|
|
. /etc/rc.subr
|
|
fi
|
|
|
|
name="dspam"
|
|
rcvar="${name}"
|
|
command="@PREFIX@/bin/${name}"
|
|
pidfile="@DSPAM_PIDDIR@/${name}.pid"
|
|
command_args="--daemon > /dev/null 2>&1 &"
|
|
start_precmd="dspam_precmd"
|
|
|
|
dspam_precmd()
|
|
{
|
|
if [ ! -d @DSPAM_PIDDIR@ ]; then
|
|
@MKDIR@ @DSPAM_PIDDIR@
|
|
@CHMOD@ 0770 @DSPAM_PIDDIR@
|
|
@CHOWN@ @DSPAM_USER@ @DSPAM_PIDDIR@
|
|
@CHGRP@ @DSPAM_GROUP@ @DSPAM_PIDDIR@
|
|
fi
|
|
}
|
|
|
|
if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ]; then
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|
|
else
|
|
case ${1:-start} in
|
|
start)
|
|
dspam_precmd
|
|
if [ -x ${command} ]; then
|
|
echo "Starting ${name}."
|
|
eval ${command} ${dspam_flags} ${command_args}
|
|
fi
|
|
;;
|
|
stop)
|
|
if [ -f ${pidfile} ]; then
|
|
pid=`/bin/head -1 ${pidfile}`
|
|
echo "Stopping ${name}."
|
|
kill -TERM ${pid}
|
|
else
|
|
echo "${name} not running?"
|
|
fi
|
|
;;
|
|
restart)
|
|
( $0 stop )
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
status)
|
|
if [ -f ${pidfile} ]; then
|
|
pid=`/bin/head -1 ${pidfile}`
|
|
echo "${name} is running as pid ${pid}."
|
|
else
|
|
echo "${name} is not running."
|
|
fi
|
|
;;
|
|
esac
|
|
fi
|