From 28eff398d1e7575e62d0893ec6fdfe42308f39b3 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Fri, 10 Nov 2017 15:39:16 +0100 Subject: [PATCH] Send a vacation response only until the end date, fixes #218 --- core/dovecot/conf/pigeonhole-sieve.dict | 7 +++++++ core/dovecot/sieve/before.sieve | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/dovecot/conf/pigeonhole-sieve.dict b/core/dovecot/conf/pigeonhole-sieve.dict index ad99e3e1..917fce83 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 e4eff51b..e2730c5d 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}"; }