dovecot-2.0: Allow prefix="" namespace to have list=no and make ...
dovecot at dovecot.org
dovecot at dovecot.org
Sat May 9 22:05:31 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/e144fa1dd2ce
changeset: 9253:e144fa1dd2ce
user: Timo Sirainen <tss at iki.fi>
date: Sat May 09 15:04:22 2009 -0400
description:
Allow prefix="" namespace to have list=no and make it work in a somewhat useful way.
Based on patch by Mark Washenberger.
diffstat:
2 files changed, 11 insertions(+), 8 deletions(-)
src/imap/cmd-list.c | 13 +++++++++++--
src/lib-storage/mail-namespace.c | 6 ------
diffs (39 lines):
diff -r 937dca181d77 -r e144fa1dd2ce src/imap/cmd-list.c
--- a/src/imap/cmd-list.c Sat May 09 14:53:06 2009 -0400
+++ b/src/imap/cmd-list.c Sat May 09 15:04:22 2009 -0400
@@ -570,8 +570,17 @@ list_namespace_match_pattern(struct cmd_
skip_namespace_prefix_pattern(ctx, &cur_ns_prefix,
cur_ref, &cur_pattern);
- if (*cur_ns_prefix == '\0')
- return TRUE;
+ if (*cur_ns_prefix == '\0') {
+ /* no namespace prefix: if list=no we don't want to show
+ anything, except when the client does e.g. LIST "" mailbox.
+ prefix="", list=no namespace is mainly useful for working
+ around client bugs. */
+ if ((ns->flags & NAMESPACE_FLAG_LIST_PREFIX) == 0 &&
+ list_pattern_has_wildcards(cur_pattern))
+ return FALSE;
+ else
+ return TRUE;
+ }
/* namespace prefix still wasn't completely skipped over.
for example cur_ns_prefix=INBOX/, pattern=%/% or pattern=IN%.
diff -r 937dca181d77 -r e144fa1dd2ce src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c Sat May 09 14:53:06 2009 -0400
+++ b/src/lib-storage/mail-namespace.c Sat May 09 15:04:22 2009 -0400
@@ -176,12 +176,6 @@ namespaces_check(struct mail_namespace *
return FALSE;
}
}
- if (*ns->prefix == '\0' &&
- (ns->flags & NAMESPACE_FLAG_LIST_PREFIX) == 0) {
- *error_r = "namespace configuration error: "
- "Empty prefix requires list=yes";
- return FALSE;
- }
if ((ns->flags & NAMESPACE_FLAG_SUBSCRIPTIONS) != 0)
subscriptions_count++;
}
More information about the dovecot-cvs
mailing list