X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/5af333ca3b83425e5cb3aa704b37654d576856c1..20ed176efc99132a724682c2b29e16756fe40c38:/bin/retrain diff --git a/bin/retrain b/bin/retrain index a95fbc9..b1ccca1 100755 --- a/bin/retrain +++ b/bin/retrain @@ -1,8 +1,10 @@ #!/bin/sh set -eu -NICE='nice -20' -PROCMAIL="$HOME/.etc/mailfilter/procmail/procmailrc" +NICE='/usr/bin/nice -20' +NICE='' + +RESUBMIT="$NICE $HOME/.etc/mailfilter/bin/resubmit" PAUSETIME=10 @@ -50,9 +52,13 @@ if ! lockfile -0 -r0 -l 3600 "$LOCKFILE" 2>/dev/null; then fi find $MAILDIR/cur $MAILDIR/new -type f | while read msg; do - $NICE ${0%/*}/train $ARG "$msg" | $PROCMAIL || ret=$? + $NICE ${0%/*}/train $ARG "$msg" | $RESUBMIT || ret=$? case "${ret:-0}" in 0|75) :;; + *) + echo "E: resubmission returned with exit code $ret" >&2 + continue + ;; esac rm -f "$msg" sleep $PAUSETIME