From: martin f. krafft Date: Sun, 26 Aug 2007 19:52:38 +0000 (+0200) Subject: rewrite tickler for new system X-Git-Url: https://git.madduck.net/etc/mailfilter.git/commitdiff_plain/3fd481d208c03d80095d0c912f636630cab978b6?ds=inline rewrite tickler for new system --- diff --git a/procmail/tickle b/procmail/tickle index 71edef6..dac3fb7 100644 --- a/procmail/tickle +++ b/procmail/tickle @@ -1,21 +1,48 @@ :0 -* ORIGINAL_TO ?? ^[0-9]+@tickle\.madduck\.net$ -* ORIGINAL_TO ?? ^\/[0-9]+ +* ORIGINAL_TO ?? ^.+@tickle\.madduck\.net$ +* ORIGINAL_TO ?? ^\/[^@]+ { - TICKLEDIR=$BASE/.tickle.$MATCH - + STAMP :0 - * ? test ! -d $TICKLEDIR/cur - { - LOG="tickle: received message outside tickle range: $MATCH$NL" + * MATCH ?? ^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$ + { STAMP=$MATCH } + + :0 E + * MATCH ?? ^[0-9]+m$ + * MATCH ?? ^\/[^m] + { DATESTR="$DATE + $MATCH months 00:00" } + + :0 E + * MATCH ?? ^[0-9]+w$ + * MATCH ?? ^\/[^w] + { DATESTR="$DATE + $MATCH weeks 00:00" } + + :0 E + * MATCH ?? ^[0-9]+d?$ + * MATCH ?? ^\/[^d] + { DATESTR="$DATE + $MATCH days 00:00" } - :0 - $DISCARD + :0 E + * MATCH ?? ^[0-9]+h$ + * MATCH ?? ^\/[^h] + { DATESTR="$DATE + $MATCH hours" } + + :0 E + { + LOG="tickle: invalid date string: $MATCH$NL" + EXITCODE=69 + HOST } - LOG="tickle: file message and tickle in $MATCH day(s)$NL" + :0 + * ! STAMP ?? . + { STAMP=`/bin/date +%s -d "$DATESTR"` } + + LOG="tickle: stamping message $MSGID with $STAMP$NL" + + :0 fw + |$FORMAIL -i "X-Tickle: $STAMP" :0 - $TICKLEDIR/ - TICKLEDIR + $BASE/.tickler/ }