changeset 7533:7690cdabb3f8 HEAD

dbox & cydir: If mailbox doesn't exist, return it as \nonexistent instead of \noselect.
author Timo Sirainen <tss@iki.fi>
date Sat, 24 May 2008 16:57:28 +0300
parents bf8227a34937
children 9c781d042afe
files src/lib-storage/index/cydir/cydir-storage.c src/lib-storage/index/dbox/dbox-storage.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/cydir/cydir-storage.c	Sat May 24 16:56:47 2008 +0300
+++ b/src/lib-storage/index/cydir/cydir-storage.c	Sat May 24 16:57:28 2008 +0300
@@ -376,6 +376,9 @@
 			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. */
--- a/src/lib-storage/index/dbox/dbox-storage.c	Sat May 24 16:56:47 2008 +0300
+++ b/src/lib-storage/index/dbox/dbox-storage.c	Sat May 24 16:57:28 2008 +0300
@@ -622,12 +622,15 @@
 			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))