SpamAssassin Installation and Configuration
Installation
To install SpamAssassin, it’s very simple:
|
|
Configuration
Here’s my configuration file that you can adapt to your needs (/etc/spamassassin/local.cf
):
|
|
Now, we need to enable SpamAssassin to start automatically. For this, in the file /etc/default/spamassassin
, change from:
|
|
to:
|
|
Then, restart SpamAssassin:
|
|
There is also a website that allows you to generate a SpamAssassin configuration.
Adding Spam and Ham
To add Ham or Spam, we’ll insert this into the crontab of the person(s) who want to manage this:
|
|
Alternatively, a small script can also do the job (~/.antispam.sh
):
|
|
This creates two new folders in your mailbox (one for desired emails and one for undesired emails):
- If spam is found in a folder and it is not detected as spam, put it in the Spam folder.
- If an email arrives as spam when it is not, put it in the NoSpam folder to make it valid. This way, SpamAssassin will analyze the email so that next time, it arrives without being detected as spam.
Finally, if your Spam and NoSpam folders don’t exist in your mailboxes:
|
|
But I recommend creating these folders with your regular email client.
FAQ
How can I test if the SPF module is working properly?
Put a simple valid email in sample-nonspam.txt and run this command:
|
|
You should see something like this:
....
debug: registering glue method for check_for_spf_helo_pass
(Mail::SpamAssassin::Plugin::SPF=HASH(0x8d21990))
....
Last updated 15 Mar 2010, 10:17 +0200.