Correction : filtres des listes de courriels plus fins.
[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" "*<*.*.*.*>*" {
25 set "list" "${2}";
26 set "domain" "${4}";
27 }
28 elsif header :matches "List-ID" "*<*.*.*>*" {
29 set "list" "${2}";
30 set "domain" "${3}";
31 }
32 fileinto :create "Listes+${domain}+${list}+${year}+${month}";
33 stop;
34 }