Add imapoptions to change the minimum and maximum allowed time interval between consecutive vacation responses. The defaults are still 3 and 90 days, which are too high for the vacation-seconds extension. Blindly lowering the limit might be problematic for high traffic sites.
Signed-off-by: Philipp Hahn <h...@univention.de> --- lib/imapoptions | 8 ++++++++ sieve/interp.c | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/imapoptions b/lib/imapoptions index f97be2d..a822819 100644 --- a/lib/imapoptions +++ b/lib/imapoptions @@ -1238,6 +1238,14 @@ product version in the capabilities */ /* If enabled, timsieved will emit a capability response after a successful SASL authentication, per draft-martin-managesieve-12.txt . */ +{ "sieve_vacation_min_response", 259200 /* 3 days */, INT } +/* Minimum time interval (in seconds) between consecutive vacation responses, + per draft-ietf-vacation-seconds.txt . */ + +{ "sieve_vacation_max_response", 7776000 /* 90 days */, INT } +/* Maximum time interval (in seconds) between consecutive vacation responses, + per draft-ietf-vacation-seconds.txt . */ + { "sievedir", "/usr/sieve", STRING } /* If sieveusehomedir is false, this directory is searched for Sieve scripts. */ diff --git a/sieve/interp.c b/sieve/interp.c index bf1d067..31df7a7 100644 --- a/sieve/interp.c +++ b/sieve/interp.c @@ -259,8 +259,10 @@ int sieve_register_vacation(sieve_interp_t *interp, sieve_vacation_t *v) return SIEVE_NOT_FINALIZED; /* we need envelope for vacation! */ } - if (v->min_response == 0) v->min_response = 3 * DAY2SEC; - if (v->max_response == 0) v->max_response = 90 * DAY2SEC; + if (v->min_response == 0) + v->min_response = config_getint(IMAPOPT_SIEVE_VACATION_MIN_RESPONSE); + if (v->max_response == 0) + v->max_response = config_getint(IMAPOPT_SIEVE_VACATION_MAX_RESPONSE); if (v->min_response < 0 || v->max_response < 7 * DAY2SEC || !v->autorespond || !v->send_response) { return SIEVE_FAIL; -- 1.7.1