Bug: The "listescape" plugin does not work with the option "mail_shared_explicit_inbox = no". [with patch]

Rudolf Körner r.koerner at tscheinig.com
Tue Feb 9 15:06:38 UTC 2016


Hello,

there seems to be a problem with the listescape plugin and shared INBOX:

=== Preconditions:
- Dovecot 2.2.21 (or 2.2.13)
- IMAP
- Separator /
- Namespace-prefixes "INBOX/" and "shared/%%u/"
- Maildir(++)
- option mail_plugins = acl listescape
- option mail_shared_explicit_inbox = no
- User "owner" shares the INBOX
- ACLs set for another user "reader", so "reader" is able to access the 
shared INBOX of "owner"

=== Steps to reproduce by using IMAP commands at a telnet session:
- a1 login reader password
- a2 select shared/owner

=== Result:
Selecting the shared INBOX fails with a response like:
  a2 NO Mailbox doesn't exist: shared/owner

=== Expected:
The "select" command works.

=== Analysis:
The function "mailbox_list_default_get_storage_name" 
(lib-storage/mailbox-list.c) does not work as expected when using the 
mail_plugin "listescape".
It compares the mailbox name to the namespace prefix. Since the mailbox 
name is escaped a few lines before, the comparison yields "strings 
differ", which makes accessing the shared INBOX fail.

For example: for a string vname (mailbox name) "shared/owner", it 
compares "shared.owner" (escaped string) to the list->ns->prefix which 
is "shared/owner".

Asuming that the stored prefix should not be escaped, there should be a 
comparison of the unescaped name to the unescaped prefix (or the escaped 
name to the escaped prefix?).

=== Patch:
Attached is a small patch which shows a possible solution. When applied, 
the problem is solved, i.e. the shared INBOX is accessible then.
Important note: this patch is experimental, it works for the described 
special case but might not work with a different configuration or might 
even break things.

Best Regards,
Rudolf Körner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dovecot_patch_shared_INBOX_working_with_libescape_plugin_and_mail_shared_explicit_inbox-no_EXPERIMENTAL.patch
Type: text/x-patch
Size: 1598 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20160209/393f0641/attachment.bin>


More information about the dovecot mailing list