More special chars in mailbox names

Brian Awood bawood at umich.edu
Wed Nov 19 12:43:57 EST 2008


Either Wes jinxed us or we've finally demonstrated why allowing * in 
mailbox names is a bad idea.  We recently had a user rename a parent 
mailbox containing a "*", to a name not containing the "*".  At that 
point cyrus took the liberty of renaming all the sub mailboxes by 
removing the first couple of characters.  So for example their mailboxes 
went from something like:
	*parent/child1
	*parent/child2
after renaming "*parent" to "parent" they became:
	parent/ild1
	parent/ild2
	etc...
In testing this I've also observed even more interesting behavior by 
renaming a mailbox while adding or removing a * to a mailbox that already 
has a "*".

This originally occurred on a 2.3.12 machine, but I've reproduced it in 
2.3.13 & 2.3.8.  I suspect part of of this issue is code like the 
following in the "findall"/"findsub" functions in mboxlist.c

    /* Find fixed-string pattern prefix */
    for (p = pat; *p; p++) {
        if (*p == '*' || *p == '%' || *p == '?' || *p == '@') break;
    }
    prefixlen = p - pattern;
    *p = '\0';

I thought about reversing the direction of the character search to see if 
that would help, but I suspect there are other issues as well.  Also, 
since @ is normally allowed in GOODCHARS, it seems the above code could 
trigger unexpected behavior for people even if they are using the 
standard GOODCHARS.  

---
Brian Awood
University of Michigan
ITCS

On Tuesday 30 September 2008 @ 22:15, Wesley Craig wrote:
> On 30 Sep 2008, at 21:23, Ken Murchison wrote:
> > Using list-wildcards would always be a bad idea IMHO.
>
> UMich has a lot of mailboxes with * in their names.  It's not a
> problem, tho you're probably right that it's a bad idea.  I guess
> IMAP implementations usually use literals to communicate.  Which is
> just what Cyrus does internally.  The rest of that optional syntax is
> gilding.
>
> :wes




More information about the Cyrus-devel mailing list