e spamtest error: expected 1 arg, filename >&2
return 1
fi
- sdncmdroot spamassassin sudo -u Debian-exim spamassassin -t --cf='score PYZOR_CHECK 0' <"$1"
+ spamd_ser=spamd
+ if systemctl cat spamassassin &>/dev/null; then
+ spamd_ser=spamassassin
+ fi
+ sdncmdroot $spamd_ser sudo -u Debian-exim spamassassin -t --cf='score PYZOR_CHECK 0' <"$1"
}
}
spamnn() {
local spamdpid
- spamdpid=$(systemctl show --property MainPID --value spamassassin)
+ spamd_ser=spamd
+ if systemctl cat spamassassin &>/dev/null; then
+ spamd_ser=spamassassin
+ fi
+ spamdpid=$(systemctl show --property MainPID --value $spamd_ser)
m sudo nsenter -t $spamdpid -n -m sudo -u Debian-exim spamassassin "$@"
}
unboundbash() {
first_spamd_run=true
fi
+# rspamd background. I kept seeing spamassassin at the top of top, and
+# seeming to cause my cpu fans to speed up, and remembered that rspamd
+# was supposed to be more efficient. But the last benchmark I could find
+# was at least 8 years old. so, I did a test of scanning 1 message,
+# systemd-run via my jdo func shows: CPU time consumed: 21ms vs
+# 946ms. Wow, 2.2% cpu use. Ok, switching.
# light version of exim does not have sasl auth support.
# note: for bitfolk hosts, unbound has important config with conflink.
pi-nostart exim4 exim4-daemon-heavy spamassassin unbound clamav-daemon wireguard
+spamd_remove=spamassassin
spamd_ser=spamd
if systemctl cat spamassassin &>/dev/null; then
+ spamd_remove=spamd
spamd_ser=spamassassin
elif $first_spamd_run; then
if spamd-timer-exists; then
done
;;
*)
- for unit in exim4 $spamd_ser dovecot unbound; do
+ for unit in exim4 $spamd_ser $spamd_remove dovecot unbound; do
f=/etc/systemd/system/$unit.service.d/nn.conf
if [[ -s $f ]]; then
rm -fv $f
# 2020-10-19 remove old file. remove this when all hosts updated
rm -fv /etc/systemd/system/spamddnsfix.{timer,service}
+rm -f /etc/default/$spamd_remove
u /etc/default/$spamd_ser <<'EOF'
# defaults plus debugging flags for an issue im having
OPTIONS="--create-prefs --max-children 5 --helper-home-dir"
DEBBUGS_DOMAIN = b.b8.nz
-
EOF
if dpkg --compare-versions "$(dpkg-query -f='${Version}\n' --show exim4)" ge 4.94; then