From 519207b89004aa4a4b360767fa30aa48afaa6139 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 2 Mar 2008 16:44:40 +0100 Subject: [PATCH 1/1] proper handling of X-Postponed header --- procmail/addheaders | 4 ++++ procmail/defines | 2 +- procmail/delay-delivery | 11 ++++++----- procmail/tickle | 7 ++++++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/procmail/addheaders b/procmail/addheaders index cbfc9ed..6d739c1 100644 --- a/procmail/addheaders +++ b/procmail/addheaders @@ -14,4 +14,8 @@ * EQ_DOMAIN ?? . |$FORMAIL -A"X-EqDomain: $ORIG_DOMAIN" -A"X-EqTo: $EQ_LOCAL@$EQ_DOMAIN" +:0 fw +* POSTPONED ?? . +|$FORMAIL -I"X-Postponed: $POSTPONED" + # vim:ft=procmail diff --git a/procmail/defines b/procmail/defines index 17b3d3c..dc9663a 100644 --- a/procmail/defines +++ b/procmail/defines @@ -157,7 +157,7 @@ INCLUDERC=$PMDIR/get-msgid :0 *$ ^X-Postponed:$RE_EXTRACT_HEADER_VALUE -{ DELAYED="$MATCH" } +{ POSTPONED="$MATCH" } # fix variable values for special cases INCLUDERC=$PMDIR/normalise diff --git a/procmail/delay-delivery b/procmail/delay-delivery index 9b79534..cfe3403 100644 --- a/procmail/delay-delivery +++ b/procmail/delay-delivery @@ -1,9 +1,12 @@ #TODO: create config/delay-(disabled|tonight|weekend) -:0 +:0 fw +* POSTPONED ?? . +|$FORMAIL -R X-Postponed X-Was-Postponed + +:0 E * ! DISABLE_DELAYS ?? . * DELAY ?? . -* ! DELAYED ?? . { #TODO: for tickling, use header date RELEASE="`$BIN_DATE -d \"$DELAY\" +'%s %c'`" @@ -21,9 +24,7 @@ { RELEASE_TIME="$MATCH" } LOG="delay: delay delivery of $MSGID until $RELEASE_TIME$NL" - - :0 fw - |$FORMAIL -I "X-Postponed: $RELEASE_TS ($RELEASE_TIME)" + POSTPONED="$RELEASE_TS ($RELEASE_TIME)" INCLUDERC=$PMDIR/record-delayed-mail diff --git a/procmail/tickle b/procmail/tickle index 6557848..6b0276a 100644 --- a/procmail/tickle +++ b/procmail/tickle @@ -1,9 +1,14 @@ # The X-Tickle header has priority over the Original-To address :0 *$ ^X-Tickle:${RE_SPACE}+\/${RE_NOT_SPACE}+ -{ TICKLE="$MATCH" } +{ + TICKLE="$MATCH" + :0 fw + |$FORMAIL -IX-Tickle +} :0 E +* ! POSTPONED ?? . * ORIGINAL_TO ?? ^.+@tickle\.madduck\.net$ * ORIGINAL_TO ?? ^\/[^@]+ { TICKLE="$MATCH" } -- 2.39.5