SpamAssassin Trainer - Configure user_prefs

SpamAssassin has a configuration file that you should have accessible to you in your CPanel file manager once you've enabled SpamAssassin. The filename is "user_prefs" in the ".spamassassin" folder (notice the '.' at the start) and is actually very simple to build. It's just a plain text file, nothing fancy.

While most of the configuration settings can be set using the CPanel interface, there are a few very important lines that must be manually inserted into the file, otherwise your SpamAssassin training will not function correctly. Because we will be manually changing this file, it's important that you never ever use CPanel to configure SpamAssassin with the "Configure SpamAssassin (needed to rewrite subjects)" button. If you do, you may have to manually change the file again later...

In CPanel:
* click on the File Manager icon
* you should see a folder called /.spamassassin/ -- click the folder icon beside it to move into that folder
* you should have 3 files in there:
- bayes_toks -- this file holds data about various elements it has seen from messages from previous scans; this information includes where the message came from, the route it took to get to you, when the message was sent, who it was from, who it was to, the subject line, other headers, and elements within the body of the message itself
- bayes_seen -- this file holds data about which messages it has looked at in the past
- user_prefs -- this is the configuration file we're going to edit
* if the "bayes_toks" and "bayes_seen" files are missing, have no fear -- training SpamAssassin the first time will create them for you.
* click on "user_prefs" link to change the menu on the upper-right side of the screen
* click on 'edit file' from that menu. Your file MAY look like this:
# SpamAssassin user preferences file.
# See 'perldoc Mail::SpamAssassin::Conf'
# for details of what can be tweaked.
###########################################################################
# How many hits before a mail is considered spam.
# required_hits 5
# Whitelist and blacklist addresses are now file-glob-style patterns, so
# "friend@somewhere.com", "*@isp.com", or "*.domain.net" will all work.
# whitelist_from someone@somewhere.com
# Add your own customised scores for some tests below. The default scores are
# read from the installed spamassassin rules files, but you can override them
# here. To see the list of tests and their default scores, go to
# http://spamassassin.org/tests.html .
#
# score SYMBOLIC_TEST_NAME n.nn
# Speakers of Asian languages, like Chinese, Japanese and Korean, will almost
# definitely want to uncomment the following lines. They will switch off some
# rules that detect 8-bit characters, which commonly trigger on mails using CJK
# character sets, or that assume a western-style charset is in use.
#
# score HTML_COMMENT_8BITS 0
# score UPPERCASE_25_50 0
# score UPPERCASE_50_75 0
# score UPPERCASE_75_100 0

* here is what i have set in MY configuration file, and I recommend everyone use this configuration too:
required_hits 3.5
rewrite_subject 1
subject_tag [SPAM _SCORE(0)_]
# of course, you would replace 'myaccount' below with your actual CPanel Username
bayes_path /home/myaccount/.spamassassin/bayes
bayes_file_mode 0600
bayes_ignore_header X-MailScanner
bayes_ignore_header X-MailScanner-SpamCheck
bayes_ignore_header X-MailScanner-SpamScore
bayes_ignore_header X-MailScanner-Information

* be sure to change 'myaccount' to your actual FTP username for your hosting account!
* save the file and close the window that CPanel opened for you to edit that file.

Note that in CPanel v11, they may restrict the subject rewriting for spam messages, so whether you have "rewrite_subject" set, or have a value for "subject_tag", your messages may only ever get prefixed with ***SPAM*** by Cpanel.