To use the script you would place it in your .qmail file similar to this:
Of course, use the correct path to the script on your system.
I wrote this script (rather than using ifspamh) because I needed a way to delete high scoring messages that could be customized by the end user. In addition, I didn't want to store the full message in memory like ifspamh does.
The following packages are required to be installed and working correctly for the spamassassin.sh to work properly:
- SpamAssassin (of course)
- 822field from DJB’s mess822 package.
- reformail from maildrop package.
- safecat for writing an email message safely to a Maildir mailbox. You will then need the maildir script to call safecat correctly.
The above shell script does rely on one extra program called spam_bounce. This program takes an email address on standard input and returns a numerical limit for that user on standard output. If there is no numerical limit for the supplied email address, it must return 0. The score returned by spam_bounce is used to determine whether to deliver the message or to delete it. Any email messages scored by SpamAssassin higher than the value returned by spam_bounce will be deleted from the user’s mailbox. The default bounce score is defined in spamassassin.sh as 13.75.
I separated the spam_bounce functionality out of the main delivery script because different people would have this spam score limit information stored differently. The simplest method would be to have a shell script that looked up the information is a flat text file. On my system, I have a C program that retrieves the information from a MySQL database where all the SpamAssassin user preferences are stored.
The local rules used by the Flarenet mail server are updated on a daily basis. I’m using a new system where I annotate when each rule was added or modified and why.