From: Timo Sirainen Date: Sat, 24 May 2008 13:57:28 +0000 (+0300) Subject: dbox & cydir: If mailbox doesn't exist, return it as \nonexistent instead of X-Git-Tag: 1.1.rc6~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2ced58969b446666ab1067c6bfdf495367ed621;p=thirdparty%2Fdovecot%2Fcore.git dbox & cydir: If mailbox doesn't exist, return it as \nonexistent instead of \noselect. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/cydir/cydir-storage.c b/src/lib-storage/index/cydir/cydir-storage.c index e010fd71be..d3015c657b 100644 --- a/src/lib-storage/index/cydir/cydir-storage.c +++ b/src/lib-storage/index/cydir/cydir-storage.c @@ -376,6 +376,9 @@ static int cydir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx if (st.st_nlink > 2) *flags |= MAILBOX_CHILDREN; } + } else if (errno == ENOENT) { + /* doesn't exist - probably a non-existing subscribed mailbox */ + *flags |= MAILBOX_NONEXISTENT; } else { /* non-selectable. probably either access denied, or symlink destination not found. don't bother logging errors. */ diff --git a/src/lib-storage/index/dbox/dbox-storage.c b/src/lib-storage/index/dbox/dbox-storage.c index c5a23595b1..957fc73ec3 100644 --- a/src/lib-storage/index/dbox/dbox-storage.c +++ b/src/lib-storage/index/dbox/dbox-storage.c @@ -622,12 +622,15 @@ static int dbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx if (st.st_nlink > 2) *flags |= MAILBOX_CHILDREN; } + } else if (errno == ENOENT) { + /* doesn't exist - probably a non-existing subscribed mailbox */ + *flags |= MAILBOX_NONEXISTENT; } else { /* non-selectable. probably either access denied, or symlink destination not found. don't bother logging errors. */ *flags |= MAILBOX_NOSELECT; } - if ((*flags & MAILBOX_NOSELECT) == 0) { + if ((*flags & (MAILBOX_NOSELECT | MAILBOX_NONEXISTENT)) == 0) { /* make sure it's a selectable mailbox */ maildir_path = t_strconcat(path, "/"DBOX_MAILDIR_NAME, NULL); if (stat(maildir_path, &st) < 0 || !S_ISDIR(st.st_mode))