SPAMASSASSIN-RUN(1p)
π spamassassin β NAME π
okay so bestie, welcome to spamassassin, a simple front-end filtering script for SpamAssassin. she's the friendly lil doorway, the whole SpamAssassin engine is behind her β¨
this page lives in the User Contributed Perl Documentation section, SPAMASSASSIN-RUN(1p), and she's the run one β the actual command you type. iykyk π
πΈ SYNOPSIS πΈ
the β¨ shapes β¨ she can take:
spamassassin [options] [ < mailmessage | path ... ]
spamassassin -d [ < mailmessage | path ... ]
spamassassin -r [ < mailmessage | path ... ]
spamassassin -k [ < mailmessage | path ... ]
spamassassin -W|-R [ < mailmessage | path ... ]
π Options π
okay the full menu, no cap, every single one:
-L,--localβ local tests only, no online tests. offline queen energy π§-r,--reportβ report the message as spam-k,--revokeβ revoke the message as spam-d,--remove-markupβ strip the spam reports off a message-C path,--configpath=path,--config-file=pathβ path to the standard configuration dir-p prefs,--prefspath=file,--prefs-file=fileβ set the user preferences file--siteconfigpath=pathβ path for site configs (default:/etc/spamassassin)--cf='config line'β one extra line of configuration--pre='config line'β one extra line of".pre"(prepended right to the front of the configuration) π-x,--nocreate-prefsβ do NOT create the user preferences file-e,--exit-codeβ exit with a non-zero exit code if the tested message was spam--mboxβ read messages in mbox format--mbxβ read messages in UW mbx format-t,--test-modeβ pipe the message through and slap an extra report onto the bottom--lintβ lint the rule set, aka report syntax errors π§-W,--add-to-welcomelistβ add addresses found in the mail to the persistent address welcomelist--add-to-blocklistβ add addresses found in the mail to the persistent address blocklist-R,--remove-from-welcomelistβ remove all addresses found in the mail from the persistent address list--add-addr-to-welcomelist=addrβ add addr to the persistent address welcomelist--add-addr-to-blocklist=addrβ add addr to the persistent address blocklist--remove-addr-from-welcomelist=addrβ remove addr from the persistent address welcomelist--remove-addr-from-blocklist=addrβ remove addr from the persistent address blocklist-u username,--username=usernameβ override the username taken from the runtime environment, used with SQL-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 a progress bar π-D,--debug [area,...]β print debugging messages-V,--versionβ print version-h,--helpβ print usage message
π¦ DESCRIPTION π¦
spamassassin is a simple front-end filter for SpamAssassin. that's it, that's the vibe, she's the little door you knock on π
using the SpamAssassin rule base, she runs a wide range of heuristic tests on your mail headers and body text to sniff out "spam" β also known as unsolicited bulk email. once she's clocked it, the mail gets tagged as spam so your own mail user-agent application can filter it later. main character energy fr fr β¨
the default tagging operations that happen are all written out in "TAGGING" in spamassassin.
by default, message(s) come in from STDIN (< mailmessage), or from the files and directories you name (path ...). STDIN and files are assumed to be in file format, one single message per file. directories are assumed to be in a format where every file in the directory holds only one message β and listen, bestie:
- directories are not recursed π
- filenames containing whitespace are skipped
- filenames beginning with
.or,are skipped too
the --mbox and --mbx options can override that assumed format β peep the OPTION info below for the details π
files compressed with gzip/bzip2/xz/lz4/lzip/lzo get uncompressed automatically, no manual work needed π«Ά. more details live in "Mail::SpamAssassin::ArchiveIterator".
β οΈ okay serious moment β please note that SpamAssassin is not designed to scan huge messages. messages larger than ~10-20MB should not be fed to SpamAssassin, because memory consumption will increase rapidly. she will simply eat your RAM and not feel bad about it π
β¨ OPTIONS β¨
okay bestie, here's where the real fun starts. every flag, every vibe, no skips π
-e,--error-code,--exit-codeβ bail out with a non-zero error code if the message turns out to be spam. yes, that's the drama you asked for.-h,--helpβ print the help message and dip out. classic.-V,--versionβ print the version and bounce.-t,--test-modeβ test mode!! pipes your message through and slaps an extra report on it. heads up though: the report text is written assuming the message is spam, since in normal use you'd only ever see it in that case. so don't trust the words, trust the score, bestie. π
if you run this with -d, the message will first have its SpamAssassin markup removed before being tested. cute, clean, tested.
-r,--reportβ report this message as manually-verified spam, like you're snitching to the group chat. this submits the mail message read fromSTDINto various spam-blocker databases. currently these are the Distributed Checksum Clearinghouse <https://www.dcc-servers.net/dcc/>, Pyzor <https://www.pyzor.org/>, Vipul's Razor <http://razor.sourceforge.net/>, and SpamCop <https://www.spamcop.net/>.
if the message has SpamAssassin markup in it, that markup gets stripped automatically before submission. and listen β the support modules for DCC, Pyzor, and Razor must be installed for spam to be reported to each service. SpamCop reports hit way harder if you register and set the spamcop_to_address option. β¨
the message also gets submitted to SpamAssassin's learning systems; right now that's the internal Bayesian statistical-filtering system (the BAYES rules). (ngl, if you only wanna do statistical learning and you do not wanna report mail to third parties, you should just use the sa-learn command directly instead. it's giving efficiency.)
-k,--revokeβ takin' it back π revokes the mail message read fromSTDINfrom various spam-blocker databases. currently that's Vipul's Razor.
revocation support for the Distributed Checksum Clearinghouse, Pyzor, and SpamCop is not currently available. sorry babes.
if the message has SpamAssassin markup, it gets stripped automatically before submission. and the support modules for Razor must be installed for spam to be revoked from the service.
the message also gets submitted as ham (non-spam) to SpamAssassin's learning systems; right now that's the internal Bayesian statistical-filtering system (the BAYES rules). (same note as before: if you only want statistical learning and don't want to report mail to third-parties, go use the sa-learn command directly.)
--lintβ syntax check (lint) the rule set and configuration files, reporting typos and rules that don't compile correctly. exits with0if there are no errors, or greater than0if any errors are found. it's basically a vibe check for your config π-W,--add-to-welcomelistβ previously--add-to-whitelist, which will still work interchangeably until4.1.
adds all email addresses found 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-to-blocklistβ previously--add-to-blacklist, which will still work interchangeably until4.1.
adds 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.
-R,--remove-from-welcomelistβ previously--remove-from-whitelist, which will still work interchangeably until4.1.
removes 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 if you just wanna remove a single address you should use --remove-addr-from-welcomelist instead. iykyk β¨
note that you must be running spamassassin or spamd with a persistent address list plugin enabled for this to work.
--add-addr-to-welcomelistβ previously--add-addr-to-whitelist, which will still work interchangeably until4.1.
adds 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-addr-to-blocklistβ previously--add-addr-to-blacklist, which will still work interchangeably until4.1.
adds 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-addr-from-welcomelistβ previously--remove-addr-from-whitelist, which will still work interchangeably until4.1.
removes 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.
--remove-addr-from-blocklistβ removes the named email address from a persistent address blocklist. note that you must be runningspamassassinorspamdwith a persistent address list plugin enabled for this to work.-u username,--username=usernameβ if you specify this, the username overrides whatever was taken from the runtime environment. you can use this option to specify users in a virtual user configuration when using SQL as the Bayes backend.
NOTE: this option will not change to the given username β it will only attempt to act on behalf of that user. because of this you'll need proper permissions to be able to change files owned by that username. in the case of SQL this generally is not a problem. π
--ipv4only,--ipv4-only,--ipv4β do not use IPv6 for DNS tests. normally SpamAssassin tries to detect if IPv6 is available and uses only IPv4 if it's not. use this if the existing tests for IPv6 availability produce incorrect results or crashes. lowkey a rescue flag.-L,--localβ only do the ''local'' tests, the ones that don't need an internet connection to operate. normally SpamAssassin tries to detect whether you're connected to the net before doing these tests anyway, but if you want faster checks, this is the move.
heads up: SpamAssassin's network rules run in parallel. this can cause overhead in terms of the number of file descriptors required if --local is not used; it's recommended that the minimum limit on fds be raised to at least 256 for safety. π₯
-d,--remove-markupβ removes SpamAssassin markup (theSpamAssassin resultsreport,X-Spam-Statusheaders, etc.) from the mail message. the resulting message, which will be more or less identical to the original pre-SpamAssassin input, gets output toSTDOUT.
(note: the message won't be exactly identical β some headers will be reformatted due to some features of the Mail::Internet package β but the body text will be. π―)
-C path,--configpath=path,--config-file=pathβ use the specified path for locating the distributed configuration files. ignore the default directories (usually/usr/share/spamassassinor similar).--siteconfigpath=pathβ use the specified path for locating site-specific configuration files. ignore the default directories (usually/etc/spamassassinor similar).--cf='config line'β add extra lines of configuration straight from the command-line, parsed after the configuration files are read. multiple--cfarguments can be used, and each one gets treated as a separate line of configuration. for example:
spamassassin -t --cf="body NEWRULE /text/" --cf="score NEWRULE 3.0"
--pre='config line'β add extra lines of.preconfiguration straight from the command-line, parsed before the configuration files are read. multiple--prearguments can be used, and each one gets treated as a separate line of configuration. for example:
spamassassin -t --pre="loadplugin Mail::SpamAssassin::Plugin::Foobar"
-p prefs,--prefspath=prefs,--prefs-file=prefsβ read user score preferences from prefs (usually$HOME/.spamassassin/user_prefs). πΈ--progressβ prints a progress bar (toSTDERR) showing the current progress. this option is only useful if you're redirectingSTDOUT(and notSTDERR). in the case where no valid terminal is found, this option behaves very much like the--showdotsoption in other SpamAssassin programs. β¨-D [area,...],--debug [area,...]β produce debugging output. if no areas are listed, all debugging information is printed. diagnostic output can also be enabled for each area individually; area is the area of the code to instrument. for example, to produce diagnostic output on bayes, learn, and dns, use:
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, so the path doesn't get 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 info about which areas (also known as channels) are available, please see the documentation at:
L<https://wiki.apache.org/spamassassin/DebugChannels>
-x,--nocreate-prefsβ disable creation of user preferences file. no new files, no drama.--mboxβ specify that the input message(s) are inmboxformat.mboxis a standard Unix message folder format.--mbxβ specify that the input message(s) are in UW.mbxformat.mbxis the mailbox format used within the University of Washington's IMAP implementation; see <https://en.wikipedia.org/wiki/UW_IMAP>.
π SEE ALSO
sa-learn(1) spamd(1) spamc(1) Mail::SpamAssassin::Conf(3) Mail::SpamAssassin(3)
π§ PREREQUISITES
Mail::SpamAssassin
π BUGS
See <https://bz.apache.org/SpamAssassin/>
π AUTHORS
The SpamAssassin(tm) Project <https://spamassassin.apache.org/>
π COPYRIGHT
SpamAssassin is distributed under the Apache License, Version 2.0, as described in the file LICENSE included with the distribution.
and that's a wrap bestie!! π«Ά this whole thing is perl v5.40.1, dated 2026-07-23, and it's SPAMASSASSIN-RUN(1p) β go forth and filter, you absolute icon β¨π
π¦ where this page comes from
- ubuntu stonking: spamassassin 4.0.2+svn1935691-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms