wallyrp
Here's an older version.
http://www.sonoracomm.com/index.php?option=com_content&task=view&id=49&Itemid=32Spam Filter Configuration for SME 7
This is a quick configuration howto, not an in-depth look at SpamAssassin. Much more can be done
beyond this document, but this will take a big dent out of your spam and free up CPU cycles on your server.
See 'More Information' at the end.
SpamAssassin
The following command will enable the default blacklists, enable the bayesian learning filter and set
thresholds for the bayesian filter.
rpm -Uvh
http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/smeserver-spamassassin-features-0.0.2-0.noarch.rpm
Server-Manager
Using the Server-Manager Configuration/E-Mail panel, adjust the settings to these reasonable defaults.
Virus scanning Enabled
Spam filtering Enabled
Spam sensitivity Custom
Custom spam tagging level 5
Custom spam rejection level 12
Sort spam into junkmail folder Enabled
Modify subject of spam messages Enabled
I would also recommend blocking all executable content. To do so, select (highlight) all of the attachment
types other than zip files (the last two).
Click Save.
How It Works
With this configuration, the spammiest messages, those marked as 12 or above, will be rejected at the
SMTP level. Those spam messages marked between 5 and 12, will be routed to the users' (IMAP)
junkmail folder. This is done so the users can check for false-positives...valid messages that were
classified as spam by SpamAssassin.
Users may check their junkmail folders for false-positives via webmail, or, if they are using an IMAP mail
client, by simply checking the junkmail folder exposed by their mail client.
https://servername/webmail Tweaking
The server will automatically delete old spam in the junkmail folders after 90 days. You can control the
number of days old spam is kept with the following commands. Where 15 is the number of days you want
to keep messages, do...
db configuration setprop spamassassin MessageRetentionTime 15
signal-event email-update
svc -t /service/qpsmtpd
then
config show spamassassin
If you think you are losing misclassified mail, adjust the 'Custom spam rejection level' higher.
If too much spam is making through to your inbox, carefully adjust the 'Custom spam tagging level' down.
Many people use the level 4.
If too much spam is building up in your (IMAP) junkmail folder, adjust the 'Custom spam rejection level'
down or change the number of days spam is kept in the junkmail folder before being automatically delete
by the server.
Bayesian (Learning) Filter
Install the LearnAsSpam.pl, (optional) mailstats and sa-update scripts, then configure nightly cron jobs like this:
cd /usr/bin
wget
http://mirror.contribs.org/smeserver/contribs//bread/mailstats/LearnAsSpam.pl
wget
http://mirror.contribs.org/smeserver/contribs//bread/mailstats/spamfilter-stats-7.pl
cd /etc/cron.d
wget
http://mirror.contribs.org/smeserver/contribs//bread/mailstats/LearnAsSpam.cron
wget
http://mirror.contribs.org/smeserver/contribs//bread/mailstats/mailstats.cron
cd /etc/cron.daily
wget
http://mirror.contribs.org/smeserver/contribs//bread/mailstats/sa-update
chmod +x sa-update
/etc/rc.d/init.d/crond restart
Be sure to enter the wget lines as one long line.
Using an IMAP mail client, create a new folder called 'LearnAsSpam'. I created mine at the top level, like
'Inbox' for each user that will help train the Bayesian filter. Webmail will work fine for creating this folder,
as well as checking the junkmail (filtered mail or quarantine) folder.
If any spam messages make it past the filter and into your inbox, just move them into the LearnAsSpam
folder. A nightly cron job will process them and delete them for you. This is how you train the Bayesian filter.
Bayesian filtering must receive 200 spam messages before it starts to function, so don't expect
instantaneous results.
Whitelist and Blacklist
If mail comes in and it is misclassified as spam, you can add the sender to the whitelist so that future
messages coming in from that sender are not filtered.
Conversely, you can add a spammer to the blacklist so you never see their spam again.
Add senders (or their entire domains) to the global whitelist with these commands as root:
db spamassassin setprop wbl.global *@vonage.com White
db spamassassin setprop wbl.global *domain2.com White
db spamassassin setprop wbl.global user@domain3.comThis email address is being protected from spam bots, you need Javascript enabled to view it White
db spamassassin setprop wbl.global spammer@spamdomain.comThis email address is being protected from spam bots, you need Javascript enabled to view it Black
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd
Clam Antivirus
Update and check your Clam Antivirus with this command.
freshclam -v
or
freshclam --debug
Verify hourly update checking by viewing the freshclam/current log file via the Server-Manager
View Log Files panel.
More Information
Here is another great howto (URL is all one line).
http://mirror.contribs.org/smeserver//contribs/rmitchell/smeserver/howto/Spam%20blocking%20HOWTO%20
using%20qpsmtpd%20&%20RBL%20for%20sme%20server.htm
Informative URLs:
http://forums.contribs.org/index.php?topic=31278.0 http://forums.contribs.org/index.php?topic=31279.0 http://forums.contribs.org/index.php?topic=32158.0 http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/
http://mirror.contribs.org/smeserver/ contribs/bread/mailstats/
http://wiki.apache.org/spamassassin/BayesInSpamAssassin Enter this command at a console.
perldoc Mail::SpamAssassin::Conf
Last Updated ( Saturday, 12 August 2006 )