Note: This page is under construction and shouldn't be considered "complete". If there are any questions, etc, please feel free to contact the users at spamassassin.apache.org list for more information.
Publishing channels for sa-update
Channels are fairly simple to setup and use. Simply put, updates are files contained in a standard tar.gz archive, distributed via HTTP. To allow for frequent update checks from clients, a lightweight method (DNS queries) is used to specify what update version is the latest for any given version of SpamAssassin. sa-update also uses a mirror file which lists all of the URLs where the update can be downloaded from, optionally including weights for different mirrors.
For more info on using "sa-update" to download rule updates, see RuleUpdates.
How does it work?
When looking for an update, sa-update reverses the version and makes a DNS TXT query for <version>.<channel>. ie: Running 3.1.1's sa-update, the default updates.spamassassin.org channel causes a DNS lookup for 1.1.3.updates.spamassassin.org. The query is for a TXT record containing the update number, which should be a monotonically increasing value. Assuming an update is necessary, sa-update will then read the MIRRORED.BY file (downloading it first if necessary from the URL found in a DNS TXT record mirrors.<channel>).
- mirrors.<channel> TXT
- <version>.<channel> TXT "UPDATE_NUMBER"
- List of URLs which contain the updates
- Only files (no directories) contained in a tar.gz archive file named UPDATE_NUMBER.tar.gz
- A sha1sum file named UPDATE_NUMBER.tar.gz.sha1 with the output of .
- Recommended is a detached GPG signature for the update named UPDATE_NUMBER.tar.gz.asc via something like
Here is a short example of how an update for SpamAssassin 3.1.x would be published. By convention, we use the svn version of the directory as the update number.
- What if I want to publish updates for some versions but not others?
The answer is pretty simple and comes down to DNS records. As long as the reverse version DNS request does not return a TXT record, sa-update will consider there to be no updates available. ie: if we want to publish update 386156 for SpamAssassin 3.1.x, but not 3.1.0, we could use the following records:
When v3.1.0's sa-update looks for an update, it gets no TXT response (having an existing 0.1.3 record overrides the wildcard record), and therefore it sees no updates available. However, when v3.1.1 or above looks for an update, it gets "386156" returned.
More Examples based on custom channel sa.zmi.at
Here is a short summary of what I do to provide the ZMI_GERMAN ruleset via it's channel sa.zmi.at. I found it hard to grab all the bits together, so this should help others to save some time installing their own channel.
Now we auto-generate the DNS zone for sa.zmi.at, basically it contains this:
HOWTO setup gpg
Setting up a new gpg key for a channel is simple if you know what to do. Here are the quick steps to save some time:
First create a new key in a new directory:
Now list that key so you know it's key-id, then export it to an ascii file. This is what your users have to import to sa-update later:
In order to use the new channel, users need to do the following. I assume the .asc file has been downloaded from a website:
from now on, simply use
you can use it with "-D" for the first time, which gives a lot of debug output so you can see if everything went well.
Details of the rule-update generation backend at updates.spamassassin.org can be read at SaUpdateBackend.