dovecot-2.1-pigeonhole: lib-sieve: editheader: fixed implicit ke...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Mon Nov 28 01:41:00 EET 2011
details: http://hg.rename-it.nl/dovecot-2.1-pigeonhole/rev/9c2fa28f7123
changeset: 1560:9c2fa28f7123
user: Stephan Bosch <stephan at rename-it.nl>
date: Mon Nov 28 00:40:43 2011 +0100
description:
lib-sieve: editheader: fixed implicit keep after runtime error.
It did not use the original message in this case.
diffstat:
src/lib-sieve/sieve-actions.c | 2 +-
tests/extensions/editheader/errors.svtest | 31 +++++++++++++++
tests/extensions/editheader/errors/runtime-error.sieve | 6 +++
3 files changed, 38 insertions(+), 1 deletions(-)
diffs (60 lines):
diff -r 23fbd8454d98 -r 9c2fa28f7123 src/lib-sieve/sieve-actions.c
--- a/src/lib-sieve/sieve-actions.c Sat Nov 26 14:19:42 2011 +0100
+++ b/src/lib-sieve/sieve-actions.c Mon Nov 28 00:40:43 2011 +0100
@@ -467,7 +467,7 @@
struct act_store_transaction *trans =
(struct act_store_transaction *) tr_context;
struct mail *mail = ( action->mail != NULL ?
- action->mail : sieve_message_get_mail(aenv->msgctx) );
+ action->mail : aenv->msgdata->mail );
struct mail_save_context *save_ctx;
struct mail_keywords *keywords = NULL;
bool result = TRUE;
diff -r 23fbd8454d98 -r 9c2fa28f7123 tests/extensions/editheader/errors.svtest
--- a/tests/extensions/editheader/errors.svtest Sat Nov 26 14:19:42 2011 +0100
+++ b/tests/extensions/editheader/errors.svtest Mon Nov 28 00:40:43 2011 +0100
@@ -66,3 +66,34 @@
}
}
+test_set "message" text:
+From: stephan at example.com
+To: tss at example.com
+Subject: Frop
+
+Frop!
+.
+;
+
+test "Implicit keep at runtime error" {
+ if not test_script_compile "errors/runtime-error.sieve" {
+ test_fail "compile failed";
+ }
+
+ if not test_script_run {
+ test_fail "run failed";
+ }
+
+ if test_result_execute {
+ test_fail "result execution should have failed";
+ }
+
+ if not test_message :folder "INBOX" 0 {
+ test_fail "message not stored (no implicit keep)";
+ }
+
+ if exists "X-Frop" {
+ test_fail "implicit keep message has editheader changes";
+ }
+}
+
diff -r 23fbd8454d98 -r 9c2fa28f7123 tests/extensions/editheader/errors/runtime-error.sieve
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/extensions/editheader/errors/runtime-error.sieve Mon Nov 28 00:40:43 2011 +0100
@@ -0,0 +1,6 @@
+require "editheader";
+require "fileinto";
+
+addheader "X-Frop" "Friep";
+
+fileinto "Rediculous.non-existent.folder";
More information about the dovecot-cvs
mailing list