X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/3d7d576505af2759a6227cec6bef322c688ec3f9..cc317bf95109e223d0ec325217deb519a18ed9c6:/bin/resubmit diff --git a/bin/resubmit b/bin/resubmit index 5ef8237..17888f9 100755 --- a/bin/resubmit +++ b/bin/resubmit @@ -2,12 +2,16 @@ set -eu PROCMAIL=$HOME/.etc/mailfilter/procmail/procmailrc -FORMAIL="formail -I 'X-Resubmitted: $(date -R)'" +FORMAIL="/usr/bin/formail -I'X-Resubmitted: $(date -R)'" if [ -z "${1:-}" ]; then - $FORMAIL | exec $PROCMAIL + eval $FORMAIL | exec $PROCMAIL else - $FORMAIL "$1" | $PROCMAIL && rm -f "$1" + if [ ! -f "$1" ]; then + echo "E: no such file: $1" >&2 + exit 1 + fi + eval $FORMAIL < "$1" | $PROCMAIL && rm -f "$1" fi exit 0