dovecot-2.0-pigeonhole: Adjusted to changes in Dovecot mailbox API.

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sat Feb 13 12:48:10 EET 2010


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/b655cf914016
changeset: 1237:b655cf914016
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sat Feb 13 11:48:02 2010 +0100
description:
Adjusted to changes in Dovecot mailbox API.

diffstat:

 src/lib-sieve-tool/mail-raw.c                      |  18 ++++++++++++------
 src/lib-sieve/plugins/mailbox/tag-mailbox-create.c |   2 +-
 src/lib-sieve/plugins/mailbox/tst-mailboxexists.c  |   2 +-
 src/lib-sieve/sieve-actions.c                      |   2 +-
 src/sieve-tools/sieve-filter.c                     |   2 +-
 src/testsuite/testsuite-mailstore.c                |   4 ++--
 6 files changed, 18 insertions(+), 12 deletions(-)

diffs (102 lines):

diff -r 790a59e93520 -r b655cf914016 src/lib-sieve-tool/mail-raw.c
--- a/src/lib-sieve-tool/mail-raw.c	Wed Feb 10 17:15:41 2010 +0100
+++ b/src/lib-sieve-tool/mail-raw.c	Sat Feb 13 11:48:02 2010 +0100
@@ -224,17 +224,23 @@
 
 	if ( mailfile == NULL ) {
 		mailr->box = mailbox_alloc(raw_ns->list, "Dovecot Delivery Mail",
-			input, MAILBOX_FLAG_NO_INDEX_FILES);
+			MAILBOX_FLAG_NO_INDEX_FILES);
+
+		if (mailbox_open_stream(mailr->box, input) < 0) {
+            i_fatal("Can't open mail stream as raw: %s",
+                mail_storage_get_last_error(raw_ns->storage, &error));
+        }
 	} else {
 		mtime = (time_t)-1;
-		mailr->box = mailbox_alloc(raw_ns->list, mailfile, NULL,
+		mailr->box = mailbox_alloc(raw_ns->list, mailfile,
 			MAILBOX_FLAG_NO_INDEX_FILES);
+
+		if ( mailbox_open(mailr->box) < 0 ) {
+    	    i_fatal("Can't open mail stream as raw: %s",
+        	    mail_storage_get_last_error(raw_ns->storage, &error));
+	    }
 	}
 
-	if ( mailbox_open(mailr->box) < 0 ) {
-        i_fatal("Can't open mail stream as raw: %s",
-            mail_storage_get_last_error(raw_ns->storage, &error));
-    }
     if ( mailbox_sync(mailr->box, 0) < 0 ) {
         i_fatal("Can't sync delivery mail: %s",
             mail_storage_get_last_error(raw_ns->storage, &error));
diff -r 790a59e93520 -r b655cf914016 src/lib-sieve/plugins/mailbox/tag-mailbox-create.c
--- a/src/lib-sieve/plugins/mailbox/tag-mailbox-create.c	Wed Feb 10 17:15:41 2010 +0100
+++ b/src/lib-sieve/plugins/mailbox/tag-mailbox-create.c	Sat Feb 13 11:48:02 2010 +0100
@@ -142,7 +142,7 @@
 
 	*storage = trans->namespace->storage; 
 
-    box = mailbox_alloc(trans->namespace->list, trans->folder, NULL, flags);
+    box = mailbox_alloc(trans->namespace->list, trans->folder, flags);
 	/* Create mailbox */
 	if ( mailbox_create(box, NULL, FALSE) < 0 ) {
 		mailbox_free(&box);
diff -r 790a59e93520 -r b655cf914016 src/lib-sieve/plugins/mailbox/tst-mailboxexists.c
--- a/src/lib-sieve/plugins/mailbox/tst-mailboxexists.c	Wed Feb 10 17:15:41 2010 +0100
+++ b/src/lib-sieve/plugins/mailbox/tst-mailboxexists.c	Sat Feb 13 11:48:02 2010 +0100
@@ -142,7 +142,7 @@
 			}
 
 			/* Open the box */
-			box = mailbox_alloc(ns->list, mailbox, NULL, 0);
+			box = mailbox_alloc(ns->list, mailbox, 0);
 			if ( mailbox_open(box) < 0 ) {
 				all_exist = FALSE;
 				break;
diff -r 790a59e93520 -r b655cf914016 src/lib-sieve/sieve-actions.c
--- a/src/lib-sieve/sieve-actions.c	Wed Feb 10 17:15:41 2010 +0100
+++ b/src/lib-sieve/sieve-actions.c	Sat Feb 13 11:48:02 2010 +0100
@@ -305,7 +305,7 @@
 	}
 
 	/* First attempt at opening the box */
-	box = mailbox_alloc((*ns_r)->list, *folder_r, NULL, flags);
+	box = mailbox_alloc((*ns_r)->list, *folder_r, flags);
 	if ( mailbox_open(box) == 0 ) {
 		/* Success */
 		return box;
diff -r 790a59e93520 -r b655cf914016 src/sieve-tools/sieve-filter.c
--- a/src/sieve-tools/sieve-filter.c	Wed Feb 10 17:15:41 2010 +0100
+++ b/src/sieve-tools/sieve-filter.c	Sat Feb 13 11:48:02 2010 +0100
@@ -401,7 +401,7 @@
 	dst_storage = dst_ns->storage;
 
 	/* Open the source mailbox */	
-	src_box = mailbox_alloc(src_ns->list, src_mailbox, NULL, open_flags);
+	src_box = mailbox_alloc(src_ns->list, src_mailbox, open_flags);
     if ( mailbox_open(src_box) < 0 ) {
 		i_fatal("Couldn't open mailbox '%s': %s", 
 			src_mailbox, mail_storage_get_last_error(src_storage, &error));
diff -r 790a59e93520 -r b655cf914016 src/testsuite/testsuite-mailstore.c
--- a/src/testsuite/testsuite-mailstore.c	Wed Feb 10 17:15:41 2010 +0100
+++ b/src/testsuite/testsuite-mailstore.c	Sat Feb 13 11:48:02 2010 +0100
@@ -120,7 +120,7 @@
 	struct mail_namespace *ns = testsuite_mailstore_user->namespaces;
 	struct mailbox *box;
 
-	box = mailbox_alloc(ns->list, folder, NULL, 0);
+	box = mailbox_alloc(ns->list, folder, 0);
 
 	if ( mailbox_create(box, NULL, FALSE) < 0 ) {
 		mailbox_free(&box);
@@ -165,7 +165,7 @@
 		return testsuite_mailstore_mail;
 	}
 
-	box = mailbox_alloc(ns->list, folder, NULL, flags);
+	box = mailbox_alloc(ns->list, folder, flags);
 	if ( mailbox_open(box) < 0 ) {
 		sieve_sys_error("testsuite: failed to open mailbox '%s'", folder);
 		return NULL;	


More information about the dovecot-cvs mailing list