From aa98d86febdc0be6987a35667981ad1db201bf45 Mon Sep 17 00:00:00 2001 From: andryyy Date: Mon, 8 May 2017 00:27:16 +0200 Subject: [PATCH] Sieve rule for tags changed --- data/conf/dovecot/sieve_after | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/data/conf/dovecot/sieve_after b/data/conf/dovecot/sieve_after index 0b43dbcf..2e0cfe08 100644 --- a/data/conf/dovecot/sieve_after +++ b/data/conf/dovecot/sieve_after @@ -9,16 +9,13 @@ if header :contains "X-Spam-Flag" "YES" { } if allof ( - envelope :detail :matches "to" "*", - header :contains "X-Moo-Tag" "YES", - mailboxexists "INBOX/${s}" - ) { - fileinto "INBOX/${s}"; -} -elsif allof ( envelope :detail :matches "to" "*", header :contains "X-Moo-Tag" "YES" ) { - set :lower "s" "${1}"; - fileinto :create "INBOX/${s}"; + set :lower :upperfirst "tag" "${1}"; + if mailboxexists "INBOX/${1}" { + fileinto "INBOX/${1}"; + } else { + fileinto :create "INBOX/${tag}"; + } }