From 406e0c358dbe50c3ff0463c12f3d9bcdccfaf5d2 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 23 Sep 2007 21:24:43 +0200 Subject: [PATCH] postpone delaying and fix resubmission --- procmail/cleanup | 2 +- procmail/defines | 4 ++++ procmail/dejavu | 7 +++++++ procmail/delay-delivery | 7 ++----- procmail/procmailrc | 9 ++++++--- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/procmail/cleanup b/procmail/cleanup index 286614d..be6dd86 100644 --- a/procmail/cleanup +++ b/procmail/cleanup @@ -6,7 +6,7 @@ :0 fw |$FORMAIL \ -IX-EqDomain -IX-EqTo -IX-Justme -IX-Spamtrapped \ - -IX-Delay -IX-Tickle \ + -IX-Delayed -IX-Tickle \ -IX-Trained-As \ -IX-UID -IX-OfflineIMAP- \ -IX-Status -IStatus -IX-Keywords -IContent-Length diff --git a/procmail/defines b/procmail/defines index 62464dd..2e8c1f5 100644 --- a/procmail/defines +++ b/procmail/defines @@ -133,6 +133,10 @@ INCLUDERC=$PMDIR/get-msgid *$ ^X-Tickle-Delivered:$RE_EXTRACT_HEADER_VALUE { TICKLE_DELIVERED="$MATCH" } +:0 +*$ ^X-Delayed:$RE_EXTRACT_HEADER_VALUE +{ DELAYED="$MATCH" } + # fix variable values for special cases INCLUDERC=$PMDIR/normalise diff --git a/procmail/dejavu b/procmail/dejavu index 298abae..269e070 100644 --- a/procmail/dejavu +++ b/procmail/dejavu @@ -4,3 +4,10 @@ LOG="dejavu: re-processing message $MSGID$NL" MSG_DEJAVU } + +:0 E +* DELAYED ?? . +{ + LOG="dejavu: processing delayed message $MSGID$NL" + MSG_DEJAVU +} diff --git a/procmail/delay-delivery b/procmail/delay-delivery index 543c01c..405cbcb 100644 --- a/procmail/delay-delivery +++ b/procmail/delay-delivery @@ -1,12 +1,9 @@ -:0 -* ^X-Mailer: swaks -{ DELAY="30 seconds" } - # create table messages (msgid text unique not null, filename text # primary key not null unique, release_ts integer not null); :0 * DELAY ?? . +* ! DELAYED ?? . { #TODO: for tickling, use header date RELEASE="`date -d \"now + $DELAY\" +'%s %c'`" @@ -30,7 +27,7 @@ TRAP="$TRAP; $DO_QUERY '$Q'" :0 fw - |$FORMAIL -I "X-Delay: $RELEASE_TS ($RELEASE_TIME)" + |$FORMAIL -I "X-Delayed: $RELEASE_TS ($RELEASE_TIME)" :0 $DELAYED_QUEUE diff --git a/procmail/procmailrc b/procmail/procmailrc index 8ddb567..8cf658a 100755 --- a/procmail/procmailrc +++ b/procmail/procmailrc @@ -36,15 +36,18 @@ INCLUDERC=$PMDIR/spamfilter INCLUDERC=$PMDIR/handlespam #INCLUDERC=$PMDIR/autoreplies + INCLUDERC=$PMDIR/tickle -INCLUDERC=$PMDIR/delay-delivery INCLUDERC=$PMDIR/listquirks +INCLUDERC=$PMRULES/all + +INCLUDERC=$PMDIR/addheaders + #INCLUDERC=$PMDIR/lurker INCLUDERC=$PMDIR/spool -INCLUDERC=$PMRULES/all +INCLUDERC=$PMDIR/delay-delivery -INCLUDERC=$PMDIR/addheaders INCLUDERC=$PMDIR/deliver -- 2.39.5