SPAMASSASSIN(1)
๐ SPAMASSASSIN ๐ (that's the manual name, bestie โ spamassassin(1), User Contributed Perl Documentation)
โจ NAME โจ
spamassassin โ the extensible email filter that sniffs out spam, no cap
๐ฆ DESCRIPTION ๐ฆ
Okay so, SpamAssassin is this intelligent email filter, right? It runs a whole diverse range of tests to figure out what's unsolicited bulk email โ aka "spam", the villain of your inbox. Those tests get applied to email headers and content, and then it classifies the email using advanced statistical methods. Fancy. ๐
Plus โ and this is the iconic part โ SpamAssassin has a modular architecture, so other technologies can be quickly wielded against spam, and the whole thing is designed for easy integration into virtually any email system. Literally any. She's flexible like that. ๐ง
๐ธ SYNOPSIS ๐ธ
For ease of access (and honestly, so you don't get overwhelmed, bestie), the SpamAssassin manual has been split up into several sections. If you're planning to read these straight through for the first time, the suggested order will tend to reduce the number of forward references. Trust the order. ๐ซถ
There's also extensive additional documentation for SpamAssassin available โ primarily on the SpamAssassin web site and wiki.
You should be able to view SpamAssassin's documentation with your man(1) program or perldoc(1).
๐ OVERVIEW
spamassassinโ SpamAssassin overview (this section, the one you're in right now, hi ๐)
๐ CONFIGURATION
Mail::SpamAssassin::Confโ SpamAssassin configuration files
๐ USAGE
spamassassin-runโ the"spamassassin"front-end filtering scriptsa-learnโ train SpamAssassin's Bayesian classifierspamcโ client for spamd (faster than spamassassin)spamdโ spamassassin server (needed by spamc)
๐ DEFAULT PLUGINS
Mail::SpamAssassin::Plugin::AskDNSMail::SpamAssassin::Plugin::AutoLearnThresholdMail::SpamAssassin::Plugin::BayesMail::SpamAssassin::Plugin::BodyEvalMail::SpamAssassin::Plugin::CheckMail::SpamAssassin::Plugin::DKIMMail::SpamAssassin::Plugin::DMARCMail::SpamAssassin::Plugin::DNSEvalMail::SpamAssassin::Plugin::FreeMailMail::SpamAssassin::Plugin::HTMLEvalMail::SpamAssassin::Plugin::HTTPSMismatchMail::SpamAssassin::Plugin::HashBLMail::SpamAssassin::Plugin::HeaderEvalMail::SpamAssassin::Plugin::ImageInfoMail::SpamAssassin::Plugin::MIMEEvalMail::SpamAssassin::Plugin::MIMEHeaderMail::SpamAssassin::Plugin::PyzorMail::SpamAssassin::Plugin::Razor2Mail::SpamAssassin::Plugin::RelayEvalMail::SpamAssassin::Plugin::ReplaceTagsMail::SpamAssassin::Plugin::SPFMail::SpamAssassin::Plugin::SpamCopMail::SpamAssassin::Plugin::URIDNSBLMail::SpamAssassin::Plugin::URIDetailMail::SpamAssassin::Plugin::URIEvalMail::SpamAssassin::Plugin::VBounceMail::SpamAssassin::Plugin::WLBLEvalMail::SpamAssassin::Plugin::WelcomeListSubject
That's the whole squad, all 28 of them. ๐
๐ฆ WEB SITES ๐ฆ
- SpamAssassin web site:
https://spamassassin.apache.org/ - Wiki-based documentation:
https://wiki.apache.org/spamassassin/
๐ USER MAILING LIST ๐
There's a users mailing list where other experienced users are often able to help and provide tips and advice. Subscription instructions are located on the SpamAssassin web site. Go lurk, go learn, iykyk. ๐ธ
โญ CONFIGURATION FILES โญ
The SpamAssassin rule base, text templates, and rule description text are all loaded from configuration files.
Default configuration data is loaded from the first existing directory in:
/var/lib/spamassassin/4.000002
/usr/share/spamassassin
/usr/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:
/etc/mail/spamassassin
/usr/etc/mail/spamassassin
/usr/etc/spamassassin
/usr/local/etc/spamassassin
/usr/pkg/etc/spamassassin
/usr/etc/spamassassin
/etc/mail/spamassassin
/etc/spamassassin
From those directories, SpamAssassin will first read files ending in ".pre" in lexical order, and then it will read files ending in ".cf" in lexical order (most files begin with two numbers to make the sorting order obvious).
In other words โ and yes this is the actual example โ it will read init.pre first, then 10_default_prefs.cf before 50_scores.cf, and 20_body_tests.cf before 20_head_tests.cf. Options in later files will override earlier files. Later = boss. ๐
Individual user preferences are loaded from the location specified on the "spamassassin", "sa-learn", or "spamd" command line (see the respective manual page for details). If the location isn't specified, ~/.spamassassin/user_prefs is used if it exists. SpamAssassin will create that file if it does not already exist, using user_prefs.template as a template. That file will be looked for in:
/etc/mail/spamassassin
/usr/etc/mail/spamassassin
/usr/share/spamassassin
/etc/spamassassin
/etc/mail/spamassassin
/usr/local/share/spamassassin
/usr/share/spamassassin
๐ TAGGING ๐
The following two sections detail the default tagging and markup that takes place for messages when running "spamassassin" or "spamc" with "spamd" in the default configuration.
Note bestie: before header modification and addition, all headers beginning with X-Spam- are removed โ to prevent spammer mischief, and also to avoid potential problems caused by prior invocations of SpamAssassin. Clean slate energy. ๐งผ
๐ TAGGING FOR SPAM MAILS
By default, all messages with a calculated score of 5.0 or higher are tagged as spam.
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). Iconic, non-destructive behaviour. ๐ซถ
The new report message inherits the following headers (if they're present) from the original spam message:
From:headerTo:headerCc:headerSubject:headerDate:headerMessage-ID:header
The above headers can be modified if the relevant "rewrite_header" option is given (see "Mail::SpamAssassin::Conf" for more information).
By default these message headers are added to spam:
X-Spam-Flag:header โ set to"YES".
The headers that added are fully configurable via the "add_header" option (see "Mail::SpamAssassin::Conf" for more information).
- spam mail body text โ the SpamAssassin report is added to top of the mail message body, if the message is marked as spam.
๐ธ DEFAULT TAGGING FOR ALL MAILS
These headers are added to all messages, both spam and ham (non-spam). Equal opportunity tagging.
X-Spam-Checker-Version:header โ the version and subversion of SpamAssassin and the host where SpamAssassin was run.X-Spam-Level:header โ a series of"*"characters where each one represents a full score point.X-Spam-Status:header โ a string,"(Yes|No), score=nn required=nn tests=xxx,xxx autolearn=(ham|spam|no|unavailable|failed)", is set in this header to reflect the filter status. For the first word,"Yes"means spam and"No"means ham (non-spam).
The headers that added are fully configurable via the "add_header" option (see "Mail::SpamAssassin::Conf" for more information).
๐ INSTALLATION ๐
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. ๐
Heads up: it is not possible to use the"PERL5LIB"environment variable to affect where SpamAssassin finds its perl modules โ due to limitations imposed by perl's"taint"security checks. Sorry bestie, security says no. ๐
For further details on how to install, please read the "INSTALL" file from the SpamAssassin distribution.
๐ฅ DEVELOPER DOCUMENTATION ๐ฅ
Mail::SpamAssassinโ Spam detector and markup engineMail::SpamAssassin::ArchiveIteratorโ find and process messages one at a timeMail::SpamAssassin::AutoWelcomelistโ auto-welcomelist handler for SpamAssassinMail::SpamAssassin::Bayesโ determine spammishness using a Bayesian classifierMail::SpamAssassin::BayesStoreโ Bayesian Storage ModuleMail::SpamAssassin::BayesStore::SQLโ SQL Bayesian Storage Module ImplementationMail::SpamAssassin::Conf::LDAPโ load SpamAssassin scores from LDAP databaseMail::SpamAssassin::Conf::Parserโ parse SpamAssassin configurationMail::SpamAssassin::Conf::SQLโ load SpamAssassin scores from SQL databaseMail::SpamAssassin::Messageโ decode, render, and hold an RFC-2822 messageMail::SpamAssassin::Message::Metadataโ extract metadata from a messageMail::SpamAssassin::Message::Nodeโ decode, render, and make available MIME message partsMail::SpamAssassin::PerMsgLearnerโ per-message status (spam or not-spam)Mail::SpamAssassin::PerMsgStatusโ per-message status (spam or not-spam)Mail::SpamAssassin::PersistentAddrListโ persistent address list base classMail::SpamAssassin::Pluginโ SpamAssassin plugin base classMail::SpamAssassin::Plugin::RelayCountryโ add message metadata indicating the country code of each relayMail::SpamAssassin::Plugin::SPFโ perform SPF verification testsMail::SpamAssassin::Plugin::URIDNSBLโ look up URLs against DNS blocklistsMail::SpamAssassin::SQLBasedAddrListโ SpamAssassin SQL Based Auto Welcomelist
๐ BUGS ๐
See <https://bz.apache.org/SpamAssassin/> โ yes, fr fr, that's the whole section. Go report it. ๐
๐ AUTHORS ๐
The SpamAssassin(tm) Project <https://spamassassin.apache.org/>
๐ COPYRIGHT AND LICENSE ๐
SpamAssassin is distributed under the Apache License, Version 2.0, as described in the file "LICENSE" included with the distribution.
Copyright (C) 2015 The Apache Software Foundation
Okay that's the whole page, bestie โ you made it to the end, main character energy fr fr ๐ This was spamassassin(1) served up with perl v5.42.0, dated 2025-08-31. Slay. Now go filter some email. ๐
๐ฆ where this page comes from
- alpine 3.23: spamassassin-doc 4.0.2-r0 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms