dovecot-2.0-pigeonhole: Fixed bug in error handling of store act...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Tue Aug 3 16:58:42 EEST 2010


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/8ab83f81360e
changeset: 1355:8ab83f81360e
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Tue Aug 03 15:58:36 2010 +0200
description:
Fixed bug in error handling of store action.

diffstat:

 src/lib-sieve/sieve-actions.c                    |   3 ++-
 tests/execute/errors.svtest                      |  25 +++++++++++++++++++++++++
 tests/execute/errors/fileinto-invalid-name.sieve |   5 +++++
 3 files changed, 32 insertions(+), 1 deletions(-)

diffs (61 lines):

diff -r b404d36cdd8d -r 8ab83f81360e src/lib-sieve/sieve-actions.c
--- a/src/lib-sieve/sieve-actions.c	Tue Aug 03 12:29:46 2010 +0200
+++ b/src/lib-sieve/sieve-actions.c	Tue Aug 03 15:58:36 2010 +0200
@@ -408,7 +408,8 @@
 
 	*tr_context = (void *)trans;
 
-	return TRUE;
+	return ( trans->error_code == MAIL_ERROR_NONE || 
+		trans->error_code == MAIL_ERROR_NOTFOUND );
 }
 
 static struct mail_keywords *act_store_keywords_create
diff -r b404d36cdd8d -r 8ab83f81360e tests/execute/errors.svtest
--- a/tests/execute/errors.svtest	Tue Aug 03 12:29:46 2010 +0200
+++ b/tests/execute/errors.svtest	Tue Aug 03 15:58:36 2010 +0200
@@ -2,6 +2,7 @@
 
 require "relational";
 require "comparator-i;ascii-numeric";
+require "fileinto";
 
 test "Action conflicts: reject <-> fileinto" {
 	if not test_script_compile "errors/conflict-reject-fileinto.sieve" {
@@ -108,3 +109,27 @@
 	}
 }
 
+test "Fileinto invalid folder name" {
+	if not test_script_compile "errors/fileinto-invalid-name.sieve" {
+		test_fail "compile failed";
+	}
+
+	if not test_script_run {
+		test_fail "execution failed";
+	}
+
+	if test_result_execute {
+		test_fail "execution of result should have failed";
+	}
+
+	if not test_error :count "eq" :comparator "i;ascii-numeric" "1" {
+		test_fail "wrong number of runtime errors reported";
+	}
+
+	if not allof (
+		test_error :index 1 :contains "failed to store into mailbox",
+		test_error :index 1 :contains "name") {
+		test_fail "unexpected error reported";
+	}
+}
+
diff -r b404d36cdd8d -r 8ab83f81360e tests/execute/errors/fileinto-invalid-name.sieve
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/execute/errors/fileinto-invalid-name.sieve	Tue Aug 03 15:58:36 2010 +0200
@@ -0,0 +1,5 @@
+require "fileinto";
+require "mailbox";
+
+fileinto :create "foo//somedomain/org";
+


More information about the dovecot-cvs mailing list