]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox & cydir: If mailbox doesn't exist, return it as \nonexistent instead of
authorTimo Sirainen <tss@iki.fi>
Sat, 24 May 2008 13:57:28 +0000 (16:57 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 24 May 2008 13:57:28 +0000 (16:57 +0300)
\noselect.

--HG--
branch : HEAD

src/lib-storage/index/cydir/cydir-storage.c
src/lib-storage/index/dbox/dbox-storage.c

index e010fd71be80a733b244059587534607e6c53e1d..d3015c657b44af020e3e59fc03c0c3102a8b63c2 100644 (file)
@@ -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. */
index c5a23595b1de5e21e050255a9b0adfc4d389b474..957fc73ec3ec2d3e0e8fee9795d3086afedf0751 100644 (file)
@@ -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))