changeset 10747:c0c4898fc803 HEAD

mailbox_list_get_mailbox_name_status(): Fixed INBOX handling with FS layout.
author Timo Sirainen <tss@iki.fi>
date Thu, 18 Feb 2010 07:31:55 +0200
parents 28c3486864f6
children a792d411e73e
files src/lib-storage/list/mailbox-list-fs.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-fs.c	Thu Feb 18 07:13:29 2010 +0200
+++ b/src/lib-storage/list/mailbox-list-fs.c	Thu Feb 18 07:31:55 2010 +0200
@@ -236,10 +236,15 @@
 	const char *path, *dir_path;
 	enum mailbox_info_flags flags;
 
+	if (strcmp(name, "INBOX") == 0 &&
+	    (_list->ns->flags & NAMESPACE_FLAG_INBOX) != 0) {
+		*status = MAILBOX_NAME_EXISTS_MAILBOX;
+		return 0;
+	}
+
 	path = mailbox_list_get_path(_list, name,
 				     MAILBOX_LIST_PATH_TYPE_MAILBOX);
-
-	if (strcmp(name, "INBOX") == 0 || stat(path, &st) == 0) {
+	if (stat(path, &st) == 0) {
 		if (*_list->set.maildir_name != '\0' ||
 		    _list->v.is_internal_name == NULL || !S_ISDIR(st.st_mode)) {
 			*status = MAILBOX_NAME_EXISTS_MAILBOX;