From 0e6de930e8c8037587f9843f39a0611f22fd78ca Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 23 Sep 2007 22:15:34 +0200 Subject: [PATCH] script to process the delayed queue --- bin/process-delayed-queue | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bin/process-delayed-queue diff --git a/bin/process-delayed-queue b/bin/process-delayed-queue new file mode 100755 index 0000000..82818eb --- /dev/null +++ b/bin/process-delayed-queue @@ -0,0 +1,22 @@ +#!/bin/sh +set -eu + +MAILDIR=$HOME/.maildir + +SQLITE=/usr/bin/sqlite3 +RESUBMIT=$HOME/.etc/mailfilter/bin/resubmit + +DELAYED_QUEUE_DB=$VAR/procmail/delayed-queue.sqlite + +QUERY='select * from messages where release_ts < strftime("%s", "now")' + +$SQLITE -column $DELAYED_QUEUE_DB "$QUERY" | while read msgid file ts; do + file="$MAILDIR/$file" + if [ ! -f "$file" ]; then + echo "E: message $msgid not found in $file" >&2 + else + $RESUBMIT "$file" + echo "I: resubmitted $msgid" >&2 + fi + $SQLITE $DELAYED_QUEUE_DB "delete from messages where msgid = '$msgid'" +done -- 2.39.5