Chapter 7. Configuration Files
SpamAssassin uses a number of configuration files and directories. These configuration files specify rules that are used by SpamAssassin to filter spam. The configuration files are distributed across various directories, which are different for standard, site-wide, and user-specific settings. In the following sections, we will discuss the configuration files associated with SpamAssassin.
The configuration files for standard, site-wide, and user-specific settings are saved in different directories as follows:
Standard configuration settings are stored in /usr/share/spamassassin/
Site-wide customizations and settings are stored in /etc/mail/spamassassin/
User-specific settings are stored in ~/.spamassassin/
Standard configuration settings for SpamAssassin are contained in the files that SpamAssassin installs at /usr/share/spamassassin/
. This includes default settings for all SpamAssassin features and a set of standard...
The configuration files for standard, site-wide, and user-specific settings are saved in different directories as follows:
Standard configuration settings are stored in /usr/share/spamassassin/
Site-wide customizations and settings are stored in /etc/mail/spamassassin/
User-specific settings are stored in ~/.spamassassin/
Standard configuration settings for SpamAssassin are contained in the files that SpamAssassin installs at /usr/share/spamassassin/
. This includes default settings for all SpamAssassin features and a set of standard rules and scores. Settings in this directory might be overridden when SpamAssassin is upgraded, so the files in this directory should not be modified.
Site-wide configuration settings are done in /etc/mail/spamassassin/
. SpamAssassin reads every file with a name ending in .cf
and processes it as a SpamAssassin configuration file. By convention, the file /etc/mail/spamassassin/local.cf
is used for...
Standard rule files are placed in /usr/share/spamassassin/
. There is a variety of files in this directory, and the files may change with different releases of SpamAssassin. Barring a few exceptions, names for rules files are generally of the form: nn_description.cf
where nn
is a number, for example 10
or 25
, and description
describes the type of rules, for example dnsbl_tests
or bayes
.
The rules installed by SpamAssassin are version-specific. Custom rules can be defined in files ending in .cf
, and placed in the /etc/mail/spamassassin/
directory, or in ~/.spamassassin/user_prefs
for user-specific rules.
SpamAssassin first reads all the files in /usr/share/spamassassin/
in alphanumerical order; 10_misc.cf
will be read before 23_bayes.cf
. SpamAssassin then reads all the .cf
files in /etc/mail/spamassassin/
, again in alphanumeric order. Finally, SpamAssassin reads ~user/.spamassassin/user_prefs
. If a rule or score is defined in two files, then the setting in the last file read...
SpamAssassin has three levels of configuration: standard, site-level, and user-level. Configuration settings at user-level override those at a site-level, and those at site-level override the standard configuration. Files associated with each of these setting levels are stored in different directories.
Rules and scores are the main elements of SpamAssassin mail filtering. These rules are specified in the files mentioned earlier. They use regex to filter terms or expressions that are typical of spam. Each rule is associated with a positive or negative score. Scores are used to filter spam from ham.