1098ea031af843991058f4b18e530340ba3cfee5
[distro-setup] / subdir_files / sieve / main.sieve
1 # Sieve filter
2 # note: main is just a random name, since dovecot required a name
3 ##
4 require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ];
5
6 # many examples out there check for "X-Spam-Status" "^Yes", but we do
7 # this in exim, which doesn't add that by default. We could modify it's
8 # config to add $spam_action to a header, like other headers, but simply
9 # using an integer threshold here is simpler: the default threshold for
10 # spamassassin is 5, so we have 5 plus symbols here.
11 if header :regex "x-spam_bar" "^\\+{5}" {
12 fileinto :create "Junk";
13 stop;
14 }
15
16 include :personal "personal";
17 include :personal "lists";
18
19
20 # note, i originally used something like this to filter mailing lists
21 # http://www.dovecot.org/list/dovecot/2014-September/097846.html
22 # However, I found that there were a lot of special cases
23 # where I did not want them filtered, like small mailing lists, etc,
24 # so I prefer to keep a list of lists that I want filed into folders.
25 # However, it was useful as an example for constructing that code.