X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/5950d5c4e05d47338e97a80dfa0909bf9c870ee5..26fb5cef7afa71e9f46fee7e32f5b351f3c52457:/bin/release-delayed-messages diff --git a/bin/release-delayed-messages b/bin/release-delayed-messages index 61abd85..7ea142e 100755 --- a/bin/release-delayed-messages +++ b/bin/release-delayed-messages @@ -1,9 +1,19 @@ #!/bin/sh set -eu +exit 0 DELAYED_QUEUE=$HOME/.maildir/.delayed 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 --all "$DELAYED_QUEUE" \ | exec xargs "$DIR"/resubmit --list