]> Git — Sourcephile - sourcephile-nix.git/blob - hosts/mermet/dovecot/sieve/global/list.sieve
gitolite: update
[sourcephile-nix.git] / hosts / mermet / dovecot / sieve / global / list.sieve
1 require [ "date", "envelope", "fileinto", "mailbox", "subaddress", "variables" ];
2
3 #if currentdate :matches "year" "*" { set "year" "${1}"; }
4 #if currentdate :matches "month" "*" { set "month" "${1}"; }
5
6 if exists "X-MC-User" {
7 if header :matches "From" "*<*@*.asso.fr>*" {
8 fileinto :create "Listes+${3}";
9 stop;
10 }
11 elsif header :matches "From" "*<*@*.*>*" {
12 fileinto :create "Listes+${3}+${2}";
13 stop;
14 }
15 }
16 elsif exists "List-Id" {
17 if header :matches "List-Id" "*<*/*.lists.sr.ht>*" {
18 if allof (not string :is "${2}" "", not string :is "${3}" "") {
19 fileinto :create "Listes+sr.ht+${2}+${3}";
20 stop;
21 }
22 }
23 elsif header :matches "List-Id" "*<*.*.*.*>*" {
24 if allof (not string :is "${2}" "", not string :is "${3}" "", not string :is "${4}" "") {
25 fileinto :create "Listes+${4}+${3}+${2}";
26 stop;
27 }
28 }
29 elsif header :matches "List-Id" "*<*.*.*>*" {
30 if allof (not string :is "${2}" "", not string :is "${3}" "") {
31 fileinto :create "Listes+${3}+${2}";
32 stop;
33 }
34 }
35 }
36
37 if envelope :matches :detail "TO" "*" { set "extension" "${1}"; }
38 if not string :is "${extension}" "" {
39 fileinto :create "Listes+${extension}";
40 stop;
41 }