SA-UPDATE(1)
π SA-UPDATE(1) β automate SpamAssassin rule updates π
(User Contributed Perl Documentation, bestie β¨)
πΈ NAME πΈ
sa-update β automate SpamAssassin rule updates. That's the whole vibe: it goes and gets fresh rules for you. π«Ά
π SYNOPSIS π
sa-update [options]
Options:
--channel channelβ Retrieve updates from this channel. Use it 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 usefile.asc, orfile.sha512, orfile.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.--gpgand--nogpgβ Use (or do not use) GPG to verify updates (--gpgis assumed by use of the above--gpgkeyand--gpgkeyfileoptions).--import fileβ Import GPG key(s) from file intosa-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.000002).--refreshmirrorsβ Force theMIRRORED.BYfile 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 π¦
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. Iconic. π
NOTE: channel names are domain names, but 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. Slay, honestly. β¨
Update archives are verified using GPG signatures by default. If GPG is disabled (not recommended), file integrity is checked with SHA512 or SHA256 checksums.
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. No 0, no reload, periodt. π
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 π₯
Okay bestie, here's the whole menu β no skipping, no skimming, we keep every detail. π«Ά
π --channel π
sa-update can update multiple channels at the same time. By default, it will only access updates.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 --channel option, except specify the additional channels in a file instead of on the commandline. This is useful when there are a lot of additional channels. A whole file of channels? We love an organized queen. π
π --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.
π --install π
Install updates "offline", from the named tar.gz file, instead of performing DNS lookups and HTTP invocations.
Files named file.asc, file.sha512, or file.sha256 will 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 --channel switches cannot be used with --install. To install multiple channels from tarballs, run sa-update multiple times with different --channel and --install switches, 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; any loadplugin or tryplugin lines will be commented in the downloaded update rules files.
π¨ DANGER, BESTIE: 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-update by default will verify update archives by use of GPG signature.
If you wish to skip GPG verification (very unsafe), you can use the --nogpg option to disable its use. Use of the following gpgkey-related options will override --nogpg and 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-update has the concept of "release trusted" GPG keys. When an archive is downloaded and the signature verified, sa-update requires 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.
By default, sa-update trusts key ids 24F434CE and 5244EC45, which are the standard SpamAssassin release key and its sub-key. Use this option to trust additional keys. See the --import option for how to add keys to sa-update's keyring. For sa-update to use a key it must be in sa-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 --gpgkey option, 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 the sa-update GPG keyring. By default, this is
/etc/mail/spamassassin/sa-update-keys
π --import π
Use to import GPG key(s) from a file into the sa-update keyring 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 --gpgkey or --gpgkeyfile options above to get sa-update to 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 of sa-update mirrors for each channel, stored in the MIRRORED.BY file, to be updated. By default, the MIRRORED.BY file will be cached for up to 7 days after each time it is downloaded.
π --forcemirror π
Force the download from a specific host instead of relying on mirrors listed in MIRRORED.BY.
π --updatedir π
By default, sa-update will use the system-wide rules update directory:
/var/lib/spamassassin/4.000002
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.
π -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 π
Print sa-update version and exit.
π EXIT CODES π
Okay bestie, this is the vibe check for what the numbers mean when sa-update bounces out. π«Ά
- An exit code of
0means: if you did not use--checkonly, an update was available, and it was downloaded and installed successfully. Slay. β¨ If--checkonlywas specified, an exit code of0means: an update was available. Thatβs it, thatβs the whole win. π - An exit code of
1means no fresh updates were available. Not a flop, just no new drops. π - An exit code of
2means that at least one update is available, but a lint check of the site pre files failed. The site pre files must pass a lint check before any updates are attempted. So likeβ¦ fix the lint first, bestie. π - An exit code of
3means that at least one update succeeded while other channels failed. If usingsa-compile, you should proceed with it. Donβt leave it hanging. π - An exit code of
4or higher indicates that errors occurred while attempting to download and extract updates, and no channels were updated. Big yikes. π
π SEE ALSO π
Go touch these other pages, iykyk:
Mail::SpamAssassin(3)Mail::SpamAssassin::Conf(3)spamassassin(1)spamd(1)<https://wiki.apache.org/spamassassin/RuleUpdates>
π§ PREREQUISITES π§
You need Mail::SpamAssassin in the mix. Thatβs the whole prerequisite, no cap. π
π¦ BUGS π¦
See <https://bz.apache.org/SpamAssassin/> for the bug situation. β¨
π AUTHORS π
The Apache SpamAssassin(tm) Project <https://spamassassin.apache.org/> β iconic behavior, honestly. π
π 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
Ok bye bestie π this little page is from perl v5.42.0, dated 2025-08-31, and itβs SA-UPDATE(1) β periodt β¨
π¦ 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