From 5563270400f12df64758625ec3430a1b076ae23d Mon Sep 17 00:00:00 2001 From: Stephan Bosch <stephan@rename-it.nl> Date: Mon, 26 Nov 2007 16:52:04 +0100 Subject: [PATCH] Made keep command add keep action to the result. --- src/lib-sieve/cmd-keep.c | 28 ++++++++++++++++++++++++++++ src/lib-sieve/cmd-redirect.c | 1 + 2 files changed, 29 insertions(+) diff --git a/src/lib-sieve/cmd-keep.c b/src/lib-sieve/cmd-keep.c index 765ebad25..99838fb74 100644 --- a/src/lib-sieve/cmd-keep.c +++ b/src/lib-sieve/cmd-keep.c @@ -43,6 +43,19 @@ const struct sieve_opcode cmd_keep_opcode = { opc_keep_execute }; +/* Keep action */ + +static int act_keep_execute + (const struct sieve_action *action, const struct sieve_action_exec_env *aenv, + void *context); + +const struct sieve_action act_keep = { + "keep", + NULL, + act_keep_execute +}; + + /* * Generation */ @@ -67,7 +80,22 @@ static bool opc_keep_execute { printf(">> KEEP\n"); + sieve_result_add_action(renv->result, &act_keep, NULL); + return TRUE; } +/* + * Action + */ + +static int act_keep_execute +(const struct sieve_action *action ATTR_UNUSED, + const struct sieve_action_exec_env *aenv, void *context) +{ + return 0; +} + + + diff --git a/src/lib-sieve/cmd-redirect.c b/src/lib-sieve/cmd-redirect.c index 7b9da9eb5..31de529ac 100644 --- a/src/lib-sieve/cmd-redirect.c +++ b/src/lib-sieve/cmd-redirect.c @@ -134,6 +134,7 @@ static bool cmd_redirect_opcode_execute printf(">> REDIRECT \"%s\"\n", str_c(redirect)); + /* Add redirect action to the result */ pool = sieve_result_pool(renv->result); act = p_new(pool, struct act_redirect_context, 1); act->to_address = p_strdup(pool, str_c(redirect)); -- GitLab