I'm not sure if this is a bug or just an undesirable feature, but when I have our namespace configured to match Courier's "INBOX." functionality, Dovecot forces me to also define a default namespace (with no prefix). Without the default namespace defined I get "NO Unknown namespace." errors when trying to subscribe or unsubscribe folders.
So I have configured my namespaces like this:
namespace private { separator = . prefix = INBOX. inbox = no } namespace private { separator = . prefix = inbox = yes hidden = yes }
However with this configuration, LIST commands ignore the "hidden = yes" setting on the default namespace and IMAP clients end up displaying an identical folder listing twice...
2 list "" "*"
- LIST (\HasChildren) "." "INBOX"
- LIST (\HasNoChildren) "." "INBOX.spam"
- LIST (\HasNoChildren) "." "INBOX.Trash"
- LIST (\HasNoChildren) "." "INBOX.Sent"
- LIST (\HasNoChildren) "." "INBOX.Drafts"
- LIST (\HasNoChildren) "." "INBOX.RSS"
- LIST (\HasNoChildren) "." "INBOX.test"
- LIST (\HasNoChildren) "." "INBOX.test2"
- LIST (\HasNoChildren) "." "spam"
- LIST (\HasNoChildren) "." "Trash"
- LIST (\HasNoChildren) "." "Sent"
- LIST (\HasNoChildren) "." "Drafts"
- LIST (\HasNoChildren) "." "RSS"
- LIST (\HasNoChildren) "." "test"
- LIST (\HasNoChildren) "." "test2" 2 OK List completed.
Again, I am not sure if this was intended, but either way it is undesirable for us. I even had a couple customers delete one of their duplicate folders thinking that was safe, but it deleted both folders - of course.
To force Dovecot to hide mailboxes in the default namespace I made the following change:
src/imap/cmd-list.c: @247
- if (ns->hidden) {
return;
- }