SA-UPDATE(1p)
β¨ NAME β¨
sa-update β automate SpamAssassin rule updates.
hey bestie, welcome to the sa-update(1p) manual page from the User Contributed Perl Documentation. It's giving updater energy, no cap.
πΈ SYNOPSIS πΈ
okay so the literal usage is:
sa-update [options]
Options:
--channel channel Retrieve updates from this channel
Use multiple times for multiple channels
--channelfile file Retrieve updates from the channels in the file
--checkonly Check for update availability, do not install
--install file Install updates directly from this file. Signature
verification will use "file.asc", or "file.sha512"
or "file.sha256".
--allowplugins Allow updates to load plugin code (DANGEROUS)
--gpgkey key Trust the key id to sign releases
Use multiple times for multiple keys
--gpgkeyfile file Trust the key ids in the file to sign releases
--gpghomedir path Store the GPG keyring in this directory
--gpg and --nogpg Use (or do not use) GPG to verify updates
(--gpg is assumed by use of the above
--gpgkey and --gpgkeyfile options)
--import file Import GPG key(s) from file into sa-update's
keyring. Use multiple times for multiple files
--updatedir path Directory to place updates, defaults to the
SpamAssassin site rules directory
(default: /var/lib/spamassassin/4.000003)
--refreshmirrors Force the MIRRORED.BY file to be updated
--forcemirror url Use a specific mirror instead of downloading from
official mirrors
--httputil util Force used download tool. By default first found
from these is used: curl, wget, fetch, lwp
--score-multiplier x.x Adjust all scores from update channel, multiply
with given value (integer or float).
--score-limit x.x Adjust all scores from update channel, limit
to given value (integer or float). Limiting
is done after possible multiply operation.
-D, --debug [area=n,...] Print debugging messages
-v, --verbose Be verbose, like print updated channel names;
For more verbosity specify multiple times
-V, --version Print version
-h, --help Print usage message
-4 Force using the inet protocol (IPv4), not inet6
-6 Force using the inet6 protocol (IPv6), not inet
π DESCRIPTION π
okay so sa-update automates the process of downloading and installing new rules and configuration, based on channels. The default channel is updates.spamassassin.org, which has updated rules since the previous release. periodt.
NOTE: channel names are domain names, but they DO NOT typically have any DNS records other than (maybe) NS records. There is a tree of records below that name which denote the SpamAssassin version and resolve that name to the version number of the latest rules, e.g. to find the latest update version number for SpamAssassin v4.0.0:
$ host -t txt 0.0.4.updates.spamassassin.org
0.0.4.updates.spamassassin.org is an alias for 3.3.3.updates.spamassassin.org.
3.3.3.updates.spamassassin.org descriptive text "1907730"
That also illuminates the fact that the current ruleset is supposed to be backward-compatible to v3.3.3. iconic.
Update archives are verified using GPG signatures by default. If GPG is disabled (not recommended), file integrity is checked with SHA512 or SHA256 checksums. iykyk.
Note that sa-update will not restart spamd or otherwise cause a scanner to reload the now-updated ruleset automatically. Instead, sa-update is typically used in something like the following manner:
sa-update && /etc/init.d/spamassassin reload
This works because sa-update only returns an exit status of 0 if it has successfully downloaded and installed an updated ruleset.
The program sa-update uses the underlying operating system umask for the updated rule files it installs. You may wish to run sa-update from a script that sets the umask prior to calling sa-update. For example:
#!/bin/sh
umask 022
sa-update
π₯ OPTIONS π₯
--channelβsa-updatecan update multiple channels at the same time. By default, it will only accessupdates.spamassassin.org, but more channels can be specified via this option. If there are multiple additional channels, use the option multiple times, once per channel. i.e.:
sa-update --channel foo.example.com --channel bar.example.com
--channelfileβ Similar to the--channeloption, except specify the additional channels in a file instead of on the commandline. This is useful when there are a lot of additional channels. fr fr.--checkonlyβ Only check if an update is available, don't actually download and install it. The exit code will be 0 or 1 as described below. vibe check only.--installβ Install updates "offline", from the named tar.gz file, instead of performing DNS lookups and HTTP invocations. no DNS drama, no HTTP invocations. Files namedfile.asc,file.sha512, orfile.sha256will be used for GPG signature, and the SHA256 and SHA512 checksums, respectively. The filename provided must contain a version number of at least 3 digits, which will be used as the channel's update version number. Multiple--channelswitches cannot be used with--install. To install multiple channels from tarballs, runsa-updatemultiple times with different--channeland--installswitches, e.g.:
sa-update --channel foo.example.com --install foo-34958.tgz
sa-update --channel bar.example.com --install bar-938455.tgz
--allowpluginsβ Allow downloaded updates to activate plugins. The default is not to activate plugins; anyloadpluginortrypluginlines will be commented in the downloaded update rules files.
You should never enable this for 3rd party update channels, since plugins can execute unrestricted code on your system, even possibly as root! This includes spamassassin official updates, which have no need to include running code.
Use --reallyallowplugins option to bypass warnings and make it work.
--gpg,--nogpgβsa-updateby default will verify update archives by use of GPG signature. If you wish to skip GPG verification (very unsafe), you can use the--nogpgoption to disable its use. Use of the following gpgkey-related options will override--nogpgand keep GPG verification enabled. If GPG is disabled, only SHA512 or SHA256 checksums are used to verify whether or not the downloaded archive has been corrupted, but it does not offer any form of security regarding whether or not the downloaded archive is legitimate (aka: non-modifed by evildoers). Note: Only GnuPG is supported (ie: not any other PGP software).--gpgkeyβsa-updatehas the concept of "release trusted" GPG keys. When an archive is downloaded and the signature verified,sa-updaterequires that the signature be from one of these "release trusted" keys or else verification fails. This prevents third parties from manipulating the files on a mirror, for instance, and signing with their own key. trust issues, but the secure kind. By default,sa-updatetrusts key ids24F434CEand5244EC45, which are the standard SpamAssassin release key and its sub-key. Use this option to trust additional keys. See the--importoption for how to add keys tosa-update's keyring. Forsa-updateto use a key it must be insa-update's keyring and trusted. For multiple keys, use the option multiple times. i.e.:
sa-update --gpgkey E580B363 --gpgkey 298BC7D0
Note: use of this option automatically enables GPG verification.
--gpgkeyfileβ Similar to the--gpgkeyoption, except specify the additional keys in a file instead of on the commandline. This is extremely useful when there are a lot of additional keys that you wish to trust.--gpghomedirβ Specify a directory path to use as a storage area for thesa-updateGPG keyring. By default, this is
/etc/spamassassin/sa-update-keys
--importβ Use to import GPG key(s) from a file into thesa-updatekeyring which is located in the directory specified by--gpghomedir. Before using channels from third party sources, you should use this option to import the GPG key(s) used by those channels. You must still use the--gpgkeyor--gpgkeyfileoptions above to getsa-updateto trust imported keys. To import multiple keys, use the option multiple times. i.e.:
sa-update --import channel1-GPG.KEY --import channel2-GPG.KEY
Note: use of this option automatically enables GPG verification.
--refreshmirrorsβ Force the list ofsa-updatemirrors for each channel, stored in theMIRRORED.BYfile, to be updated. By default, theMIRRORED.BYfile will be cached for up to 7 days after each time it is downloaded. mirror mirror on the wall.--forcemirrorβ Force the download from a specific host instead of relying on mirrors listed inMIRRORED.BY. main character mirror energy.--updatedirβ By default,sa-updatewill use the system-wide rules update directory:
/var/lib/spamassassin/4.000003
If the updates should be stored in another location, specify it here. Note that use of this option is not recommended; if you're just using sa-update to download updated rulesets for a scanner, and sa-update is placing updates in the wrong directory, you probably need to rebuild SpamAssassin with different Makefile.PL arguments, instead of overriding sa-update's runtime behaviour. ngl.
-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 channel, gpg, and http, use:
sa-update -D channel,gpg,http
For more information about which areas (also known as channels) are available, please see the documentation at https://wiki.apache.org/spamassassin/DebugChannels.
-h,--helpβ Print help message and exit.-V,--versionβ Printsa-updateversion and exit.
β¨ EXIT CODES β¨
okay bestie this is the part where you gotta pay attention, because the exit code is literally how sa-update tells you how it's feeling π
like it just ran a whole errand for you and this number is the receipt
so, no --checkonly in the mix? then exit code 0 means: an update was available, and it got downloaded and installed successfully. slay. full mission accomplished, main character energy, the update ate and left no crumbs π₯
but if you did pass --checkonly? then 0 means something a lil different β an update was available. that's it, that's the whole vibe. it looked, it found one, it didn't touch anything π«Ά
- exit code
1β no fresh updates were available. not a problem, just... nothing new to see here bestie π - exit code
2β at least one update is available BUT a lint check of the site pre files failed. and lowkey this one matters: the site pre files must pass a lint check before any updates are attempted, periodt. no lint pass, no updates, that's the rule π« - exit code
3β at least one update succeeded while other channels failed π so it's a mixed bag situation. and heads up: if you're usingsa-compile, you should proceed with it π - exit code
4or higher β errors happened while attempting to download and extract updates, and no channels were updated. that's the "it's giving broken" zone, ngl go check your setup π
π SEE ALSO π
go read these next, iykyk:
Mail::SpamAssassin(3)Mail::SpamAssassin::Conf(3)spamassassin(1)spamd(1)- <https://wiki.apache.org/spamassassin/RuleUpdates>
π PREREQUISITES π
you need exactly one thing, and it's this icon:
Mail::SpamAssassin
no cap, that's the whole list β¨
π BUGS π
found something cursed? the bug tracker is right here, go tell them:
<https://bz.apache.org/SpamAssassin/>
π AUTHORS π
The Apache SpamAssassin(tm) Project <https://spamassassin.apache.org/> β legends, honestly, they built the whole thing π«Ά
π LICENSE AND COPYRIGHT π
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 a wrap on this page bestie π this one came from perl v5.40.1, dated 2026-07-23, and it's the SA-UPDATE(1p) manual page β go forth and update your rules responsibly, mwah πβ¨
π¦ 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