Update and Back Up
SpamFoo Client updates its models and its own program on its own. In Docker, it updates its models, and you update the program by pulling a new image. See Update Docker. This page explains how updates work, how to back up SpamFoo Client, and how to move it to a new server.
Model Updates
SpamFoo Client checks for new models about every 6 hours. You can change how often with SPAMFOO_UPDATE_INTERVAL_HOURS (see Configure SpamFoo Client). When a new model is available, SpamFoo Client does the following:
- Downloads the model.
- Checks the file against its SHA-256 hash and SpamFoo's digital signature. A file that fails either check is not used.
- Pauses scanning briefly to load the new model, while new messages wait in the queue. If that doesn't work, it finishes the messages in progress and restarts with the new model.
- Keeps the current and the previous version of each model, and deletes older ones.
The Versions card on System > Status shows the version of the client and of each model.
To check for new models right away:
- Go to System > Status.
- In the Maintenance card, click Run next to Update Models.
- Confirm.
The result appears under the action when it finishes.
Program Updates
SpamFoo Client checks for a new version of itself at the same time it checks for models. When a new version is available, SpamFoo Client does the following:
- Downloads the new version and checks it against its SHA-256 hash and SpamFoo's digital signature.
- Waits for the messages it's scanning to finish, then stops.
- Runs an update script that replaces the program files. Your data, settings, and models are not touched.
- Keeps copies of the two previous versions in the
updates/backupfolder of the install folder. - If the same version fails to install three times, stops trying that version until a newer one is released.
SpamFoo Client does not start itself again after an update. What happens next depends on how you run it:
| How You Run It | After an Update |
|---|---|
| SmarterMail | SmarterMail starts SpamFoo Client again. |
| Linux archive with a systemd service | systemd starts SpamFoo Client again, if the service file has Restart=always and KillMode=process as shown in Install From the Archive. |
| Windows, or started by hand | Start SpamFoo Client again yourself. |
| Docker | Pull a new image instead. See Update Docker. |
The Versions card on System > Status shows which version of the client is running.
Update the Program Now
In Docker, Update Client only shows whether a newer version is available. To update, see Update Docker. With the Linux package, or when program updates are turned off, Update Client is grayed out and explains how to update instead.
- Go to System > Status.
- In the Maintenance card, click Run next to Update Client.
- Confirm.
Turn Off Automatic Program Updates
Set the environment variable SPAMFOO_DISABLE_BINARY_UPDATE=true and restart SpamFoo Client. With the Linux package, add the line to /etc/spamfoo/spamfoo.conf. Model updates keep running.
For an archive install:
- Stop SpamFoo Client.
- Download the new archive from the Downloads page in your SpamFoo account, and extract it over the install folder.
- Start SpamFoo Client.
Update Docker
In Docker, SpamFoo Client never replaces its own program. To update it, start a new container from a newer image. Models, settings, history, and the proxy secret carry over because they're stored in the /data volume.
If You Use docker run
- Pull the new image. Use
latest, or the version tag you want:docker pull spamfoo/spamfoo-client:latest - Stop and remove the old container. Use your container's name in place of
spamfoo-client:docker stop spamfoo-client docker rm spamfoo-client - Run the same
docker runcommand you used to install it, with the same/datavolume and environment variables. If you use a version tag, change it to the new one. See Install SpamFoo Client.
If You Use Docker Compose
- If your compose file uses a version tag, such as
image: spamfoo/spamfoo-client:1.2.3, change it to the new version. Skip this step if it useslatest. - In the folder with your compose file, pull the new image and recreate the container:
docker compose pull spamfoo-client docker compose up -d spamfoo-client
Use the service name from your compose file in place of spamfoo-client. Docker Compose keeps the same volume and environment variables, so nothing else changes.
Besides latest and exact versions such as 1.2.3, each release is also tagged with its major and minor version, such as 1 and 1.2. Those tags move to the newest release in that line when you pull. See Pick an Image Tag.
In standalone mode, the Update Client row in the Maintenance card on System > Status tells you when a newer version is available.
/data/models. Newer images keep them in /data/trained-models, so the first start after the update downloads the models again. You can delete /data/models afterward.Old images stay on disk after an update. To remove them, run docker image prune.
Database Maintenance
SpamFoo Client looks after its own database:
- Old scan records and totals are deleted once a day, and each time SpamFoo Client starts, based on the retention settings.
- Nightly backups run on their own when turned on. See Back Up SpamFoo Client.
The Storage card on System > Status shows the database size, how many messages are stored, the date of the oldest record, and where each folder is. To use less space, see Disk Space.
Back Up SpamFoo Client
Nightly Backups
The Database Backups card on System > Settings controls the built-in backups. By default they're on, run at 2 AM server time, and keep 7 nights.
Each night, SpamFoo Client creates a folder named for the date, such as backups/2026-10-05, in the data directory. It holds:
admin.db: settings, scan history, and totalsuser_settings.db: personalization settingscorrection_archive.db: corrections reported from this serverdomain_age.db: saved domain agespersonalization/: each user's learned preferences
A backup that doesn't finish is never saved as a finished one. A failed backup is written to the log and does not affect mail.
The backups are on the same disk as the live data. Copy the newest backup folder to another machine or storage location as part of your normal server backups.
On SmarterMail, some personalization files are stored in each user's mail folder. SmarterMail's own backups cover those files.
What to Back Up
- The newest folder in
backups/. - The
etc/folder. Nightly backups don't include it. It holds the license key, the proxy secret, the release channel, and thekeysfolder that protects stored passwords. Withoutetc/keys, stored passwords can't be read after a restore. - The settings file, if you use one:
/etc/spamfoo/spamfoo.confwith the Linux package, orspamfoo.confin the data directory.
You don't need to back up trained-models/, runtime/, or logs/. Models and NVIDIA libraries are downloaded again when needed.
admin.db or other database files while SpamFoo Client is running. A copy made during a write can be damaged. Use the files in the newest backups/ folder, or stop SpamFoo Client first.etc/ folder holds secrets. Anyone with the license key or proxy secret can act as your server. Limit who can read your backups, and encrypt them where they're stored.Restore or Move to a New Server
- Install SpamFoo Client on the new server. See Install SpamFoo Client.
- Stop SpamFoo Client on the new server.
- Copy the
etc/folder from the old server into the new data directory, and copy the settings file if you use one. - Copy the files from the newest backup folder into the new data directory, as shown in the table below.
- Start SpamFoo Client.
| From the Backup Folder | To the Data Directory |
|---|---|
admin.db |
admin.db |
domain_age.db |
domain_age.db |
user_settings.db |
personalization/user_settings.db |
correction_archive.db |
correction_archive/correction_archive.db |
personalization/ |
personalization/ |
On Linux, give the copied files to the account that runs SpamFoo Client before you start it. With the Linux package, that's sudo chown -R spamfoo:spamfoo /var/lib/spamfoo.
SpamFoo Client downloads the latest models when it starts.
Personalization data is stored only on your server. Without a backup, it can't be recovered. Users rebuild it over time as they correct their mail.
Log Rotation
SpamFoo Client starts new log files and deletes old ones on its own. See Find the Log Files. You don't need a separate log rotation tool such as logrotate, and one may conflict with SpamFoo Client's own rotation.