SPAMASSASSIN(1p)

πŸ’– spamassassin β€” the manual, but make it make sense πŸ’–

okay bestie, so this is the SPAMASSASSIN(1p) page from the User Contributed Perl Documentation, and I'm gonna walk you through it like we're texting at 2am. grab a boba, we're doing this. πŸ§‹βœ¨


🌸 NAME 🌸

spamassassin β€” the extensible email filter that sniffs out spam, no cap πŸ•΅οΈβ™€οΈπŸ’…


πŸ’œ DESCRIPTION πŸ’œ

SpamAssassin is an intelligent email filter that runs a whole diverse range of tests to identify unsolicited bulk email β€” aka "spam", the thing we all hate. 😀

It applies those tests to email headers and content to classify messages using advanced statistical methods. and like… it's modular, bestie. the architecture lets other technologies get yeeted at spam real quick, and the whole thing is designed for easy integration into basically any email system. it's giving versatility. it ate. πŸ”₯


✨ SYNOPSIS ✨

so for ease of access, the SpamAssassin manual got chopped up into several sections. if you're reading these straight through for the first time, the suggested order will tend to reduce the number of forward references. thoughtful, honestly. 🫢

there's also extensive additional documentation for SpamAssassin available, primarily on the SpamAssassin web site and wiki.

and yes, you should be able to view SpamAssassin's documentation with your man(1) program or perldoc(1). iconic tools. πŸ“–

🌈 OVERVIEW

  • spamassassin β€” SpamAssassin overview (this section)

🌈 CONFIGURATION

  • Mail::SpamAssassin::Conf β€” SpamAssassin configuration files

🌈 USAGE

  • spamassassin-run β€” the "spamassassin" front-end filtering script
  • sa-learn β€” train SpamAssassin's Bayesian classifier
  • spamc β€” client for spamd (faster than spamassassin)
  • spamd β€” spamassassin server (needed by spamc)

🌈 DEFAULT PLUGINS

like, the whole starting lineup. respect them. πŸ‘‘

  • Mail::SpamAssassin::Plugin::ARC
  • Mail::SpamAssassin::Plugin::AskDNS
  • Mail::SpamAssassin::Plugin::AutoLearnThreshold
  • Mail::SpamAssassin::Plugin::Bayes
  • Mail::SpamAssassin::Plugin::BodyEval
  • Mail::SpamAssassin::Plugin::Check
  • Mail::SpamAssassin::Plugin::DKIM
  • Mail::SpamAssassin::Plugin::DMARC
  • Mail::SpamAssassin::Plugin::DNSEval
  • Mail::SpamAssassin::Plugin::FreeMail
  • Mail::SpamAssassin::Plugin::HTMLEval
  • Mail::SpamAssassin::Plugin::HTTPSMismatch
  • Mail::SpamAssassin::Plugin::HashBL
  • Mail::SpamAssassin::Plugin::HeaderEval
  • Mail::SpamAssassin::Plugin::ImageInfo
  • Mail::SpamAssassin::Plugin::MIMEEval
  • Mail::SpamAssassin::Plugin::MIMEHeader
  • Mail::SpamAssassin::Plugin::Pyzor
  • Mail::SpamAssassin::Plugin::Razor2
  • Mail::SpamAssassin::Plugin::RelayEval
  • Mail::SpamAssassin::Plugin::ReplaceTags
  • Mail::SpamAssassin::Plugin::SPF
  • Mail::SpamAssassin::Plugin::SpamCop
  • Mail::SpamAssassin::Plugin::URIDNSBL
  • Mail::SpamAssassin::Plugin::URIDetail
  • Mail::SpamAssassin::Plugin::URIEval
  • Mail::SpamAssassin::Plugin::VBounce
  • Mail::SpamAssassin::Plugin::WLBLEval
  • Mail::SpamAssassin::Plugin::WelcomeListSubject

πŸ¦‹ WEB SITES πŸ¦‹

bookmark them, bestie. iykyk. πŸ”–


πŸ’Œ USER MAILING LIST πŸ’Œ

there's a users mailing list, and fr fr it's full of experienced users who are often able to help and provide tips and advice. the subscription instructions live on the SpamAssassin web site. go make friends. πŸ«‚


πŸŽ€ CONFIGURATION FILES πŸŽ€

the SpamAssassin rule base, text templates, and rule description text all get loaded from configuration files. here's the tea:

Default configuration data is loaded from the first existing directory in:

/var/lib/spamassassin/4.000003
/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 one loads from /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 β€” cute, right?).

in other words, it reads 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. hierarchy. πŸ’…

Individual user preferences are loaded from the location specified on the spamassassin, sa-learn, or spamd command line (see respective manual page for details β€” i'm not doing their homework for them). if the location is not 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 template file will be looked for in:

/etc/spamassassin
/usr/etc/mail/spamassassin
/usr/share/spamassassin
/etc/spamassassin
/etc/mail/spamassassin
/usr/local/share/spamassassin
/usr/share/spamassassin

πŸ”₯ TAGGING πŸ”₯

the next 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: 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. messy exes stay in the past, bestie. 🚫

πŸ’€ 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). it's giving responsible. 🫢

the new report message inherits the following headers (if they are present) from the original spam message:

From: header
To: header
Cc: header
Subject: header
Date: header
Message-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 get added to all messages, both spam and ham (non-spam). everyone gets a sticker. 🌟

  • 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. your call, main character. πŸ’…

⚠️ hmm okay important: 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. so don't try it, bestie, it's not gonna go how you want. 😭

for further details on how to install, please read the INSTALL file from the SpamAssassin distribution.


πŸ‘‘ DEVELOPER DOCUMENTATION πŸ‘‘

for the dev girlies (gender neutral) who want to go deep:

  • Mail::SpamAssassin β€” Spam detector and markup engine
  • Mail::SpamAssassin::ArchiveIterator β€” find and process messages one at a time
  • Mail::SpamAssassin::AutoWelcomelist β€” auto-welcomelist handler for SpamAssassin
  • Mail::SpamAssassin::Bayes β€” determine spammishness using a Bayesian classifier
  • Mail::SpamAssassin::BayesStore β€” Bayesian Storage Module
  • Mail::SpamAssassin::BayesStore::SQL β€” SQL Bayesian Storage Module Implementation
  • Mail::SpamAssassin::Conf::LDAP β€” load SpamAssassin scores from LDAP database
  • Mail::SpamAssassin::Conf::Parser β€” parse SpamAssassin configuration
  • Mail::SpamAssassin::Conf::SQL β€” load SpamAssassin scores from SQL database
  • Mail::SpamAssassin::Message β€” decode, render, and hold an RFC-2822 message
  • Mail::SpamAssassin::Message::Metadata β€” extract metadata from a message
  • Mail::SpamAssassin::Message::Node β€” decode, render, and make available MIME message parts
  • Mail::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 class
  • Mail::SpamAssassin::Plugin β€” SpamAssassin plugin base class
  • Mail::SpamAssassin::Plugin::RelayCountry β€” add message metadata indicating the country code of each relay
  • Mail::SpamAssassin::Plugin::SPF β€” perform SPF verification tests
  • Mail::SpamAssassin::Plugin::URIDNSBL β€” look up URLs against DNS blocklists
  • Mail::SpamAssassin::SQLBasedAddrList β€” SpamAssassin SQL Based Auto Welcomelist

πŸ™ˆ BUGS πŸ™ˆ

found one? spill it here: <https://bz.apache.org/SpamAssassin/> β€” they wanna know, fr fr. πŸ›


🫢 AUTHORS 🫢

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.

Copyright (C) 2015 The Apache Software Foundation


and that's the whole page bestie, we did it!! πŸŽ‰βœ¨ this whole thing came to you via perl v5.40.1, dated 2026-07-23 β€” so yeah, SPAMASSASSIN(1p), that's the vibe. go filter some spam, you absolute icon. πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from