[dovecot-cvs] dovecot/src/imap cmd-list.c,1.55,1.56

tss at dovecot.org tss at dovecot.org
Sun Oct 8 22:42:42 UTC 2006


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv28776

Modified Files:
	cmd-list.c 
Log Message:
Handle INBOX-prefixed namespaces better. Avoid duplicate INBOX replies if
namespace prefix is given.



Index: cmd-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- cmd-list.c	6 Aug 2006 22:01:15 -0000	1.55
+++ cmd-list.c	8 Oct 2006 21:42:38 -0000	1.56
@@ -144,7 +144,8 @@
 			if (ctx->glob != NULL &&
 			    imap_match(ctx->glob, name) != IMAP_MATCH_YES)
 				continue;
-		} else if (strcasecmp(name, "INBOX") == 0) {
+		}
+		if (strcasecmp(name, "INBOX") == 0) {
 			if (!ctx->ns->inbox)
 				continue;
 
@@ -303,22 +304,16 @@
 		if (match < 0)
 			return;
 
+		len = strlen(ns->prefix);
 		if (match == IMAP_MATCH_YES &&
-		    (ctx->list_flags & MAILBOX_LIST_SUBSCRIBED) == 0) {
+		    (ctx->list_flags & MAILBOX_LIST_SUBSCRIBED) == 0 &&
+		    (!ctx->ns->inbox ||
+		     strncmp(ns->prefix, "INBOX", len-1) != 0)) {
 			/* The prefix itself matches */
                         enum mailbox_flags flags;
 			string_t *str = t_str_new(128);
 
-			len = strlen(ns->prefix);
-			if (strncmp(ns->prefix, "INBOX", len-1) == 0) {
-				/* FIXME: INBOX prefix - we should get real
-				   mailbox flags.. */
-				flags = MAILBOX_CHILDREN;
-				ctx->inbox_found = TRUE;
-			} else {
-				flags = MAILBOX_PLACEHOLDER;
-			}
-
+			flags = MAILBOX_PLACEHOLDER;
 			str_printfa(str, "* LIST (%s) \"%s\" ",
 				    mailbox_flags2str(flags, ctx->list_flags),
 				    ns->sep_str);



More information about the dovecot-cvs mailing list