getspamdpid() {
if [[ ! $spamdpid || ! -d /proc/$spamdpid ]]; then
# try twice in case we are restarting, it happens.
- for i in 1 2; do
+ for (( i=0; i<2; i++ )); do
spamdpid=$(systemctl show --property MainPID --value spamassassin | sed 's/^[10]$//' ||:)
if [[ $spamdpid ]]; then
break
# TODO, get je to deliver the local mailbox: /m/md/INBOX
# dovecot appears to setup, i can t be sure.
+spamd_ser=spamd
+if systemctl cat spamassassin &>/dev/null; then
+ spamd_ser=spamassassin
+fi
+
source /a/bin/bash_unpublished/source-state
doprom=false
fi
e spamdpid: $spamdpid
if [[ ! $spamdpid ]]; then
- echo mailtest spamd pid not found. systemctl status spamassassin:
- systemctl status spamassassin
+ echo mailtest spamd pid not found. systemctl status $spamd_ser:
+ systemctl status $spamd_ser
fi
tmpfile=$(mktemp)
declare -i unexpected=0