Not complete documentation of MIMEDefang and spamassassin setup
Hook for reloading mimedefang when spamassassin rules have been updated \\
/etc/spamassassin/sa-update-hooks.d/reload-mimedefang
#!/bin/sh
if [ -x /etc/init.d/mimedefang ]; then
/etc/init.d/mimedefang reread > /dev/null
fi
Add GPG key for sought rules
wget http://yerp.org/rules/GPG.KEY
sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys --import /tmp/GPG.KEY
Fix for error message with systemd and also added support for updating sought rules
--- etc/cron.daily/spamassassin 2015-01-31 20:08:47.000000000 +0100
+++ /etc/cron.daily/spamassassin 2015-12-05 21:44:54.882759469 +0100
@@ -49,9 +49,9 @@
reload() {
# Reload
if which invoke-rc.d >/dev/null 2>&1; then
- invoke-rc.d spamassassin reload > /dev/null
+ invoke-rc.d --quiet spamassassin status > /dev/null && invoke-rc.d spamassassin reload > /dev/null
else
- /etc/init.d/spamassassin reload > /dev/null
+ /etc/init.d/spamassassin status > /dev/null && /etc/init.d/spamassassin reload > /dev/null
fi
if [ -d /etc/spamassassin/sa-update-hooks.d ]; then
run-parts --lsbsysinit /etc/spamassassin/sa-update-hooks.d
@@ -71,7 +71,9 @@
env -i LANG="$LANG" PATH="$PATH" start-stop-daemon \
--chuid debian-spamd:debian-spamd --start \
--exec /usr/bin/sa-update -- \
- --gpghomedir /var/lib/spamassassin/sa-update-keys 2>&1
+ --gpghomedir /var/lib/spamassassin/sa-update-keys \
+ --gpgkey 6C6191E3 --channel sought.rules.yerp.org \
+ --channel updates.spamassassin.org 2>&1
case $? in
0)
Enable sa-update
--- etc/default/spamassassin 2015-01-31 20:07:51.000000000 +0100
+++ /etc/default/spamassassin 2015-09-12 09:31:47.747305219 +0200
@@ -31,4 +31,4 @@
# Cronjob
# Set to anything but 0 to enable the cron job to automatically update
# spamassassin's rules on a nightly basis
-CRON=0
+CRON=1