summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-02-02 01:37:50 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-02-02 01:37:50 (GMT)
commitadad5fbdcaf4115b751c6caee3af401b33e2efdc (patch)
tree0092c4ad9785bb06ef707bec1fe29f8418bded15 /etc
parent2027f7f887e2c0d29c05b80f5cf9b170ea88d802 (diff)
downloadsite-adad5fbdcaf4115b751c6caee3af401b33e2efdc.tar.gz
Filter GitHub notification emails
Have GitHub send notifications to plugins+github@, and try to distinguish actual user comments from mere status change reports. Right now, both types of notifications are forwarded to the devel@ list, but in the future, we could choose to omit the status change emails. While at it, the messages are also modified to make them more suitable for being forwarded to a mailing list.
Diffstat (limited to 'etc')
-rw-r--r--etc/forward1
-rw-r--r--etc/procmailrc42
2 files changed, 42 insertions, 1 deletions
diff --git a/etc/forward b/etc/forward
deleted file mode 100644
index ece2155..0000000
--- a/etc/forward
+++ /dev/null
@@ -1 +0,0 @@
1admin@monitoring-plugins.org
diff --git a/etc/procmailrc b/etc/procmailrc
new file mode 100644
index 0000000..ea35845
--- /dev/null
+++ b/etc/procmailrc
@@ -0,0 +1,42 @@
1SHELL = /bin/sh
2PATH = /usr/bin:/bin
3LOGFILE = $HOME/log/procmail.log
4GITHUB_FILTER = $HOME/libexec/filter-github-emails
5DEFAULT_RECIPIENT = admin@monitoring-plugins.org
6EXTENSION = $1
7
8#
9# Handle emails sent to <plugins+github@monitoring-plugins.org>.
10#
11:0
12* EXTENSION ?? ^^github^^
13* ! ^X-Loop: plugins@monitoring-plugins\.org
14{
15 :0 fw
16 | $GITHUB_FILTER
17
18 :0 fhw
19 * ^To:(.*[^-a-zA-Z0-9_.])?devel@monitoring-plugins\.org
20 | formail -A 'X-Loop: plugins@monitoring-plugins.org'
21
22 :0 a
23 ! devel@monitoring-plugins.org
24}
25
26#
27# Handle emails that shouldn't be forwarded to the mailing list.
28#
29:0
30* ! ^X-Loop: plugins@monitoring-plugins\.org
31{
32 FROM = `formail -c -x 'From ' | cut -d ' ' -f 1`
33
34 :0 fhw
35 | formail -A 'X-Loop: plugins@monitoring-plugins.org' \
36 -A "X-Original-From: $FROM"
37
38 :0
39 ! $DEFAULT_RECIPIENT
40}
41
42# vim:set filetype=procmail: