Correction : filtres des listes de courriels plus fins.
authorJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Mon, 2 Sep 2013 14:19:14 +0000 (16:19 +0200)
committerroot <root@ateliers.heureux-cyclage.org>
Mon, 2 Sep 2013 14:20:39 +0000 (16:20 +0200)
etc/dovecot/sieve/global.d/list.sieve

index d7ff6e7..39f5ce5 100644 (file)
@@ -9,10 +9,26 @@ if currentdate :matches "year"  "*" { set "year"  "${1}"; }
 if currentdate :matches "month" "*" { set "month" "${1}"; }
 
 if exists "List-ID" {
 if currentdate :matches "month" "*" { set "month" "${1}"; }
 
 if exists "List-ID" {
-       if header :matches "List-ID" "*<*.*.*>*" {
+       if header :matches "List-ID" "*<*.heureux-cyclage.org>*" {
+               set "list"   "${2}";
+               set "domain" "LHC";
+        }
+       elsif header :matches "List-ID" "*<*.*.cyclocoop.org>*" {
+               set "list"   "${2}+${3}";
+               set "domain" "cyclocoop";
+        }
+       elsif header :matches "List-ID" "*<*.cyclocoop.org>*" {
+               set "list"   "${2}";
+               set "domain" "cyclocoop";
+        }
+       elsif header :matches "List-ID" "*<*.*.*.*>*" {
+               set "list"   "${2}";
+               set "domain" "${4}";
+        }
+       elsif header :matches "List-ID" "*<*.*.*>*" {
                set "list"   "${2}";
                set "domain" "${3}";
         }
                set "list"   "${2}";
                set "domain" "${3}";
         }
-       fileinto :create "Lists.${domain}.${list}.${year}.${month}";
+       fileinto :create "Listes+${domain}+${list}+${year}+${month}";
        stop;
  }
        stop;
  }