Setting up SpamAssassin on ibiblio for the first time
Originally by Fred Stutzman (maintainer)
updated December 2006 by ibiblio staff due to system changes.
- You'll need to log into your ibiblio account. If you need help with that, please see our F.A.Q.
- In your home directory, you'll need to create or edit your .forward file (we'll use nano here, but any text editor will work).
$ nano ~/.forward
Copy/paste the following entry in the .forward file, including the pipe symbol (the vertical bar):
| /usr/bin/procmail
Save the .forward file by hitting control-X and answering "yes" to confirm. Next, edit your .procmailrc file:
$ nano ~/.procmailrc
Place the following rules in your .procmailrc file.
:0fw
| /usr/bin/spamc
:0:
* ^X-Spam-Status: Yes
$HOME/mail/caughtspam
The first section sends your messages through "spamc",
the spamassassin client software. The second block stores mail
that is marked as spam into a mailbox file named "caughtspam" in your mail folder.
ibiblio has enabled network-based spam tests on it's mail server, so you should simply be able to walk away and get pretty good spam filtering. If you really want to dig more, follow on to step 3.
- You can do a lot with both spamassassin and procmail with regards to
defeating spam. We urge you to read the documentation for both Spamassassin and Procmail,
Your user-configurable Spamassassin directives will be located in the
created directory .spamassassin, in your home directory.
Inside the .spamassassin directory you will see the following files:
.spamassassin/user_prefs
.spamassassin/bayes_toks
.spamassassin/bayes_seen
The user-configurable file is user_prefs. The other two files are
your personal bayesian filtering database. We'll learn a little
bit about both.
First, the user_prefs file. Spamassassin works by assigning
points to the the message, if the message has enough spam points, it
gets marked as spam and moved to your caughtspam folder. But what
if you're still getting a lot of spam?
You can lower your spam tolerance level by changing required_hits to something lower
than 5. Don't forget to remove the # before required_hits! The # character
comments out the line, telling spamassassin to ignore it.
You can add score blocks to your spamassassin configuration. For a full list of score blocks,
check here. Please note that the network-based checks already enabled should be more than sufficient to tag most spam as such, and that further rules will only serve to drive up the load on our mail server and our filer. Please add additional checks sparingly.
Be sure to check your syntax after any changes to your SpamAssassin configuration:
$ spamassassin --lint
This command will print out any errors in your configuration file. If there are no errors it will simply return a prompt.
Finally, you can implement a Bayesian strategy to handle spam. To
do this, start saving all of your spam into a folder you create,
possibly called something like 'learnspam'. Then, from time to
time, you can run the following command on login.ibiblio.org.
(Note, this command assumes that you are saving spam to a learnspam
'folder' in your mail directory. Once you accumulate spam, you
can the following command:
$ sa-learn --spam --mbox ~/mail/learnspam