{
struct mail_storage *storage;
const char *rootdir, *maildir;
+ enum mailbox_list_path_type type;
- if (!mailbox_list_get_root_path(backend->backend.list,
- MAILBOX_LIST_PATH_TYPE_DIR, &rootdir))
+ storage = mailbox_list_get_namespace(backend->backend.list)->storage;
+ type = (storage->class_flags & MAIL_STORAGE_CLASS_FLAG_NO_ROOT) != 0 ?
+ MAILBOX_LIST_PATH_TYPE_CONTROL : MAILBOX_LIST_PATH_TYPE_DIR;
+ if (!mailbox_list_get_root_path(backend->backend.list, type, &rootdir))
return FALSE;
- *type_r = MAILBOX_LIST_PATH_TYPE_DIR;
+ *type_r = type;
- storage = mailbox_list_get_namespace(backend->backend.list)->storage;
- if (mail_storage_is_mailbox_file(storage)) {
+ if (type == MAILBOX_LIST_PATH_TYPE_DIR &&
+ mail_storage_is_mailbox_file(storage)) {
maildir = mailbox_list_get_root_forced(backend->backend.list,
MAILBOX_LIST_PATH_TYPE_MAILBOX);
if (strcmp(maildir, rootdir) == 0) {
else if (!mailbox_list_is_valid_name(ns->list, name, &error))
return NULL;
- type = mail_storage_is_mailbox_file(ns->storage) ?
+ /* ACL files are very important. try to keep them among the main
+ mail files. that's not possible though with a) if the mailbox is
+ a file or b) if the mailbox path doesn't point to filesystem. */
+ type = mail_storage_is_mailbox_file(ns->storage) ||
+ (ns->storage->class_flags & MAIL_STORAGE_CLASS_FLAG_NO_ROOT) != 0 ?
MAILBOX_LIST_PATH_TYPE_CONTROL : MAILBOX_LIST_PATH_TYPE_MAILBOX;
if (name == NULL) {
if (!mailbox_list_get_root_path(ns->list, type, &dir))