spamassassin - mail filter to identify spam using text analysis
spamassassin [options] [ < mailmessage | path ... ]
spamassassin -d [ < mailmessage | path ... ]
spamassassin -r [ < mailmessage | path ... ]
spamassassin -k [ < mailmessage | path ... ]
spamassassin -W|-R [ < mailmessage | path ... ]
Options:
-L, --local Local tests only (no online tests) -r, --report Report message as spam -k, --revoke Revoke message as spam -d, --remove-markup Remove spam reports from a message -C path, --configpath=path, --config-file=path Path to standard configuration dir -p prefs, --prefspath=file, --prefs-file=file Set user preferences file --siteconfigpath=path Path for site configs (def: /etc/mail/spamassassin) -x, --nocreate-prefs Don't create user preferences file -e, --exit-code Exit with a non-zero exit code if the tested message was spam --mbox read in messages in mbox format --mbx read in messages in UW mbx format -t, --test-mode Pipe message through and add extra report to the bottom --lint Lint the rule set: report syntax errors -W, --add-to-whitelist Add addresses in mail to whitelist (AWL) --add-to-blacklist Add addresses in mail to blacklist (AWL) -R, --remove-from-whitelist Remove all addresses found in mail from whitelist (AWL) --add-addr-to-whitelist=addr Add addr to whitelist (AWL) --add-addr-to-blacklist=addr Add addr to blacklist (AWL) --remove-addr-from-whitelist=addr Remove addr from whitelist (AWL) -D, --debug [area=n,...] Print debugging messages -V, --version Print version -h, --help Print usage message
SpamAssassin is a mail filter to identify spam using text analysis and several internet-based realtime blacklists.
Using its rule base, it uses a wide range of heuristic tests on mail headers and body text to identify ``spam'', also known as unsolicited commercial email.
Once identified, the mail is then tagged as spam for later filtering using the user's own mail user-agent application.
SpamAssassin also includes support for reporting spam messages to collaborative filtering databases, such as Vipul's Razor ( http://razor.sourceforge.net/ ).
The default tagging operations that take place are detailed in TAGGING.
By default, message(s)
are read in from STDIN (< mailmessage), or
from specified files and directories (path ...) STDIN and files
are assumed to be in file format, with a single message per file.
Directories are assumed to be in a format where each file in the directory
contains only one message (directories are not recursed and filenames
containing whitespace or beginning with ``.'' or ``,'' are skipped).
The options --mbox and --mbx can override the assumed format,
see the appropriate OPTION information below.
If you run this with -d, the message will first have SpamAssassin markup removed before being tested.
If you run tests with the auto-whitelist enabled, the score result will be added to the AWL. This may not be what you want to do. If it is not, then disable the auto-whitelist.
http://www.rhyolite.com/anti-spam/dcc/
, Pyzor
http://pyzor.sourceforge.net/
, Vipul's Razor
http://razor.sourceforge.net/
, and SpamCop http://www.spamcop.net/
.
If the message contains SpamAssassin markup, the markup will be stripped
out automatically before submission. The support modules for DCC, Pyzor,
and Razor must be installed for spam to be reported to each service.
SpamCop reports will have greater effect if you register and set the
spamcop_to_address
option.
The message will also be submitted to SpamAssassin's learning systems;
currently this is the internal Bayesian statistical-filtering system (the
BAYES rules). (Note that if you only want to perform statistical
learning, and do not want to report mail to third-parties, you should use
the sa-learn
command directly instead.)
Revocation support for the Distributed Checksum Clearinghouse, Pyzor, and SpamCop is not currently available.
If the message contains SpamAssassin markup, the markup will be stripped out automatically before submission. The support modules for Razor must be installed for spam to be revoked from the service.
The message will also be submitted as 'ham' (non-spam) to SpamAssassin's
learning systems; currently this is the internal Bayesian
statistical-filtering system (the BAYES rules). (Note that if you only
want to perform statistical learning, and do not want to report mail to
third-parties, you should use the sa-learn
command directly instead.)
spamassassin
or spamd
with the auto-whitelist enabled for this
to work.
spamassassin
or spamd
with the auto-whitelist enabled.
Note that you must be running spamassassin
or spamd
with the
auto-whitelist enabled.
spamassassin
or spamd
with the auto-whitelist
enabled.
spamassassin
or spamd
with the auto-whitelist enabled.
spamassassin
or spamd
with the auto-whitelist
enabled.
Note that SpamAssassin's network rules are run in parallel. This can cause overhead in terms of the number of file descriptors required if --local is not used; it is recommended that the minimum limit on fds be raised to at least 256 for safety.
(Note: the message will not be exactly identical; some headers will be reformatted due to some features of the Mail::Internet package, but the body text will be.)
/usr/share/spamassassin
or similar).
/etc/mail/spamassassin
or similar).
$HOME/.spamassassin/user_prefs
).
spamassassin -D rulesrun=255
message(s)
are in mbox format. mbox is a standard
Unix message folder format.
message(s)
are in UW .mbx format. mbx is
the mailbox format used within the University of Washington's IMAP
implementation; see http://www.washington.edu/imap/
.
The rule base, text templates, and rule description text are loaded from the configuration files.
By default, configuration data is loaded from the first existing directory in: /home/jm/perl584/share/spamassassin; /home/jm/perl584/share/spamassassin; /usr/local/share/spamassassin; /usr/share/spamassassin .
Site-specific configuration data is used to override any values which had already been set. This is loaded from the first existing directory in: /home/jm/perl584/etc/mail/spamassassin; /home/jm/perl584/etc/mail/spamassassin; /home/jm/perl584/etc/spamassassin; /usr/local/etc/spamassassin; /usr/pkg/etc/spamassassin; /usr/etc/spamassassin; /etc/mail/spamassassin; /etc/spamassassin .
Spamassassin will read *.cf in these directories, in alphanumeric order within each directory (similar to SysV-style startup scripts). In other words, it will read 10_misc.cf before 50_scores.cf and 20_body_tests.cf before 20_head_test.cf. Options in later files will override earlier files.
The user preferences (such as scores to attach to each rule), are loaded from
the file specified in the -p argument. If this is not specified,
~/.spamassassin/user_prefs is used if it exists. spamassassin
will
create this file if it does not exist, using user_prefs.template as a
template. This file will be looked for in:
/home/jm/perl584/etc/mail/spamassassin;
/home/jm/perl584/etc/mail/spamassassin;
/home/jm/perl584/share/spamassassin;
/etc/spamassassin;
/etc/mail/spamassassin;
/usr/local/share/spamassassin;
/usr/share/spamassassin.
The following two sections detail the tagging that takes place for messages.
Note that if you use the -t argument, all mails will be tagged as if they are spam messages.
If an incoming message is tagged as spam, instead of modifying the original message, SpamAssassin will create a new report message and attach the original message as a message/rfc822 MIME part (ensuring the original message is completely preserved and easier to recover).
The new report message inherits the following headers (if they are present) from the original spam message:
rewrite_header
option is given.
And (by default) these headers are added:
Yes, score=nn required=nn tests=xxx,xxx
autolearn=(ham|spam|no|unavailable|failed)
is set in this header to
reflect the filter status.
YES
.
Please note that the headers that added are now fully configurable via the add_header option. Please see the manpage for Mail::SpamAssassin::Conf(3) for more information.
No, score=nn required=nn tests=xxx,xxx
autolearn=(ham|spam|no|unavailable|failed)
is set in this header to
reflect the filter status.
Added headers are fully configurable via the add_header configuration option. Please see the manpage for Mail::SpamAssassin::Conf(3) for more information.
The spamassassin command is part of the Mail::SpamAssassin Perl module.
Install this as a normal Perl module, using perl -MCPAN -e shell
, or by
hand.
For further details on how to install, please read the INSTALL
file
from the SpamAssassin distribution.
sa-learn(1)
spamd(1)
spamc(1)
Mail::SpamAssassin::Conf(3)
Mail::SpamAssassin(3)
Mail::SpamAssassin
See <http://bugzilla.spamassassin.org/>
The SpamAssassin(tm)
Project <http://spamassassin.apache.org/>
SpamAssassin is distributed under the Apache License, Version 2.0, as
described in the file LICENSE
included with the distribution.