changeset 12626:aa131065b53d

imapc: Don't force a root directory to exist.
author Timo Sirainen <tss@iki.fi>
date Tue, 01 Feb 2011 19:17:36 +0200
parents 495fb0e9f7cc
children e945bf4f1e59
files src/lib-storage/index/imapc/imapc-list.c src/lib-storage/index/imapc/imapc-storage.c src/lib-storage/mail-storage-private.h src/lib-storage/mail-storage.c
diffstat 4 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/imapc/imapc-list.c	Tue Feb 01 19:05:54 2011 +0200
+++ b/src/lib-storage/index/imapc/imapc-list.c	Tue Feb 01 19:17:36 2011 +0200
@@ -368,7 +368,7 @@
 
 struct mailbox_list imapc_mailbox_list = {
 	.name = MAILBOX_LIST_NAME_IMAPC,
-	.props = 0,
+	.props = MAILBOX_LIST_PROP_NO_ROOT,
 	.mailbox_name_max_length = MAILBOX_LIST_NAME_MAX_LENGTH,
 
 	{
--- a/src/lib-storage/index/imapc/imapc-storage.c	Tue Feb 01 19:05:54 2011 +0200
+++ b/src/lib-storage/index/imapc/imapc-storage.c	Tue Feb 01 19:17:36 2011 +0200
@@ -485,7 +485,7 @@
 
 struct mail_storage imapc_storage = {
 	.name = IMAPC_STORAGE_NAME,
-	.class_flags = 0,
+	.class_flags = MAIL_STORAGE_CLASS_FLAG_NO_ROOT,
 
 	.v = {
 		imapc_get_setting_parser_info,
--- a/src/lib-storage/mail-storage-private.h	Tue Feb 01 19:05:54 2011 +0200
+++ b/src/lib-storage/mail-storage-private.h	Tue Feb 01 19:17:36 2011 +0200
@@ -56,7 +56,9 @@
 	/* mailbox_open_stream() is supported */
 	MAIL_STORAGE_CLASS_FLAG_OPEN_STREAMS	= 0x04,
 	/* never use quota for this storage (e.g. virtual mailboxes) */
-	MAIL_STORAGE_CLASS_FLAG_NOQUOTA		= 0x08
+	MAIL_STORAGE_CLASS_FLAG_NOQUOTA		= 0x08,
+	/* Storage doesn't need a mail root directory */
+	MAIL_STORAGE_CLASS_FLAG_NO_ROOT		= 0x10
 };
 
 struct mail_storage {
--- a/src/lib-storage/mail-storage.c	Tue Feb 01 19:05:54 2011 +0200
+++ b/src/lib-storage/mail-storage.c	Tue Feb 01 19:17:36 2011 +0200
@@ -148,6 +148,9 @@
 		if (storage_class == NULL &&
 		    (flags & MAIL_STORAGE_FLAG_NO_AUTODETECTION) == 0) {
 			/* autodetection should take care of this */
+		} else if (storage_class != NULL &&
+			   (storage_class->class_flags & MAIL_STORAGE_CLASS_FLAG_NO_ROOT) != 0) {
+			/* root not required for this storage */
 		} else if (list != NULL &&
 			   (list->props & MAILBOX_LIST_PROP_NO_ROOT) != 0) {
 			/* root not required for this layout */