dovecot-2.0: lib-storage: MAILBOX_LIST_ITER_NO_AUTO_INBOX flag d...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Apr 5 02:56:39 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/87b7fc7f1e7d
changeset: 11053:87b7fc7f1e7d
user: Timo Sirainen <tss at iki.fi>
date: Mon Apr 05 02:56:31 2010 +0300
description:
lib-storage: MAILBOX_LIST_ITER_NO_AUTO_INBOX flag didn't work correctly.
diffstat:
src/lib-storage/list/mailbox-list-fs-iter.c | 5 ++++-
src/lib-storage/list/mailbox-list-maildir-iter.c | 11 +++--------
2 files changed, 7 insertions(+), 9 deletions(-)
diffs (54 lines):
diff -r 1930cc14cb11 -r 87b7fc7f1e7d src/lib-storage/list/mailbox-list-fs-iter.c
--- a/src/lib-storage/list/mailbox-list-fs-iter.c Mon Apr 05 02:56:11 2010 +0300
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c Mon Apr 05 02:56:31 2010 +0300
@@ -413,6 +413,10 @@
if (mailbox_list_mailbox(ctx->ctx.list, "INBOX", &ctx->info.flags) < 0)
ctx->ctx.failed = TRUE;
+ if ((ctx->ctx.flags & MAILBOX_LIST_ITER_NO_AUTO_INBOX) != 0 &&
+ (ctx->info.flags & MAILBOX_NONEXISTENT) != 0)
+ return NULL;
+
ctx->info.flags |= fs_list_get_subscription_flags(ctx, "INBOX");
inbox_flags_set(ctx);
/* we got here because we didn't see INBOX among other mailboxes,
@@ -762,7 +766,6 @@
}
if (!ctx->inbox_found &&
- (ctx->ctx.flags & MAILBOX_LIST_ITER_NO_AUTO_INBOX) == 0 &&
(ctx->ctx.list->ns->flags & NAMESPACE_FLAG_INBOX) != 0 &&
((ctx->glob != NULL &&
imap_match(ctx->glob, "INBOX") == IMAP_MATCH_YES) ||
diff -r 1930cc14cb11 -r 87b7fc7f1e7d src/lib-storage/list/mailbox-list-maildir-iter.c
--- a/src/lib-storage/list/mailbox-list-maildir-iter.c Mon Apr 05 02:56:11 2010 +0300
+++ b/src/lib-storage/list/mailbox-list-maildir-iter.c Mon Apr 05 02:56:31 2010 +0300
@@ -124,7 +124,6 @@
struct imap_match_glob *glob,
bool update_only)
{
- const struct mailbox_list_settings *set = &ctx->ctx.list->set;
struct mailbox_node *node;
enum mailbox_info_flags flags;
enum imap_match_result match;
@@ -133,17 +132,13 @@
if ((ctx->ctx.flags & MAILBOX_LIST_ITER_NO_AUTO_INBOX) == 0) {
/* always show INBOX */
- } else if (set->inbox_path != NULL &&
- strcmp(set->inbox_path, set->root_dir) != 0) {
- /* INBOX doesn't exist, since it wasn't listed */
- update_only = TRUE;
} else {
- /* INBOX is in Maildir root. show it only if it has already
- been created */
+ /* INBOX may be Maildir root or completely elsewhere.
+ show it only if it has already been created */
ret = mailbox_list_mailbox(ctx->ctx.list, "INBOX", &flags);
if (ret < 0)
return -1;
- if (ret == 0)
+ if ((flags & MAILBOX_NONEXISTENT) != 0)
update_only = TRUE;
}
More information about the dovecot-cvs
mailing list