# HG changeset patch # User Timo Sirainen # Date 1186675398 -10800 # Node ID c6b1d851535477e53255d679b8274ea0be50e98a # Parent d9b07b5eea4a02fccd00b7434f0607dec596f654 Added MAILBOX_LIST_FLAG_MAILBOX_FILES flag. If it's set and INBOX path is set, point index and control directories under the root directory instead. diff -r d9b07b5eea4a -r c6b1d8515354 src/lib-storage/index/mbox/mbox-storage.c --- a/src/lib-storage/index/mbox/mbox-storage.c Thu Aug 09 18:50:56 2007 +0300 +++ b/src/lib-storage/index/mbox/mbox-storage.c Thu Aug 09 19:03:18 2007 +0300 @@ -433,7 +433,8 @@ list_set.lock_method = &_storage->lock_method; if (mailbox_list_init(_storage->ns, layout, &list_set, - mail_storage_get_list_flags(_storage->flags), + mail_storage_get_list_flags(_storage->flags) | + MAILBOX_LIST_FLAG_MAILBOX_FILES, &_storage->list, error_r) < 0) return -1; diff -r d9b07b5eea4a -r c6b1d8515354 src/lib-storage/list/mailbox-list-fs.c --- a/src/lib-storage/list/mailbox-list-fs.c Thu Aug 09 18:50:56 2007 +0300 +++ b/src/lib-storage/list/mailbox-list-fs.c Thu Aug 09 19:03:18 2007 +0300 @@ -189,7 +189,11 @@ break; } - if (strcmp(name, "INBOX") == 0 && set->inbox_path != NULL) + /* If INBOX is a file, index and control directories are located + in root directory. */ + if (strcmp(name, "INBOX") == 0 && set->inbox_path != NULL && + ((_list->flags & MAILBOX_LIST_FLAG_MAILBOX_FILES) == 0 || + type == MAILBOX_LIST_PATH_TYPE_MAILBOX)) return set->inbox_path; if (*set->maildir_name == '\0') diff -r d9b07b5eea4a -r c6b1d8515354 src/lib-storage/mailbox-list.h --- a/src/lib-storage/mailbox-list.h Thu Aug 09 18:50:56 2007 +0300 +++ b/src/lib-storage/mailbox-list.h Thu Aug 09 19:03:18 2007 +0300 @@ -13,7 +13,9 @@ /* Allow full filesystem access with absolute or relative paths. */ MAILBOX_LIST_FLAG_FULL_FS_ACCESS = 0x04, /* Rely on O_EXCL when creating dotlocks */ - MAILBOX_LIST_FLAG_DOTLOCK_USE_EXCL = 0x08 + MAILBOX_LIST_FLAG_DOTLOCK_USE_EXCL = 0x08, + /* Mailboxes are files, not directories. */ + MAILBOX_LIST_FLAG_MAILBOX_FILES = 0x10 }; enum mailbox_info_flags {