FREE ANTISPAM SOLUTION FOR PLESK LINUX SERVERS WITH QSCANQ-PSA IN THREE EASY STEPS

If for any reason you don't want to install the packages yourself, we can do it for you. The complete setup and testing costs just $30, please contact us for more details.

INTRODUCTION

This solution uses Spamassassin in combination with qscanq-psa. It's very unintrusive and doesn't change the code of your qmail in any way. A small script is used to install and uninstall the antispam addon from your qmail system.

The instructions assume you have a clean Plesk install with qscanq-psa installed. If you have installed other qmail addons or modifications, make sure they are compatible before proceeding. We recommend against using Plesk's implementation of Spamassassin at the same time as ours.

All paths are written as "/some/path" and all commands as 'some command'. Before you start, change your position to a suitable directory, where you will download the files to. For example: 'cd /usr/local/src/antivir'.

PLEASE, READ THE ENTIRE INSTRUCTIONS CAREFULLY! It was tested on several live Red Hat EL 3 and 5 servers with Plesk 7.x and 8.x but it's still at BETA stage. Please use it with care and don't hesitate to send us any comments you might have.

FIRST STEP

1. Install Spamassassin

What this project needs is an existing "/usr/bin/spamc" and spamd running as a daemon. The rest is up to you to configure according to your wishes. The examples for a suitable configuration are given, though.

There are two ways to get Spamassassin. If you wish, you can compile the Spamassassin RPM yourself (it's really easy) and than install it:

1.1 Get it from it's homepage and compile it from source:
1.1.1 'rpmbuild -tb Mail-SpamAssassin-3.2.3.tar.gz'
1.1.2 'cd /usr/src/redhat/RPMS/x86_64/'
1.1.3 'rpm -Uvh spamassassin-3.2.3-1.x86_64.rpm perl-Mail-SpamAssassin-3.2.3-1.x86_64.rpm'.
1.1.3 'cd /usr/local/src/antivir'.

Or if you use Red Hat EL 5 x86_64, you can get our RPMs and install them instead:

1.1 Use wget to fetch them from here and here.
1.1.1 'rpm -Uvh ./spamassassin-3.2.3-1.x86_64.rpm ./perl-Mail-SpamAssassin-3.2.3-1.x86_64.rpm'

SECOND STEP

2. Configure Spamassassin

This instructions assume you have a fresh install of Spamassassin 3.2.x. Other Spamassassin versions might use different config lines.

2.1 The main config file is "/etc/mail/spamassassin/local.cf". Edit it and add or uncomment the line "rewrite_header Subject *****SPAM*****" in order to mark spam subject lines (no quotation marks!).

There are other interesting things you can do here (check the documentation on Spamassassin's homepage), here are some hints:

  • default spam theshold is 5.0 points. If you need to change this, add the line "required_score n.nn", where n.nn is the number of points
  • if you need to disable spamassassin for all email addresses under a domain, add the line "all_spam_to *@domain.com"
  • if you need to disable spamassassin for a single mailbox, add the line "all_spam_to mailbox@domain.com"
  • and last but not least, you can always read it's man page, 'man Mail::SpamAssassin::Conf'

THIRD STEP

3. Modify your qscanq-psa install to incorporate Spamassassin

Here comes the tricky part. This is still at BETA stage, so please follow the instructions carefully. Do not proceed unless you fully understand what you're doing. There are some very important instructions you must follow:

  • do not uninstall or unwrap qscanq-psa before you have uninstalled this Spamassassin addon
  • do not upgrade Plesk before you have uninstalled this addon and unwrapped qscanq-psa

If you don't follow the above instructions, you'll have to fix your qmail install by moving some files arround by the hand or it won't work.

3.1 Use wget to fetch our install script from here.

3.2 Run it like this to get further instructions: './qscanq-psa-spam.sh help'

At this point in time, the options "install", "uninstall", "version" and "help" work, while the option "fixqmail" hasn't been implemented yet.

BASIC USAGE

4. How to see the available commands

4.1 Run the command './qscanq-psa-spam.sh help'.

5. How to start using the qscanq-psa Spamassassin addon

5.1 Run the command './qscanq-psa-spam.sh install'.

Note: your qmail binaries will not be altered in any way. Qmail-queue will be copied elsewhere and replaced so that the mail can be redirected trough Spamassassin daemon before reaching qscanq-psa and qmail.

6. How to stop using the Spamassassin addon

6.1 Run the command './qscanq-psa-spam.sh uninstall'.

FREQUENTLY ASKED QUESTIONS

7. Despite all the warnings, I unwrapped the qscanq-psa before uninstalling the Spamassassin addon. Help!

7.1 As soon as it's implemented, you'll be able to run the command './qscanq-psa-spam.sh fixqmail'. But for now, you'll have to fix it by hand. You'll find backups of your original qmail-queue in "/usr/local/src/antivir/" and also in "/var/qmail/bin/" directory.

8. I need to uninstall qscanq-psa and the spamassassin addon. What's the correct procedure?

8.1 Uninstall the Spamassassin addon, unwrap or uninstall the qscanq-psa. You MUST do it in this order or your qmail install will need a repair.

9. There is a new version of Spamassassin RPM, how do I upgrade?

9.1 Just upgrade the RPMs and restart Spamassassin, don't run the qscanq-psa-spam.sh script again.

10. There is a new version of Plesk, how do I upgrade?

10.1 Unistall the Spamassassin addon, unwrap qscanq-psa, upgrade Plesk, wrap the qscnq-psa, install the Spamassassin addon. You MUST do it in this order or your qmail install will need a manual repair.

11. How do I test if qscanq-psa Spamassassin addon is working?

11.1 Send yourself a GTUBE test e-mail, following the instructions here.

12. How do I completely remove the qscanq-psa Spamassasin addon?

12.1.1 Uninstall it from your qmail system by running './qscanq-psa-spam.sh uninstall'
12.1.2 uninstall the Spamassassin RPMs.

CHANGELOG

  • ::2007-09-07:: updated SpamAssassin to 3.2.3
  • ::2007-01-27:: updated SpamAssassin to 3.1.7
  • ::2006-06-07:: updated SpamAssassin to 3.1.3
  • ::2006-05-29:: updated SpamAssassin to 3.1.2
  • ::2006-03-18:: updated SpamAssassin to 3.1.1
  • ::2005-09-21:: updated SpamAssassin to 3.1.0
  • ::2005-07-20:: updated SpamAssassin to 3.0.4
  • ::2005-03-06:: public beta release, qscanq-psa-spam.sh version 0.9.1
  • ::2005-02-06:: live environment testing started
  • ::2005-01-29:: internal release