Send a vacation response only until the end date, fixes #218

master
kaiyou 7 years ago
parent 011e1fa52d
commit 28eff398d1

@ -34,3 +34,10 @@ map {
username_field = email username_field = email
value_field = reply_body value_field = reply_body
} }
map {
pattern = priv/reply_enddate
table = user
username_field = email
value_field = reply_enddate
}

@ -6,6 +6,7 @@ require "mailbox";
require "imap4flags"; require "imap4flags";
require "regex"; require "regex";
require "relational"; require "relational";
require "date";
require "comparator-i;ascii-numeric"; require "comparator-i;ascii-numeric";
require "vnd.dovecot.extdata"; require "vnd.dovecot.extdata";
require "vnd.dovecot.execute"; require "vnd.dovecot.execute";
@ -24,6 +25,8 @@ if exists "X-Virus" {
stop; 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}"; vacation :days 1 :subject "${extdata.reply_subject}" "${extdata.reply_body}";
} }

Loading…
Cancel
Save