]> 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:

route tickler via resubmit and delay queue
[etc/mailfilter.git] / procmail / tickle
1 :0
2 * ORIGINAL_TO ?? ^.+@tickle\.madduck\.net$
3 * ORIGINAL_TO ?? ^\/[^@]+
4 { TICKLE="$MATCH" }
5
6 :0 E
7 *$ ^X-Tickle:${RE_SPACE}+\/${RE_NOT_SPACE}+
8 { TICKLE="$MATCH" }
9
10 :0
11 * TICKLE ?? .
12 * ! DEST ?? .
13 * ! TICKLE_DELIVERED ?? .
14 {
15   LOG="tickle:      '$TICKLE'$NL"
16   DAILY_DELIVERY_TIME=04:20
17   JUST_DATE="`$BIN_DATE -d \"$DATE\" +%x`"
18
19   :0
20   * TICKLE ?? ^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$
21   { DELAY="@$TICKLE" }
22
23   :0 E
24   * TICKLE ?? ^[0-9]+h$
25   * TICKLE ?? ^\/[^h]+
26   { DELAY="$DATE + $MATCH hours" }
27
28   :0 E
29   * TICKLE ?? ^[0-9]+m$
30   * TICKLE ?? ^\/[^m]+
31   { DELAY="$JUST_DATE + $MATCH months $DAILY_DELIVERY_TIME" }
32
33   :0 E
34   * TICKLE ?? ^[0-9]+w$
35   * TICKLE ?? ^\/[^w]+
36   { DELAY="$JUST_DATE + $MATCH weeks $DAILY_DELIVERY_TIME" }
37
38   :0 E
39   * TICKLE ?? ^[0-9]+d?$
40   * TICKLE ?? ^\/[^d]+
41   { DELAY="$JUST_DATE + $MATCH days $DAILY_DELIVERY_TIME" }
42
43   :0 E
44   {
45     LOG="tickle:      invalid tickler date string: $TICKLE$NL"
46     EXITCODE=69
47     HOST
48   }
49
50   JUST_DATE
51   DAILY_DELIVERY_TIME
52
53   LOG="tickle:      delaying message until $DELAY$NL"
54   DELAYED_QUEUE=$TICKLER_QUEUE
55
56   # unset DISABLE_DELAYS to enable delaying for tickle messages
57   DISABLE_DELAYS
58 }
59
60 TICKLE
61
62 # vim:ft=procmail