dovecot-2.0: lib-storage: mailbox_list_iter_init_namespaces() di...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 19 18:35:37 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/2587eb79a83d
changeset: 11336:2587eb79a83d
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 19 17:35:27 2010 +0200
description:
lib-storage: mailbox_list_iter_init_namespaces() didn't match INBOX pattern correctly.

diffstat:

 src/lib-storage/mailbox-list.c |  15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diffs (32 lines):

diff -r 1c1db8a6cfc7 -r 2587eb79a83d src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Wed May 19 17:21:42 2010 +0200
+++ b/src/lib-storage/mailbox-list.c	Wed May 19 17:35:27 2010 +0200
@@ -607,6 +607,19 @@
 }
 
 static bool
+ns_match_inbox(struct mail_namespace *ns, const char *pattern)
+{
+	struct imap_match_glob *glob;
+
+	if ((ns->flags & NAMESPACE_FLAG_INBOX) == 0)
+		return FALSE;
+
+	glob = imap_match_init(pool_datastack_create(), pattern,
+			       TRUE, ns->sep);
+	return imap_match(glob, "INBOX") == IMAP_MATCH_YES;
+}
+
+static bool
 ns_match_next(struct ns_list_iterate_context *ctx, struct mail_namespace *ns,
 	      const char *pattern)
 {
@@ -693,6 +706,8 @@
 		   necessary, but this shouldn't matter much */
 		T_BEGIN {
 			for (i = 0; ctx->patterns_ns_match[i] != NULL; i++) {
+				if (ns_match_inbox(ns, ctx->patterns_ns_match[i]))
+					break;
 				if (ns_match_next(ctx, ns,
 						  ctx->patterns_ns_match[i]))
 					break;


More information about the dovecot-cvs mailing list