Mail::SpamAssassin::Conf - SpamAssassin configuration file
# a comment
rewrite_subject 1
full PARA_A_2_C_OF_1618 /Paragraph .a.{0,10}2.{0,10}C. of S. 1618/i describe PARA_A_2_C_OF_1618 Claims compliance with senate bill 1618
header FROM_HAS_MIXED_NUMS From =~ /\d+[a-z]+\d+\S*@/i describe FROM_HAS_MIXED_NUMS From: contains numbers mixed in with letters
score A_HREF_TO_REMOVE 2.0
lang es describe FROM_FORGED_HOTMAIL Forzado From: simula ser de hotmail.com
SpamAssassin is configured using some traditional UNIX-style configuration files, loaded from the /usr/share/spamassassin and /etc/mail/spamassassin directories.
The #
character starts a comment, which continues until end of line,
and whitespace in the files is not significant.
Paths can use ~
to refer to the user's home directory.
Where appropriate, default values are listed in parentheses.
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 is OK. Multiple whitelist_from
lines is also
OK.
whitelist_from
.
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.
n.nn
can
be an integer or a real number.
SYMBOLIC_TEST_NAME
is the symbolic name used by
SpamAssassin as a handle for that test; for example, 'FROM_ENDS_IN_NUMS'.
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.
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:
So to simply allow all character sets through without giving them points, use
ok_locales ja ko ru th zh
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.
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:
10_misc.cf
configuration file in
/usr/share/spamassassin
for an example.
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.
These settings differ from the ones above, in that they are considered
'privileged'. Only users running spamassassin
from their procmailrc's or
forward files, or sysadmins editing a file in /etc/mail/spamassassin
, can
use them. spamd
users cannot use them in their user_prefs
files, for
security and efficiency reasons.
SYMBOLIC_TEST_NAME
is a symbolic test name, such as
'FROM_ENDS_IN_NUMS'. header
is the name of a mail header, such as
'Subject', 'To', etc. 'ALL' can be used to mean the text of all the message's
headers.
op
is either =~
(contains regular expression) or !~
(does not contain
regular expression), and pattern
is a valid Perl regular expression, with
modifiers
as regexp modifiers in the usual style.
If the [if-unset: STRING]
tag is present, then STRING
will
be used if the header is not found in the mail message.
name_of_eval_method
is the name of
a method on the Mail::SpamAssassin::EvalTests
object. arguments
are optional arguments to the function call.
pattern
is a Perl regular expression.
The 'body' in this case is the textual parts of the message body; any non-text MIME parts are stripped, and the message decoded from Quoted-Printable or Base-64-encoded format if necessary. All HTML tags and line breaks will be removed before matching.
pattern
is a Perl regular expression.
The 'raw body' of a message is the text, including all textual parts. The text will be decoded from base64 or quoted-printable encoding, but HTML tags and line breaks will still be present.
pattern
is a Perl regular expression.
The 'full body' of a message is the un-decoded text, including all parts
(including images or other attachments). SpamAssassin no longer tests
full tests against decoded text; use rawbody
for that.
~/razor.conf
.
~/.spamassassin
directory with mode 0700, but for system-wide
SpamAssassin use, you may want to share this across all users.
DBI:mysql:spamassassin:localhost
A line starting with the text lang xx
will only be interpreted
if the user is in that locale, allowing test descriptions and
templates to be set for that language.
Mail::SpamAssassin
spamassassin
spamd