various improvements
[distro-setup] / subdir_files / sieve / maintest.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 "personaltest";
17 include :personal "liststest";
18 include :personal "personalendtest";
19
20
21 # note, i originally used something like this to filter mailing lists
22 # http://www.dovecot.org/list/dovecot/2014-September/097846.html
23 # However, I found that there were a lot of special cases
24 # where I did not want them filtered, like small mailing lists, etc,
25 # so I prefer to keep a list of lists that I want filed into folders.
26 # However, it was useful as an example for constructing that code.