Blob Blame History Raw
#!/bin/bash
# *** DO NOT MODIFY THIS FILE ***
# Edit /etc/cron.d/sa-update to enable nightly automatic updates
# /etc/mail/spamassassin/sa-update-channels.txt 
#     Specify custom channels here
# /etc/mail/spamassassin/sa-update-keys.txt
#     Specify trusted GPG keys for custom channels here

# Sleep random amount of time before proceeding to avoid overwhelming the servers
sleep $(expr $RANDOM % 7200)

# sa-update must create keyring
if [ ! -d /etc/mail/spamassassin/sa-update-keys ]; then
    sa-update
fi
# Import SOUGHT key
sa-update --import /usr/share/spamassassin/sought-pubkey.txt

# Update rules with sa-update, restart spamd if rules were updated
/usr/bin/sa-update --channelfile /etc/mail/spamassassin/sa-update-channels.txt \
                   --gpgkeyfile  /etc/mail/spamassassin/sa-update-keys.txt     && \
                   /etc/init.d/spamassassin condrestart > /dev/null