Skip to content
Snippets Groups Projects
Commit c445794f authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Made discard command add discard action to the result.

parent c5ae8068
No related branches found
No related tags found
No related merge requests found
if address :contains "to" "vestingbar" {
redirect "stephan@example.com";
keep;
} else {
discard;
}
redirect "stephan@rename-it.nl";
redirect "nico@example.nl";
redirect "stephan@example.com";
keep;
discard;
......@@ -42,6 +42,18 @@ const struct sieve_opcode cmd_discard_opcode = {
opc_discard_execute
};
/* Discard action */
static int act_discard_execute
(const struct sieve_action *action, const struct sieve_action_exec_env *aenv,
void *context);
const struct sieve_action act_discard = {
"discard",
NULL, NULL, NULL,
act_discard_execute
};
/*
* Generation
*/
......@@ -66,7 +78,22 @@ static bool opc_discard_execute
{
printf(">> DISCARD\n");
sieve_result_add_action(renv->result, renv, &act_discard, NULL);
return TRUE;
}
/*
* Action
*/
static int act_discard_execute
(const struct sieve_action *action ATTR_UNUSED,
const struct sieve_action_exec_env *aenv, void *context)
{
return 0;
}
......@@ -54,7 +54,6 @@ const struct sieve_action act_keep = {
act_keep_execute
};
/*
* Generation
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.