From 79d0e99e58156360ec1f9a62e42ec203b0d8111f Mon Sep 17 00:00:00 2001 From: PLANTROON Date: Fri, 3 Feb 2023 00:26:42 +0100 Subject: [PATCH] Add Date header if it's missing --- data/conf/dovecot/global_sieve_before | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/data/conf/dovecot/global_sieve_before b/data/conf/dovecot/global_sieve_before index 3e79ca1d..ef9f5474 100644 --- a/data/conf/dovecot/global_sieve_before +++ b/data/conf/dovecot/global_sieve_before @@ -1,7 +1,13 @@ # global_sieve_before script # global_sieve_before -> user sieve_before (mailcow UI) -> user sieve_after (mailcow UI) -> global_sieve_after -require ["mailbox", "fileinto"]; +require ["mailbox", "fileinto", "date", "editheader", "variables"]; + +if not exists "Date" { + if date :matches "received" "std11" "*" { + addheader :last "Date" "${1}"; + } +} if header :contains ["Chat-Version"] [""] { if mailboxexists "DeltaChat" {