Skip to content

Commit 402bb36

Browse files
author
marknl
committed
FS#1681 - Out-of-Office too early - UNTESTED!
http://bugtracker.ispconfig.org/index.php?do=details&task_id=1681 I've NOT tested this fix, but i think it should be fine. Someone with Dovecot, please test.
1 parent cf03c66 commit 402bb36

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

server/conf/sieve_filter.master

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
require ["fileinto", "regex", "vacation"];
2+
require ["fileinto", "regex", "date", "relational", "vacation"];
33

44
<tmpl_if name="cc">
55
# Send a copy of email to
@@ -29,8 +29,11 @@ if header :contains "X-Spam-Flag" "YES" {
2929
# Stop here so that we do not reply on spams
3030
stop;
3131
}
32+
33+
if allof(currentdate :value "ge" "date" "<tmpl_var name='start_date'>", currentdate :value "le" "date" "<tmpl_var name='end_date'>") {
3234
vacation :days 1
3335
:subject "Out of office reply"
3436
<tmpl_var name='addresses'>
3537
"<tmpl_var name='autoresponder_text'>";
38+
}
3639
</tmpl_if>

server/plugins-available/maildeliver_plugin.inc.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@ function update($event_name,$data) {
112112

113113
// Move junk
114114
$tpl->setVar('move_junk',$data["new"]["move_junk"]);
115-
115+
116+
// Set autoresponder start date
117+
$tpl->setVar('start_date',$data["new"]["autoresponder_start_date"]);
118+
119+
// Set autoresponder end date
120+
$tpl->setVar('end_date',$data["new"]["autoresponder_end_date"]);
121+
116122
// Autoresponder
117123
$tpl->setVar('autoresponder',$data["new"]["autoresponder"]);
118124

0 commit comments

Comments
 (0)