From: martin f. krafft Date: Sun, 23 Sep 2007 17:10:21 +0000 (+0200) Subject: more robust retraining with resubmission X-Git-Url: https://git.madduck.net/etc/mailfilter.git/commitdiff_plain/b950ed9b38f03bb658650d6e6e52a122ab5c1fc8?hp=0f4bcee75353935ff9bc605f7e0b31d12e302605 more robust retraining with resubmission --- diff --git a/bin/resubmit b/bin/resubmit index 63f8a02..8405e77 100755 --- a/bin/resubmit +++ b/bin/resubmit @@ -3,7 +3,7 @@ set -eu PROCMAIL=$HOME/.etc/mailfilter/procmail/procmailrc -if [ -z "$1" ]; then +if [ -z "${1:-}" ]; then cat | exec $PROCMAIL else $PROCMAIL < "$1" && rm -f "$1" diff --git a/bin/retrain b/bin/retrain index fa7a244..b1ccca1 100755 --- a/bin/retrain +++ b/bin/retrain @@ -55,6 +55,10 @@ find $MAILDIR/cur $MAILDIR/new -type f | while read msg; do $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