dovecot-2.2-pigeonhole: Sieve: editheader: fixed bug in header c...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Sun Mar 3 17:55:11 EET 2013
details: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/994b45b58e91
changeset: 1718:994b45b58e91
user: Stephan Bosch <stephan at rename-it.nl>
date: Thu Feb 28 23:37:31 2013 +0100
description:
Sieve: editheader: fixed bug in header cloning for snapshot.
Forgot to increment count for the clone.
diffstat:
src/lib-sieve/edit-mail.c | 1 +
tests/extensions/editheader/alternating.svtest | 59 ++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 0 deletions(-)
diffs (77 lines):
diff -r 13d41cc284fc -r 994b45b58e91 src/lib-sieve/edit-mail.c
--- a/src/lib-sieve/edit-mail.c Thu Feb 28 23:06:47 2013 +0100
+++ b/src/lib-sieve/edit-mail.c Thu Feb 28 23:37:31 2013 +0100
@@ -321,6 +321,7 @@
(&edmail_new->header_fields_head, &edmail_new->header_fields_tail,
field_idx_new);
+ field_idx_new->header->count++;
if ( field_idx->header->first == field_idx )
field_idx_new->header->first = field_idx_new;
if ( field_idx->header->last == field_idx )
diff -r 13d41cc284fc -r 994b45b58e91 tests/extensions/editheader/alternating.svtest
--- a/tests/extensions/editheader/alternating.svtest Thu Feb 28 23:06:47 2013 +0100
+++ b/tests/extensions/editheader/alternating.svtest Thu Feb 28 23:37:31 2013 +0100
@@ -120,3 +120,62 @@
test_fail "wrong content in redirected mail ";
}
}
+
+test_result_reset;
+
+test_set "message" "${message}";
+test "Alternating - add :last; delete any" {
+ addheader :last "X-Some-Header" "Header content";
+
+ if not exists "x-some-header" {
+ test_fail "header not added";
+ }
+
+ if not header :is "x-some-header" "Header content" {
+ test_fail "wrong content added";
+ }
+
+ redirect "frop at example.com";
+
+ deleteheader "X-Some-Other-Header";
+
+ if not exists "x-some-header" {
+ test_fail "header somehow deleted";
+ }
+
+ fileinto :create "folder3";
+
+ if not test_result_execute {
+ test_fail "failed to execute result";
+ }
+
+ /* redirected message */
+
+ if not test_message :smtp 0 {
+ test_fail "message not redirected";
+ }
+
+ if not exists "x-some-header" {
+ test_fail "added header not in redirected mail";
+ }
+
+ if not header :is "x-some-header" "Header content" {
+ test_fail "wrong content in redirected mail ";
+ }
+
+ /* stored message message */
+
+ if not test_message :folder "folder3" 0 {
+ test_fail "message not stored";
+ }
+
+ if not exists "x-some-header" {
+ test_fail "added header lost in stored mail";
+ }
+
+ if not header :is "x-some-header" "Header content" {
+ test_fail "wrong content in stored mail ";
+ }
+
+}
+
More information about the dovecot-cvs
mailing list