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

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