How do I train SpamAssassin to improve its recognition of spam (unwanted mail) and ham (desirable mail)?

In order for SpamAssassin to be accurate, you must train it on your specific mail patterns. SpamAssassin has a Bayesian classifier that can be used to help refine the classification of spam mail. The sa-learn interface allows you to train SpamAssassin to recognize good mail and junk mail.

You need to train with both spam and ham mails. One type of mail alone will not have any effect.

To filter for spam:

  1. Save spam into a new mail folder called Spam
  2. Save non-spam (ham) into a new folder called Ham. You may also put messages that were marked as spam by mistake into this folder.

The Mathematics mail server will periodically check this mailbox and run the sa-learn command on the messages it sees.
You must name the folders Spam and/or Ham, case-sensitive. If not, your messages will not automatically be checked.

Depending on how much mail you have in the mailbox you are training on, it can take several minutes or more to train it. Also you need to train it on at least 200 spams and 200 hams before it will start to use that information in scoring your email.

For more information, refer to the links below:
Filtering your Spam