浏览代码

[Dovecot] Change sieve scripts for DeltaChat

andryyy 4 年之前
父节点
当前提交
96a460c2fa
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      data/conf/dovecot/global_sieve_before

+ 9 - 3
data/conf/dovecot/global_sieve_before

@@ -1,10 +1,10 @@
 # global_sieve_before script
 # global_sieve_before -> user sieve_before (mailcow UI) -> user sieve_after (mailcow UI) -> global_sieve_after
 
-require "fileinto";
-require "mailbox";
+require ["imap4flags", "mailbox", "fileinto"];
 
-if header :contains ["Chat-Version"] [""] {
+if allof(header :contains ["Chat-Version"] [""],
+  header :contains ["Auto-Submitted"] ["auto-replied"]) {
   if mailboxexists "DeltaChat" {
     fileinto "DeltaChat";
   } else {
@@ -12,3 +12,9 @@ if header :contains ["Chat-Version"] [""] {
   }
   stop;
 }
+
+if allof(header :contains ["Chat-Version"] [""],
+  header :contains ["Autocrypt"] [""]) {
+  setflag "\\seen";
+  stop;
+}