spamassassin-run(3pm) | User Contributed Perl Documentation | spamassassin-run(3pm) |
spamassassin - simple front-end filtering script for SpamAssassin
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/spamassassin) --cf='config line' Additional line of configuration --pre='config line' Additional line of ".pre" (prepended to configuration) -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-welcomelist Add addresses in mail to persistent address welcomelist --add-to-blocklist Add addresses in mail to persistent address blocklist -R, --remove-from-welcomelist Remove all addresses found in mail from persistent address list --add-addr-to-welcomelist=addr Add addr to persistent address welcomelist --add-addr-to-blocklist=addr Add addr to persistent address blocklist --remove-addr-from-welcomelist=addr Remove addr from persistent address list -4 --ipv4only, --ipv4-only, --ipv4 Use IPv4, disable use of IPv6 for DNS etc. -6 Use IPv6, disable use of IPv4 where possible --progress Print progress bar -D, --debug [area,...] Print debugging messages -V, --version Print version -h, --help Print usage message
spamassassin is a simple front-end filter for SpamAssassin.
Using the SpamAssassin rule base, it uses a wide range of heuristic tests on mail headers and body text to identify "spam", also known as unsolicited bulk email. Once identified, the mail is then tagged as spam for later filtering using the user's own mail user-agent application.
The default tagging operations that take place are detailed in "TAGGING" in spamassassin.
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.
Files compressed with gzip/bzip2/xz/lz4/lzip/lzo are uncompressed automatically. See "Mail::SpamAssassin::ArchiveIterator" for more details.
Please note that SpamAssassin is not designed to scan huge messages. Messages larger than ~10-20MB should not be fed to SpamAssassin, as memory consumption will increase rapidly.
If you run this with -d, the message will first have SpamAssassin markup removed before being tested.
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.)
Add all email addresses, in the headers and body of the mail message read from STDIN, to a persistent address welcomelist. Note that you must be running "spamassassin" or "spamd" with a persistent address list plugin enabled for this to work.
Add all email addresses, in the headers and body of the mail message read from STDIN, to the persistent address blocklist. Note that you must be running "spamassassin" or "spamd" with a persistent address list plugin enabled for this to work.
Remove all email addresses, in the headers and body of the mail message read from STDIN, from a persistent address list. STDIN must contain a full email message, so to remove a single address you should use --remove-addr-from-welcomelist instead.
Note that you must be running "spamassassin" or "spamd" with a persistent address list plugin enabled for this to work.
Add the named email address to a persistent address welcomelist. Note that you must be running "spamassassin" or "spamd" with a persistent address list plugin enabled for this to work.
Add the named email address to a persistent address blocklist. Note that you must be running "spamassassin" or "spamd" with a persistent address list plugin enabled for this to work.
Remove the named email address from a persistent address welcomelist. Note that you must be running "spamassassin" or "spamd" with a persistent address list plugin enabled for this to work.
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.)
spamassassin -t --cf="body NEWRULE /text/" --cf="score NEWRULE 3.0"
spamassassin -t --pre="loadplugin Mail::SpamAssassin::Plugin::Foobar"
spamassassin -D bayes,learn,dns
Use an empty string (-D '') to indicate no areas when the next item on the command line is a path, to prevent the path from being parsed as an area.
Higher priority informational messages that are suitable for logging in normal circumstances are available with an area of "info".
For more information about which areas (also known as channels) are available, please see the documentation at:
L<https://wiki.apache.org/spamassassin/DebugChannels>
sa-learn(1) spamd(1) spamc(1) Mail::SpamAssassin::Conf(3) Mail::SpamAssassin(3)
"Mail::SpamAssassin"
See <https://issues.apache.org/SpamAssassin/>
The SpamAssassin(tm) Project <https://spamassassin.apache.org/>
SpamAssassin is distributed under the Apache License, Version 2.0, as described in the file "LICENSE" included with the distribution.
2024-04-12 | perl v5.38.2 |