Add VACATION :seconds support
dilyan.palauzov at aegee.org
Tue May 8 07:32:56 EDT 2012
To patch 1: autobuild: Fix directory handling
Why do you use autobuild.sh instead of autoreconf -vi?
To patch 2,3,4: Change vacation day to seconds
I would suggest adding a new opcode to the sieve bytecode for
"vacation :seconds", that is used for all uploads in the future, in a
way similar to the implementation in bc_eval.c of B_FILEINTO_ORIG and
B_REDIRECT_ORIG. This will allow current scripts to continue running
without the need to be recompiled. For future scripts, always the
seconds are stored, even if :days was provided. Currently bc_eval
supports all versions starting from BYTECODE_MIN_VERSION = 0x03.
I mean, in addition to your patches,
- replacing in bytecode.h B_VACATION with B_VACATION_ORIG on line
130, and adding a new B_VACATION at the end of enum bytecode (could be
called also B_VACATION and B_VACATION_SECONDS)
- fixing bc_dump and sieved to be able to dump both B_VACATION and
- fixing bc_eval to be able to execute both B_VACATION and
On 08.05.2012 11:54, Philipp Hahn wrote:
> some time ago I implemented RFC 6131<http://tools.ietf.org/html/rfc6131>,
> which adds a variante of the VACATION extension supporting seconds instead of
> days. The original patch was for version 2.2.x and implemented a draft version.
> There are some issues I would like to get a feedback for:
> autobuild.sh fails for me on my local system, because my directory layout
> doesn't seem to match your build environment. I took the liberty to fix some
> issues to make it usable for me. The first patch is actually independent from
> the rest.
> The change is relatively easy iff the value used in compiled SIEVE scripts is
> changed from days to seconds. As far as I understood the logic, this requires a
> version bump in the sieve byte code, which I did in the second patch. Since
> duplicate_mark() already uses seconds since the UNIX epoch, no change is
> required there.
> This reduces the maximum span for vacation messages from 2^31 to 68 years, but
> I think even that should be enough.
> ":seconds 0" is explicitly allowed, which would send a vacation mail for every
> message. (Actually this was the motivation for implementing this extension) In
> other contexts this might be undesired, but I found no easy way to make
> min_response and max_response configurable. Because of that lowering
> min_response is done in the last patch.
> There currently is no explicit check for 0<= seconds<= 2**31.
> For converting days to seconds and the inverse I always explicitly wrote 24 *
> 60 * 60. Is there a good location for defining this as a macro?
> Philipp Hahn (4):
> autobuild: Fix directory handling
> Change vacation day to seconds
> Add VACATION :seconds support
> Support VACACTION :seconds 0
> autobuild.sh | 18 ++++++-----
> imap/lmtp_sieve.c | 6 ++--
> sieve/README | 3 ++
> sieve/bc_dump.c | 2 +-
> sieve/bc_emit.c | 4 +-
> sieve/bc_generate.c | 4 +-
> sieve/bytecode.h | 3 +-
> sieve/interp.c | 8 +++--
> sieve/message.c | 4 +-
> sieve/message.h | 2 +-
> sieve/script.c | 11 +++++++
> sieve/script.h | 1 +
> sieve/sieve-lex.l | 1 +
> sieve/sieve.y | 31 ++++++++++++-------
> sieve/sieve_interface.h | 6 ++--
> sieve/sieved.c | 2 +-
> sieve/test.c | 5 ++-
> .../actionExtensions/uberExtensionActionScript.key | 10 ++++++
> .../actionExtensions/uberExtensionActionScript.s | 13 +++++++-
> sieve/tree.h | 2 +-
> 20 files changed, 94 insertions(+), 42 deletions(-)
More information about the Cyrus-devel