dovecot-2.2-pigeonhole: lib-sieve: Fixed duplication of discard ...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sun Jan 3 15:35:15 UTC 2016


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/d6dd01a2d367
changeset: 2193:d6dd01a2d367
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sun Jan 03 16:29:30 2016 +0100
description:
lib-sieve: Fixed duplication of discard actions in result.
No duplicate check function was implemented, so that the discard action would be duplicated each time it is invoked.
This only affects the action limits (each discard invocation is counted as another new action).
The result of the script execution would be identical.

diffstat:

 src/lib-sieve/cmd-discard.c |  25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diffs (49 lines):

diff -r b5edf3efbdbb -r d6dd01a2d367 src/lib-sieve/cmd-discard.c
--- a/src/lib-sieve/cmd-discard.c	Sat Jan 02 19:36:01 2016 +0100
+++ b/src/lib-sieve/cmd-discard.c	Sun Jan 03 16:29:30 2016 +0100
@@ -55,6 +55,13 @@
  * Discard actions
  */
 
+static bool act_discard_equals
+	(const struct sieve_script_env *senv, const struct sieve_action *act1,
+		const struct sieve_action *act2);
+static int act_discard_check_duplicate
+	(const struct sieve_runtime_env *renv,
+		const struct sieve_action *act,
+		const struct sieve_action *act_other);
 static void act_discard_print
 	(const struct sieve_action *action,
 		const struct sieve_result_print_env *rpenv, bool *keep);
@@ -64,6 +71,8 @@
 
 const struct sieve_action_def act_discard = {
 	.name = "discard",
+	.equals = act_discard_equals,
+	.check_duplicate = act_discard_check_duplicate,
 	.print = act_discard_print,
 	.commit = act_discard_commit,
 };
@@ -115,6 +124,22 @@
  * Action implementation
  */
 
+static bool act_discard_equals
+(const struct sieve_script_env *senv ATTR_UNUSED,
+	const struct sieve_action *act1 ATTR_UNUSED,
+	const struct sieve_action *act2 ATTR_UNUSED)
+{
+	return TRUE;
+}
+
+static int act_discard_check_duplicate
+(const struct sieve_runtime_env *renv ATTR_UNUSED,
+	const struct sieve_action *act ATTR_UNUSED,
+	const struct sieve_action *act_other ATTR_UNUSED)
+{
+	return 1;
+}
+
 static void act_discard_print
 (const struct sieve_action *action ATTR_UNUSED,
 	const struct sieve_result_print_env *rpenv, bool *keep)


More information about the dovecot-cvs mailing list