Tag Archives: ASSP

Postfix and AntiSpam Smtp Proxy – ASSP

http://www.howtoforge.com/antispam_smtp_proxy

perl -MCPAN -e shell

install Compress::Zlib
install Digest::MD5
install Email::Valid
install File::ReadBackwards
install Mail::SPF::Query
install Mail::SRS
install Net::DNS
install Sys::Syslog
install Time::HiRes

cd /usr/src/
wget http://downloads.sourceforge.net/project/assp/ASSP%20V2%20multithreading/2.4.1%2014085/ASSP_2.4.1_14085_install.zip
unzip ASSP_2.4.1_14085_install.zip

mkdir -p /usr/share/assp/spam
mkdir /usr/share/assp/notspam
mkdir /usr/share/assp/errors
mkdir /usr/share/assp/errors/spam
mkdir /usr/share/assp/errors/notspam

mv -f assp/* /usr/share/assp
rm -fr ASSP_2.4.1* assp changelog.txt Install.txt MacOSX-launchd.txt quickstart.txt Win32-quickstart-guide.txt
chown -R 0.0 /usr/share/assp
cd /usr/share/assp
perl assp.pl

http://hostname:55555

login: root
password: nospam4me

Server Setup
-> Run ASSP as a Daemon (AsADaemon)
-> SMTP Destination -> 127.0.0.1:25
-> Listen Port -> 192.168.122.1:25
Recipients -> Local Domains -> faix.cz
Relaying -> Accept All Mail (acceptAllMail) -> 192.168.122.|127.0.0.1
Security -> Web Admin Password

/etc/postfix/master.cf
localhost:smtp inet n – n – – smtpd

service postfix restart

/etc/init.d/assp

#########################
#!/bin/sh -e

# Start or stop ASSP (Anti-Spam SMTP Proxy)
#
# Script by Abey Marquez <abeymarquez@gmail.com>
# v1.0.1 Changed 'force-reload' to force a restart if it can't reload the config. Also changed 'restart' to start the proc if not running.
# v1.0.0 I'm not an expert but I tried to make this as LSB compliant as possible. Should work really nice with Ubuntu.

### BEGIN INIT INFO
# Provides: ASSP (Anti-Spam SMTP Proxy)
# Required-Start: $syslog, $local_fs
# Required-Stop: $syslog, $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop ASSP
# Description: Start or stop ASSP (Anti-Spam SMTP Proxy)
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NAME=assp.pl
HOME=/usr/share/assp
DAEMON=$HOME/$NAME
PIDFILE=$HOME/pid
INITSCRIPT=/etc/init.d/assp

. /lib/lsb/init-functions

case "$1" in

start)
log_daemon_msg "Starting ASSP (Anti-Spam SMTP Proxy)" "assp"
start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON 2>&1 > /dev/null --chdir $HOME
log_end_msg $?
;;

stop)
log_daemon_msg "Stopping ASSP (Anti-Spam SMTP Proxy)" "assp"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --chdir $HOME
log_end_msg $?
;;

restart)
if [ -f $PIDFILE ]; then
$0 stop
sleep 1
$0 start
else
$0 start
fi
;;

reload)
log_action_begin_msg "Reloading ASSP (Anti-Spam SMTP Proxy) configuration"
if [ -f $PIDFILE ]; then
if kill -1 $(cat $PIDFILE); then
log_action_end_msg 0
else
log_action_end_msg 1
fi
else
log_action_end_msg 1
exit 1
fi
;;

force-reload)
log_action_begin_msg "Reloading ASSP (Anti-Spam SMTP Proxy) configuration"
if [ -f $PIDFILE ]; then
if kill -1 $(cat $PIDFILE); then
log_action_end_msg 0
else
log_action_cont_msg "Could not reload configuration. Restarting"
$0 restart
fi
else
log_action_cont_msg "Could not reload configuration. Restarting"
$0 restart
fi
;;

status)
status_of_proc $DAEMON "ASSP (Anti-Spam SMTP Proxy)"
;;

*)
log_action_msg "Usage: $INITSCRIPT {start|stop|restart|reload|force-reload|status}"
exit 1
;;

esac
exit 0
####################

chmod 755 /etc/init.d/assp
update-rc.d assp defaults

Have fun with all the options and after a week rebuild the bayes database. Check the directories /usr/share/assp/spam and nospam for wrong entries,
if good mail ends up in the spam directory please move it to the nospam directory and vice versa.