dovecot-1.1: dbox & cydir: If mailbox doesn't exist, return it a...

dovecot at dovecot.org dovecot at dovecot.org
Sat May 24 16:57:32 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/7690cdabb3f8
changeset: 7533:7690cdabb3f8
user:      Timo Sirainen <tss at iki.fi>
date:      Sat May 24 16:57:28 2008 +0300
description:
dbox & cydir: If mailbox doesn't exist, return it as \nonexistent instead of
\noselect.

diffstat:

2 files changed, 7 insertions(+), 1 deletion(-)
src/lib-storage/index/cydir/cydir-storage.c |    3 +++
src/lib-storage/index/dbox/dbox-storage.c   |    5 ++++-

diffs (33 lines):

diff -r bf8227a34937 -r 7690cdabb3f8 src/lib-storage/index/cydir/cydir-storage.c
--- 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 @@ static int cydir_list_iter_is_mailbox(st
 			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 -r bf8227a34937 -r 7690cdabb3f8 src/lib-storage/index/dbox/dbox-storage.c
--- 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 @@ static int dbox_list_iter_is_mailbox(str
 			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))


More information about the dovecot-cvs mailing list