X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/f1e2a8d4676f834f1eb06cc9ca66a8998e03aabf..48789abfb13b0713aeb5c60e7be3961322ce6181:/bin/resubmit-postponed-messages diff --git a/bin/resubmit-postponed-messages b/bin/resubmit-postponed-messages index 1ea3100..df5663e 100755 --- a/bin/resubmit-postponed-messages +++ b/bin/resubmit-postponed-messages @@ -6,5 +6,14 @@ TICKLER_QUEUE=$HOME/.maildir/.store DIR="${0%/*}" +VAR=$HOME/.var/procmail +ME="${0##*/}" +LOCKFILE="$VAR/.$ME.lock" +trap "rm -f $LOCKFILE" 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15 +if ! lockfile -0 -r0 -l 3600 "$LOCKFILE" 2>/dev/null; then + echo "E: another $ME process is already running over that Maildir." >&2 + exit 1 +fi + "$DIR"/list-postponed-messages "$TICKLER_QUEUE" "$DELAYED_QUEUE" \ | exec xargs "$DIR"/resubmit --list