summaryrefslogtreecommitdiffstats
path: root/.config/dovecot/canonical.sieve
blob: ef510a46b9dc234c7f47aa189267d2c3a6853296 (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
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"] {
  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" "notifications@github.com" {
  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;
}