dovecot: Added MAILBOX_LIST_FLAG_MAILBOX_FILES flag. If it's set...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Aug 9 19:03:21 EEST 2007
details: http://hg.dovecot.org/dovecot/rev/c6b1d8515354
changeset: 6248:c6b1d8515354
user: Timo Sirainen <tss at iki.fi>
date: Thu Aug 09 19:03:18 2007 +0300
description:
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.
diffstat:
3 files changed, 10 insertions(+), 3 deletions(-)
src/lib-storage/index/mbox/mbox-storage.c | 3 ++-
src/lib-storage/list/mailbox-list-fs.c | 6 +++++-
src/lib-storage/mailbox-list.h | 4 +++-
diffs (43 lines):
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 @@ static int mbox_create(struct mail_stora
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 @@ fs_list_get_path(struct mailbox_list *_l
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 @@ enum mailbox_list_flags {
/* 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 {
More information about the dovecot-cvs
mailing list