X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/eddb5ee317cb1d447bc5d9fa74de6287f2838a59..3d7d576505af2759a6227cec6bef322c688ec3f9:/bin/resubmit diff --git a/bin/resubmit b/bin/resubmit index 01990b2..5ef8237 100755 --- a/bin/resubmit +++ b/bin/resubmit @@ -2,9 +2,12 @@ set -eu PROCMAIL=$HOME/.etc/mailfilter/procmail/procmailrc +FORMAIL="formail -I 'X-Resubmitted: $(date -R)'" -if [ -z "$1" ]; then - cat | exec $PROCMAIL +if [ -z "${1:-}" ]; then + $FORMAIL | exec $PROCMAIL else - exec $PROCMAIL < "$1" + $FORMAIL "$1" | $PROCMAIL && rm -f "$1" fi + +exit 0