diff --git a/core/dovecot/conf/pigeonhole-sieve.dict b/core/dovecot/conf/pigeonhole-sieve.dict index ad99e3e..917fce8 100644 --- a/core/dovecot/conf/pigeonhole-sieve.dict +++ b/core/dovecot/conf/pigeonhole-sieve.dict @@ -34,3 +34,10 @@ map { username_field = email value_field = reply_body } + +map { + pattern = priv/reply_enddate + table = user + username_field = email + value_field = reply_enddate +} diff --git a/core/dovecot/sieve/before.sieve b/core/dovecot/sieve/before.sieve index e4eff51..e2730c5 100644 --- a/core/dovecot/sieve/before.sieve +++ b/core/dovecot/sieve/before.sieve @@ -6,6 +6,7 @@ require "mailbox"; require "imap4flags"; require "regex"; require "relational"; +require "date"; require "comparator-i;ascii-numeric"; require "vnd.dovecot.extdata"; require "vnd.dovecot.execute"; @@ -24,6 +25,8 @@ if exists "X-Virus" { stop; } -if string :is "${extdata.reply_enabled}" "1" { +if allof (string :is "${extdata.reply_enabled}" "1", + currentdate :value "le" "date" "${extdata.reply_enddate}") +{ vacation :days 1 :subject "${extdata.reply_subject}" "${extdata.reply_body}"; }