]> git.madduck.net Git - etc/mailfilter.git/blob - procmail/tickle

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

always filter gpg mail into inbox
[etc/mailfilter.git] / procmail / tickle
1 :0
2 * ! DEST ?? .
3 * ! TICKLE_DELIVERED ?? .
4 * ORIGINAL_TO ?? ^.+@tickle\.madduck\.net$
5 * ORIGINAL_TO ?? ^\/[^@]+
6 {
7   DELIVERY_TIME=04:20
8   STAMP
9
10   :0
11   * MATCH ?? ^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$
12   { DELAY="@$MATCH" }
13
14   :0 E
15   * MATCH ?? ^[0-9]+h$
16   * MATCH ?? ^\/[^h]+
17   { DELAY="$DATE + $MATCH hours" }
18
19   JUST_DATE="`$BIN_DATE -d \"$DATE\" +%x`"
20
21   :0 E
22   * MATCH ?? ^[0-9]+m$
23   * MATCH ?? ^\/[^m]+
24   { DELAY="$JUST_DATE + $MATCH months $DELIVERY_TIME" }
25
26   :0 E
27   * MATCH ?? ^[0-9]+w$
28   * MATCH ?? ^\/[^w]+
29   { DELAY="$JUST_DATE + $MATCH weeks $DELIVERY_TIME" }
30
31   :0 E
32   * MATCH ?? ^[0-9]+d?$
33   * MATCH ?? ^\/[^d]+
34   { DELAY="$JUST_DATE + $MATCH days $DELIVERY_TIME" }
35
36   JUST_DATE
37   DELIVERY_TIME
38
39   :0 E
40   {
41     LOG="tickle:      invalid date string: $MATCH$NL"
42     EXITCODE=69
43     HOST
44   }
45
46   DELAYED_QUEUE=$BASE/.store/
47
48   :0 fw
49   |$FORMAIL -i 'X-Tickle: yes'
50
51 #  :0
52 #  * ! STAMP ?? .
53 #  { STAMP=`$BIN_DATE +'%s (%c)' -d "$DELAY"` }
54 #
55 #  :0
56 #  * ! STAMP ?? ^[0-9]+ \([A-Za-z ]+ [0-9 :]+\)$
57 #  {
58 #    LOG="tickle:      error creating timestamp ($STAMP), using \$now$NL"
59 #    STAMP="`$BIN_DATE +%s` (ERROR: original stamp '$STAMP' invalid)"
60 #  }
61 #
62 #  :0 E
63 #  { LOG="tickle:      stamping message $MSGID with $STAMP$NL" }
64 #
65 #  :0 fw
66 #  |$FORMAIL -i "X-Tickle: $STAMP"
67 #
68 #  :0
69 #  { DEST=$TICKLER_QUEUE }
70 }
71
72 # vim:ft=procmail