dovecot: Allow subscribing to namespace prefixes if they're list...

dovecot at dovecot.org dovecot at dovecot.org
Sat Oct 27 20:30:12 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/0511e301acbc
changeset: 6629:0511e301acbc
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Oct 27 20:30:04 2007 +0300
description:
Allow subscribing to namespace prefixes if they're listable.

diffstat:

1 file changed, 10 insertions(+), 3 deletions(-)
src/imap/cmd-subscribe.c |   13 ++++++++++---

diffs (30 lines):

diff -r 7373240c3d1d -r 0511e301acbc src/imap/cmd-subscribe.c
--- a/src/imap/cmd-subscribe.c	Sat Oct 27 20:18:37 2007 +0300
+++ b/src/imap/cmd-subscribe.c	Sat Oct 27 20:30:04 2007 +0300
@@ -6,7 +6,7 @@
 
 bool cmd_subscribe_full(struct client_command_context *cmd, bool subscribe)
 {
-	struct mail_namespace *ns;
+	struct mail_namespace *ns, *ns2;
         struct mail_storage *storage;
 	struct mailbox_list *list;
 	const char *mailbox, *verify_name;
@@ -31,8 +31,15 @@ bool cmd_subscribe_full(struct client_co
 		verify_name = t_strndup(verify_name, strlen(verify_name)-1);
 	}
 
-	if (!client_verify_mailbox_name(cmd, verify_name, subscribe, FALSE))
-		return TRUE;
+	ns2 = mail_namespace_find_prefix_nosep(cmd->client->namespaces,
+					       mailbox);
+	if (ns2 != NULL && (ns2->flags & NAMESPACE_FLAG_LIST) != 0) {
+		/* subscribing to a listable namespace prefix, allow it. */
+	} else {
+		if (!client_verify_mailbox_name(cmd, verify_name,
+						subscribe, FALSE))
+			return TRUE;
+	}
 
 	list = mail_storage_get_list(storage);
 	if (mailbox_list_set_subscribed(list, mailbox, subscribe) < 0)


More information about the dovecot-cvs mailing list