Setup SpamAssassin on Plesk without PowerPack/SA Key

After many hours trying to figure this out, I finally found a way to enable spamassassin on a Plesk 8 box without buying the PowerPack or the SpamAssassin plugin. For the record, SpamAssassin comes installed with Plesk 8 in every configuration, it’s just not “enabled” for the mail server, Qmail.

My setup: Plesk 8.0 on Fedora Core 4.

This is based on the HOW-TO: setup a PLESK Dedicated Server tutorial.

Special thanks to the all powerful Atomic Rocket Turtle!

First, login to your server with SSH and become root.

Since Plesk moves everything around on us and breaks easily when you mess around, you need to configure yum so you can grab some Plesk pre-configured RPMS:

yum install lynx
lynx -source http://3es.atomicrocketturtle.com/installers/atomic.sh | sh

# now build your qmail-scanner-queue.pl file:
/usr/bin/qmail-scanner-reconfigure

Until I figure out how to make qmail-scanner play nice with drweb antivirus, you will need to uninstall it - who uses “DrWeb” anyway? Also, you’ll want to install qmail-scanner and clamd. qmail-scanner allows you to break into the qmail process and scan messages for spam, viruses, etc before delivery. clamd is the antivirus scanning daemon for ClamAV.

yum remove drweb-qmail drweb
yum install qmail-scanner clamd

Hit ‘y’ for yes - you want to download and install all the dependencies.

Now you should be all setup! Whew! That was easy.

Now you should send yourself the EICAR test virus to see if ClamAV is working.

Check /usr/local/psa/var/log/maillog to see if spamd is checking your mail (spamassassin):

Jan 23 17:42:42 216-55-149-29 spamd[2974]: connection from localhost.localdomain [127.0.0.1] at port 36138
Jan 23 17:42:42 216-55-149-29 spamd[2974]: info: setuid to qscand succeeded
Jan 23 17:42:42 216-55-149-29 spamd[2974]: Creating default_prefs [/var/spool/qscan/.spamassassin/user_prefs]
Jan 23 17:42:42 216-55-149-29 spamd[2974]: Created user preferences file: /var/spool/qscan/.spamassassin/user_prefs
Jan 23 17:42:42 216-55-149-29 spamd[2974]: processing message <00m94g5gf2f73f9b@users.sourceforge.net> for qscand:10003.
Jan 23 17:42:43 216-55-149-29 spamd[2974]: clean message (-0.0/7.0) for qscand:10003 in 1.4 seconds, 394 bytes.
Jan 23 17:42:43 216-55-149-29 spamd[2974]: result: .  0 - NO_RECEIVED,NO_RELAYS scantime=1.4,size=394,mid=<00m94g5gf2f73f9b@users.sourceforge.net>,autolearn=ham

And you can check /var/log/clamav/clamd.log to make sure ClamAV AntiVirus is working:

Tue Jan 23 20:42:51 2007 -> Portable Executable support enabled.
Tue Jan 23 20:42:51 2007 -> Detection of broken executables enabled.
Tue Jan 23 20:42:51 2007 -> Mail files support enabled.
Tue Jan 23 20:42:51 2007 -> Mail: Recursion level limit set to 64.
Tue Jan 23 20:42:51 2007 -> OLE2 support enabled.
Tue Jan 23 20:42:51 2007 -> HTML support enabled.
Tue Jan 23 20:42:51 2007 -> Self checking every 1800 seconds.
Tue Jan 23 20:43:30 2007 -> /tmp/mkt_qs.5057-1169603010/eicar.com: Eicar-Test-Signature FOUND
**Tue Jan 23 20:46:35 2007 -> /var/spool/qscan/tmp/216-55-149-29.dedicated.abac.net11696031957636239/eicar.com: Eicar-Test-Signature FOUND**

You can tell ClamAV to update it’s virus database twice a day like this:

freshclam -d -c 2

stevekamerman

COO @scientiamobile