MBF Knowledge Base

I upgraded my server from Ubuntu 12.04 LTS to 14.04 LTS.
Now when SpamAssassin tries to update, my cron job emails me the following error:

/etc/cron.daily/spamassassin:

gpg: WARNING: unsafe ownership on homedir `/var/lib/spamassassin/sa-update-keys'

gpg: failed to create temporary file `/var/lib/spamassassin/sa-update-keys/.#lk0x16728d0.mail.nomorestars.com.13916': Permission denied

gpg: keyblock resource `/var/lib/spamassassin/sa-update-keys/secring.gpg': general error

gpg: failed to create temporary file `/var/lib/spamassassin/sa-update-keys/.#lk0x16728d0.mail.nomorestars.com.13916': Permission denied

gpg: keyblock resource `/var/lib/spamassassin/sa-update-keys/pubring.gpg': general error

gpg: no writable keyring found: eof

gpg: error reading `/usr/share/spamassassin/sa-update-pubkey.txt': general error

gpg: import from `/usr/share/spamassassin/sa-update-pubkey.txt' failed: general error

gpg: process '/usr/bin/gpg --homedir='/var/lib/spamassassin/sa-update-keys' --batch --no-tty --status-fd=1 -q --logger-fd=1 --import' finished: exit 2

What is the problem and how do I fix it?

This is happening because you need to import the channel's GPG key. To do that, follow these directions:

wget https://spamassassin.apache.org/updates/GPG.KEY
sa-update --import GPG.KEY
chown -R spamd:root /var/lib/spamassassin/sa-update-keys
chmod -R 775 /var/lib/spamassassin/sa-update-keys
sa-update -D

Edit:

/etc/cron.daily/spamassassin at line 53:

Change RANGE=3600 to RANGE=10

Lastly,

cd /etc/cron.daily
./spamassassin