[Dovecot] dot-containing foldernames \HasNoChildren bug ?

Timo Sirainen tss at iki.fi
Mon Aug 9 19:48:30 EEST 2010


On Mon, 2010-08-09 at 18:26 +0200, Samuel Kvasnica wrote:
> >> +               if (*str == ns->list->hierarchy_sep || ( mlist && // SK mlist was zero check added !
> >> +                          *str == mlist->escape_char) || *str == '/'){
> >>                         str_printfa(esc, "%c%02x", mlist->escape_char, *str);                                                                                         
> >> -               else                                                                                                                                                  
> >> +                       }                                                                                                                                             
> >> +               else{
> >>                         str_append_c(esc, *str);
> >> +                       }
> >> +               }
> > Was there a reason for this change?
> yes, I've got segfaults, mlist was zero ! But thats just an "intuitive"
> patch without understanding what going on... 

http://hg.dovecot.org/dovecot-2.0/rev/ed61aee681b8 should fix that.

> i'm just terribly under pressure to get the setup working

Have you considered on getting rid of listescape plugin and simply
using :LAYOUT=fs? :) That should be more reliable..

> actually, the LSUB command is totaly broken with listescape for
> subfolders when using wildcards, and I cannot find the reason why. Not
> only in shared area, also in INBOX root. Really got lost in the pointer
> jungle, not sure how to debug further.
> 
> no listescape example:
> 
> . lsub "" "Public/public/%"
> * LSUB () "/" "Public/public/ccc"
> . OK Lsub completed.

This looks like a public namespace, not private namespace? Anyway I see
that the problem with shared/public mailboxes has to do with ACL plugin
and listescape plugin interaction.

Problem 1) Rebuilding dovecot-acl-list:

ACL plugin sees "foo.bar" mailbox name and then tries to look for its
dovecot-acl file without going through listescape plugin, because it 
never calls mailbox_alloc().

In acllist_append() you could try replacing
mail_namespace_get_storage_name() call with mailbox_alloc() and then
using mailbox_get_name(). Then it should write the escaped name to
dovecot-acl-list file.

Problem 2) Reading dovecot-acl-list file:

In acl_mailbox_try_list_fast() it reads the dovecot-acl-list with
escaped names, but acl_mailbox_list_iter_next_info() compares them with
unescaped names.

Maybe in 1) case it should just keep the mailbox names in escaped form
in dovecot-acl-list file so 2) wouldn't need to be changed.. In 1) case
then you'd still need mailbox_alloc() and pass the escaped name to
acl_object_init_from_name() so that it can read the right dovecot-acl
file.

I don't really want to try to fix this for v2.0. Seems like a pretty
ugly mess that would be fixed much more easily by some API changes.



More information about the dovecot mailing list