summaryrefslogtreecommitdiffstats
path: root/.config/dovecot/canonical.sieve
blob: 3802ffb3ed4694b2c54036e5e9f9b8b087e9e2b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
require [ "regex", "variables", "fileinto", "envelope", "mailbox",
  "imap4flags", "include" ];

if address :is "from" "noreply+chat@canonical.com" {
  fileinto :create "mattermost";
  stop;
}

if address :is "from" "noreply+discourse@canonical.com" {
  fileinto :create "discourse";
  stop;
}

if address :is :domain "from" ["discourse.ubuntu.com", "forum.snapcraft.io", "discourse.charmhub.io"] {
  fileinto :create "discourse";
  stop;
}

if address :is "from" "jira@warthogs.atlassian.net" {
  fileinto :create "jira";
  stop;
}

if address :is :domain "from" "rt.canonical.com" {
  fileinto :create "rt";
  stop;
}

if address :matches :domain "from" ["launchpad.net", "*.launchpad.net"] {
  fileinto :create "launchpad";
  stop;
}

if address :is "from" "gitlab@salsa.debian.org" {
  fileinto :create "salsa";
  stop;
}

if address :is "from" "bugzilla-daemon@mozilla.org" {
  fileinto :create "bugzilla";
  stop;
}

if address :is "to" "ftp-release-notifications@gnome.org" {
  fileinto :create "gnome-releases";
  stop;
}

if address :is "from" "notifications@github.com" {
  keep;
  stop;
}

if header :regex "list-id" "<.+.xt.local>" {
  keep;
  stop;
}

if allof (header :regex "list-id" "<([a-z_0-9-]+)[.@]",
  not address :regex :localpart "from" "^(no)?reply")
{
  set :lower "listname" "${1}";
  fileinto :create "l.${listname}";
  stop;
}