changeset 8374:9d7c0ff9c2a0 HEAD

dbox/mbox: Don't auto-create INBOX if storage isn't in the INBOX namespace.
author Timo Sirainen <tss@iki.fi>
date Sat, 01 Nov 2008 16:04:24 +0200
parents 9524ec6e14fc
children 4aafdbe62680
files src/lib-storage/index/dbox/dbox-storage.c src/lib-storage/index/mbox/mbox-storage.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-storage.c	Sat Nov 01 15:12:14 2008 +0200
+++ b/src/lib-storage/index/dbox/dbox-storage.c	Sat Nov 01 16:04:24 2008 +0200
@@ -291,7 +291,8 @@
 	if (dbox_cleanup_if_exists(_storage, path))
 		return dbox_open(storage, name, flags);
 	else if (errno == ENOENT) {
-		if (strcmp(name, "INBOX") == 0) {
+		if (strcmp(name, "INBOX") == 0 &&
+		    (_storage->ns->flags & NAMESPACE_FLAG_INBOX) != 0) {
 			/* INBOX always exists, create it */
 			if (create_dbox(_storage, path) < 0)
 				return NULL;
--- a/src/lib-storage/index/mbox/mbox-storage.c	Sat Nov 01 15:12:14 2008 +0200
+++ b/src/lib-storage/index/mbox/mbox-storage.c	Sat Nov 01 16:04:24 2008 +0200
@@ -666,7 +666,8 @@
 	if (input != NULL)
 		return mbox_mailbox_open_stream(storage, name, input, flags);
 
-	if (strcmp(name, "INBOX") == 0) {
+	if (strcmp(name, "INBOX") == 0 &&
+	    (_storage->ns->flags & NAMESPACE_FLAG_INBOX) != 0) {
 		/* make sure INBOX exists */
 		if (verify_inbox(_storage) < 0)
 			return NULL;