changeset 6318:5313cbcfccc6 HEAD

Don't crash if mailbox named INBOX is listed in prefixless namespace, but which doesn't have inbox=yes. Instead the mailbox is simply not listed.
author Timo Sirainen <tss@iki.fi>
date Mon, 27 Aug 2007 17:19:49 +0300
parents 3cee177eced6
children c2c8ee636157
files src/imap/cmd-list.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-list.c	Fri Aug 24 21:43:27 2007 +0300
+++ b/src/imap/cmd-list.c	Mon Aug 27 17:19:49 2007 +0300
@@ -315,12 +315,18 @@
 		flags = info->flags;
 
 		if (strcasecmp(name, "INBOX") == 0) {
-			i_assert((ctx->ns->flags & NAMESPACE_FLAG_INBOX) != 0);
 			if (ctx->inbox_found) {
 				/* we already listed this at the beginning
 				   of handling INBOX/ namespace */
 				continue;
 			}
+			if ((ctx->ns->flags & NAMESPACE_FLAG_INBOX) == 0) {
+				/* INBOX is in non-empty prefix namespace,
+				   and we're now listing prefixless namespace
+				   that contains INBOX. There's no way we can
+				   show this mailbox. */
+				continue;
+			}
 			ctx->inbox_found = TRUE;
 		}
 		if (ctx->cur_ns_send_prefix)