mermet: prosody: more advanced configuration
[sourcephile-nix.git] / hosts / mermet / dovecot / sieve / global / list.sieve
index 064659c67996c78bfed44d28b54095997afc5496..2b4d2de3748bad8d836d93fff9a3da9b38ee41bd 100644 (file)
@@ -1,4 +1,4 @@
-require [ "date", "envelope", "fileinto", "mailbox", "subaddress", "variables" ];
+require [ "envelope", "fileinto", "mailbox", "subaddress", "variables" ];
 
 #if currentdate :matches "year"  "*" { set "year"  "${1}"; }
 #if currentdate :matches "month" "*" { set "month" "${1}"; }
@@ -14,28 +14,20 @@ if exists "X-MC-User" {
   }
 }
 elsif exists "List-Id" {
-  if header :matches "List-Id" "*<*/*.lists.sr.ht>*" {
-    if allof (not string :is "${2}" "", not string :is "${3}" "")  {
-      fileinto :create "Listes+sr.ht+${2}+${3}";
-      stop;
-    }
+  if allof (header :matches "List-Id" "*<*/*.*.lists.sr.ht>*", not string :is "${2}" "", not string :is "${3}" "", not string :is "${4}" "")  {
+    fileinto :create "Listes+sr-ht+${2}+${3}+${4}";
+    stop;
   }
-  elsif header :matches "List-Id" "*<*.*.*.*>*" {
-    if allof (not string :is "${2}" "", not string :is "${3}" "", not string :is "${4}" "")  {
-      fileinto :create "Listes+${4}+${3}+${2}";
-      stop;
-    }
+  elsif allof (header :matches "List-Id" "*<*/*.lists.sr.ht>*", not string :is "${2}" "", not string :is "${3}" "")  {
+    fileinto :create "Listes+sr-ht+${2}+${3}";
+    stop;
   }
-  elsif header :matches "List-Id" "*<*.*.*>*" {
-    if allof (not string :is "${2}" "", not string :is "${3}" "")  {
-      fileinto :create "Listes+${3}+${2}";
-      stop;
-    }
+  elsif allof (header :matches "List-Id" "*<*.*.*.*>*", not string :is "${2}" "", not string :is "${3}" "", not string :is "${4}" "")  {
+    fileinto :create "Listes+${4}+${3}+${2}";
+    stop;
+  }
+  elsif allof (header :matches "List-Id" "*<*.*.*>*", not string :is "${2}" "", not string :is "${3}" "")  {
+    fileinto :create "Listes+${3}+${2}";
+    stop;
   }
-}
-
-if envelope :matches :detail "TO" "*" { set "extension" "${1}"; }
-if not string :is "${extension}" "" {
-  fileinto :create "Listes+${extension}";
-  stop;
 }