Modifications : etc/sv/dovecot
[lhc/ateliers.git] / etc / dovecot / sieve / global.d / list.sieve
1 require
2 [ "date"
3 , "fileinto"
4 , "mailbox"
5 , "variables"
6 ];
7
8 if currentdate :matches "year" "*" { set "year" "${1}"; }
9 if currentdate :matches "month" "*" { set "month" "${1}"; }
10
11 if exists "List-ID" {
12 if header :matches "List-ID" "*<*.heureux-cyclage.org>*" {
13 set "list" "${2}";
14 set "domain" "LHC";
15 }
16 elsif header :matches "List-ID" "*<*.*.cyclocoop.org>*" {
17 set "list" "${2}+${3}";
18 set "domain" "cyclocoop";
19 }
20 elsif header :matches "List-ID" "*<*.cyclocoop.org>*" {
21 set "list" "${2}";
22 set "domain" "cyclocoop";
23 }
24 elsif header :matches "List-ID" "*<*.*.ptitvelo.net>*" {
25 set "list" "${2}+${3}";
26 set "domain" "ptitvelo";
27 }
28 elsif header :matches "List-ID" "*<*.ptitvelo.net>*" {
29 set "list" "${2}";
30 set "domain" "ptitvelo";
31 }
32 elsif header :matches "List-ID" "*<*.*.*.*>*" {
33 set "list" "${2}";
34 set "domain" "${4}";
35 }
36 elsif header :matches "List-ID" "*<*.*.*>*" {
37 set "list" "${2}";
38 set "domain" "${3}";
39 }
40 fileinto :create "Listes+${domain}+${list}+${year}+${month}";
41 stop;
42 }