The following directives can be inserted into your user_prefs
file to customize how spamassassin treats email messages that it evaluates for
you:
- whitelist_from add@ress.com
-
Used to specify addresses which send mail that is often tagged (incorrectly) as
spam; it also helps if they are addresses of big companies with lots of
lawyers. This way, if spammers impersonate them, they'll get into big trouble,
so it doesn't provide a shortcut around SpamAssassin.
Whitelist and blacklist addresses are now file-glob-style patterns, so
friend@somewhere.com, *@isp.com, or *.domain.net will all work.
Regular expressions are not used for security reasons.
Multiple addresses per line, separated by spaces, is OK. Multiple whitelist_from lines is also
OK.
eg. whitelist_from joe@example.com fred@example.com whitelist_from simon@example.com
- unwhitelist_from
add@ress.com
-
Used to override a default whitelist_from entry, so for example a distribution whitelist_from
can be overriden in a local.cf file, or an individual user can override a whitelist_from entry
in their own .user_prefs file.
eg. unwhitelist_from joe@example.com fred@example.com unwhitelist_from
*@amazon.com
- blacklist_from add@ress.com
-
Used to specify addresses which send mail that is often tagged (incorrectly) as
non-spam, but which the user doesn't want. Same format as
whitelist_from.
- unblacklist_from
add@ress.com
-
Used to override a default blacklist_from entry, so for example a distribution blacklist_from
can be overriden in a local.cf file, or an individual user can override a blacklist_from entry
in their own .user_prefs file.
eg. unblacklist_from joe@example.com fred@example.com unblacklist_from
*@spammer.com
- whitelist_to add@ress.com
-
If the given address appears in the
To: or Cc: headers, mail will be
whitelisted. Useful if you're deploying SpamAssassin system-wide, and don't
want some users to have their mail filtered. Same format as whitelist_from.
There are three levels of To-whitelisting, whitelist_to, more_spam_to
and all_spam_to. Users in the first level may still get some spammish
mails blocked, but users in all_spam_to should never get mail blocked.
- more_spam_to add@ress.com
-
See above.
- all_spam_to add@ress.com
-
See above.
- required_hits n.nn (default: 5)
-
Set the number of hits required before a mail is considered spam.
n.nn can
be an integer or a real number.
- score SYMBOLIC_TEST_NAME n.nn
- Assign a score to a given test. Scores can be positive or negative real numbers
or integers.
SYMBOLIC_TEST_NAME is the symbolic name used by
SpamAssassin as a handle for that test; for example, 'FROM_ENDS_IN_NUMS'.
- rewrite_subject { 0 | 1 } (default: 1)
-
By default, the subject lines of suspected spam will be tagged. This can be
disabled here.
- spam_level_stars { 0 | 1 } (default: 1)
-
By default, a header field called ``X-Spam-Level'' will be added to the message,
with its value set to a number of asterisks equal to the score of the message.
In other words, for a message scoring 7.2 points:
X-Spam-Level: *******
This can be useful for MUA rule creation.
- spam_level_char { x (some character, unquoted) } (default: *)
-
By default, the ``X-Spam-Level'' header will use a '*' character
with its length equal to the score of the message.
In other words, for a message scoring 7.2 points with this option set to .
X-Spam-Level: .......
Some people don't like escaping *'s though, so you can set the character to anything with this option.
- subject_tag STRING ... (default: *****SPAM*****)
-
Text added to the
Subject: line of mails that are considered spam,
if rewrite_subject is 1. _HITS_ in the tag will be replace with the calculated
score for this message. _REQD_ will be replaced with the threshold.
- report_header { 0 | 1 } (default: 0)
-
By default, SpamAssassin will include its report in the body of suspected spam.
Enabling this causes the report to go in the headers instead. Using
'use_terse_report' with this is recommended.
- use_terse_report { 0 | 1 } (default: 0)
-
By default, SpamAssassin uses a fairly long report format. Enabling this uses
a shorter format which includes all the information in the normal one, but
without the superfluous explanations.
- defang_mime { 0 | 1 } (default: 1)
-
By default, SpamAssassin will change the Content-type: header of suspected spam
to ``text/plain''. This is a safety feature. If you prefer to leave the
Content-type header alone, set this to 0.
- skip_rbl_checks { 0 | 1 } (default: 0)
-
By default, SpamAssassin will run RBL checks. If your ISP already does this
for you, set this to 1.
- check_mx_attempts n (default: 3)
-
By default, SpamAssassin checks the From: address for a valid MX three times,
waiting 5 seconds each time.
- check_mx_delay n (default 5)
-
How many seconds to wait before retrying an MX check.
- ok_languages xx [ yy zz ... ] (default: all)
-
Which languages are considered OK to receive mail from. Mail using
character sets used by these languages will not be marked as possibly
being spam in an undesired language.
The following languages are recognized. In your configuration, you must
use the language specifier located in the first column, not the English
name for the language. You may also specify ``all'' if your language is
not listed or if you want to allow any language.
- af afrikaans
-
- am amharic
-
- ar arabic
-
- be byelorussian
-
- bg bulgarian
-
- bs bosnian
-
- ca catalan
-
- cs czech
-
- cy welsh
-
- da danish
-
- de german
-
- el greek
-
- en english
-
- eo esperanto
-
- es spanish
-
- et estonian
-
- eu basque
-
- fa persian
-
- fi finnish
-
- fr french
-
- fy frisian
-
- ga irish
-
- gd scots
-
- he hebrew
-
- hi hindi
-
- hr croatian
-
- hu hungarian
-
- hy armenian
-
- id indonesian
-
- is icelandic
-
- it italian
-
- ja japanese
-
- ka georgian
-
- ko korean
-
- la latin
-
- lt lithuanian
-
- lv latvian
-
- mr marathi
-
- ms malay
-
- ne nepali
-
- nl dutch
-
- no norwegian
-
- pl polish
-
- pt portuguese
-
- qu quechua
-
- rm rhaeto-romance
-
- ro romanian
-
- ru russian
-
- sa sanskrit
-
- sco scots
-
- sk slovak
-
- sl slovenian
-
- sq albanian
-
- sr serbian
-
- sv swedish
-
- sw swahili
-
- ta tamil
-
- th thai
-
- tl tagalog
-
- tr turkish
-
- uk ukrainian
-
- vi vietnamese
-
- yi yiddish
-
- zh chinese
-
Note that the language cannot always be recognized. In that case, no
points will be assigned.
- rbl_timeout n (default 30)
-
All RBL queries are started at the beginning and we try to read the results
at the end. In case some of them are hanging or not returning, you can specify
here how long you're willing to wait for them before deciding that they timed
out
- ok_locales xx [ yy zz ... ] (default: en)
-
Which locales (country codes) are considered OK to receive mail from. Mail
using character sets used by languages in these countries, will not be marked
as possibly being spam in a foreign language.
SpamAssassin will try to determine the local locale, in order to determine
which charsets should be allowed by default, but on some OSes it may not be
able to do this effectively, requiring customisation.
All ISO-8859-* character sets, and Windows code page character sets, are
already permitted by default.
The following locales use additional character sets, and are supported:
- ja
-
Japanese
- ko
-
Korea
- ru
-
Cyrillic charsets
- th
-
Thai
- zh
-
Chinese (both simplified and traditional)
To simply allow all character sets through without giving them points, use
ok_locales all
- auto_whitelist_factor n (default: 0.5, range [0..1])
-
How much towards the long-term mean for the sender to regress a message. Basically,
the algorithm is to track the long-term mean score of messages for the sender (
mean),
and then once we have otherwise fully calculated the score for this message (score),
we calculate the final score for the message as:
finalscore = score + (mean - score) * factor
So if factor = 0.5, then we'll move to half way between the calculated score and the mean.
If factor = 0.3, then we'll move about 1/3 of the way from the score toward the mean.
factor = 1 means just use the long-term mean; factor = 0 mean just use the calculated score.
- describe SYMBOLIC_TEST_NAME description ...
-
Used to describe a test. This text is shown to users in the detailed report.
- report ...some text for a report...
-
Set the report template which is attached to spam mail messages. See the
10_misc.cf configuration file in /usr/share/spamassassin for an
example.
If you change this, try to keep it under 76 columns (inside the the dots
below). Bear in mind that EVERY line will be prefixed with ``SPAM: '' in order
to make it clear what's been added, and allow other filters to remove
spamfilter modifications, so you lose 6 columns right there. Each report
line appends to the existing template, so use clear-report-template to
restart.
The following template items are supported, and will be filled out by
SpamAssassin:
- _HITS_: the number of hits the message triggered
-
- _REQD_: the required hits to be considered spam
-
- _SUMMARY_: the full details of what hits were triggered
-
- _VER_: SpamAssassin version
-
- _HOME_: SpamAssassin home URL
-
- clear_report_template
-
Clear the report template.
- terse_report ...some text for a report...
-
Set the report template which is attached to spam mail messages, for the
terse-report format. See the
10_misc.cf configuration file in
/usr/share/spamassassin for an example.
- clear-terse-report-template
-
Clear the terse-report template.
- spamtrap ...some text for spamtrap reply mail...
-
A template for spam-trap responses. If the first few lines begin with
Xxxxxx: yyy where Xxxxxx is a header and yyy is some text, they'll be used
as headers. See the 10_misc.cf configuration file in
/usr/share/spamassassin for an example.
- clear_spamtrap_template
-
Clear the spamtrap template.
- dcc_body_max NUMBER
-
- dcc_fuz1_max NUMBER
-
- dcc_fuz2_max NUMBER
-
DCC (Distributed Checksum Clearinghouse) is a system similar to Razor.
This option sets how often a message's body/fuz1/fuz2 checksum must have been
reported to the DCC server before SpamAssassin will consider the DCC check as
matched.
As nearly all DCC clients are auto-reporting these checksums you should set
this to a relatively high value, e.g. 999999 (this is DCC's MANY count).
The default is 999999 for all these options.
- dcc_add_header { 0 | 1 } (default: 0)
-
DCC processing creates a message header containing the statistics for the
message. This option sets whether SpamAssassin will add the heading to
messages it processes.
The default is to not add the header.
- dcc_timeout n (default: 10)
-
How many seconds you wait for dcc to complete before you go on without
the results
- num_check_received { integer } (default: 2)
-
How many received lines from and including the original mail relay
do we check in RBLs (you'd want at least 1 or 2).
Note that for checking against dialup lists, you can call check_rbl
with a special set name of ``set-firsthop'' and this rule will only
be matched against the first hop if there is more than one hop, so
that you can set a negative score to not penalize people who properly
relayed through their ISP.
See dialup_codes for more details and an example
- dialup_codes { ``domain1'' => ``127.0.x.y'', ``domain2'' => ``127.0.a.b'' }
-
Default:
{ ``dialups.mail-abuse.org.'' => ``127.0.0.3'',
# For DUL + other codes, we ignore that it's on DUL
``rbl-plus.mail-abuse.org.'' => ``127.0.0.2'',
``relays.osirusoft.com.'' => ``127.0.0.3'' };
WARNING!!! When passing a reference to a hash, you need to put the whole hash in
one line for the parser to read it correctly (you can check with spamassassin -D
< mesg)
Set this to what your RBLs return for dialup IPs
It is used by dialup-firsthop and relay-firsthop rules so that you can match
DUL codes and compensate DUL checks with a negative score if the IP is a dialup
IP the mail originated from and it was properly relayed by a hop before reaching
you (hopefully not your secondary MX :-D)
The trailing ``-firsthop'' is magic, it's what triggers the RBL to only be run
on the originating hop
The idea is to not penalize (or penalize less) people who properly relayed
through their ISP's mail server
Here's an example showing the use of Osirusoft and MAPS DUL, as well as the use
of check_two_rbl_results to compensate for a match in both RBLs
| header RCVD_IN_DUL | rbleval:check_rbl('dialup', 'dialups.mail-abuse.org.')
|
| describe RCVD_IN_DUL | Received from dialup, see http://www.mail-abuse.org/dul/
|
| score RCVD_IN_DUL | 4 |
| header X_RCVD_IN_DUL_FH | rbleval:check_rbl('dialup-firsthop', 'dialups.mail-abuse.org.')
|
| describe X_RCVD_IN_DUL_FH | Received from first hop dialup, see http://www.mail-abuse.org/dul/
|
| score X_RCVD_IN_DUL_FH | -3 |
header RCVD_IN_OSIRUSOFT_COM rbleval:check_rbl('osirusoft', 'relays.osirusoft.com.')
describe RCVD_IN_OSIRUSOFT_COM Received via an IP flagged in relays.osirusoft.com
header X_OSIRU_SPAM_SRC rbleval:check_rbl_results_for('osirusoft', '127.0.0.4')
describe X_OSIRU_SPAM_SRC DNSBL: sender is Confirmed Spam Source, penalizing further
score X_OSIRU_SPAM_SRC 3.0
header X_OSIRU_SPAMWARE_SITE rbleval:check_rbl_results_for('osirusoft', '127.0.0.6')
describe X_OSIRU_SPAMWARE_SITE DNSBL: sender is a Spamware site or vendor, penalizing further
score X_OSIRU_SPAMWARE_SITE 5.0
| header X_OSIRU_DUL_FH | rbleval:check_rbl('osirusoft-dul-firsthop', 'relays.osirusoft.com.')
|
| describe X_OSIRU_DUL_FH | Received from first hop dialup listed in relays.osirusoft.com
|
| score X_OSIRU_DUL_FH | -1.5 |
| header Z_FUDGE_DUL_MAPS_OSIRU | rblreseval:check_two_rbl_results('osirusoft', ``127.0.0.3'', 'dialup', ``127.0.0.3'')
|
| describe Z_FUDGE_DUL_MAPS_OSIRU | Do not double penalize for MAPS DUL and Osirusoft DUL
|
| score Z_FUDGE_DUL_MAPS_OSIRU | -2 |
| header Z_FUDGE_RELAY_OSIRU | rblreseval:check_two_rbl_results('osirusoft', ``127.0.0.2'', 'relay', ``127.0.0.2'')
|
| describe Z_FUDGE_RELAY_OSIRU | Do not double penalize for being an open relay on Osirusoft and another DNSBL
|
| score Z_FUDGE_RELAY_OSIRU | -2 |
| header Z_FUDGE_DUL_OSIRU_FH | rblreseval:check_two_rbl_results('osirusoft-dul-firsthop', ``127.0.0.3'', 'dialup-firsthop', ``127.0.0.3'')
|
| describe Z_FUDGE_DUL_OSIRU_FH | Do not double compensate for MAPS DUL and Osirusoft DUL first hop dialup
|
| score Z_FUDGE_DUL_OSIRU_FH | 1.5 |