bhayden at umn.edu
2007-Aug-14 02:58 UTC
[Dovecot] namespaces and creation of folders that contain folders...
Hi Timo and all. imap/cmd-create.c contains the following bit of code:
len = strlen(full_mailbox);
if (len == 0 || full_mailbox[len-1] != ns->sep)
directory = FALSE;
else {
/* name ends with hierarchy separator - client is just
informing us that it wants to create children under this
mailbox. */
directory = TRUE;
mailbox = t_strndup(mailbox, len-1);
full_mailbox = t_strndup(full_mailbox,
strlen(full_mailbox)-1);
i_info("Z CREATE NAME: YYY%sYYY", mailbox);
}
We've been having trouble with people not being able to create a mail
folder that will contain other folders. Tried it both with users using mbox
(where this would be a filesystem directory) and maildir. Failed everytime
because of a test which rejects folder names that end with MAILDIR_FS_SEP.
Looks like the above bit of code is supposed to catch these, make a note of
the fact that the client wants a directory, and strip off that trailing
separator. In fact, it does this in the case of 'full_mailbox'. However,
for 'mailbox' (it seems to me) the code is incorrect as its using the
len-1
which is the length of 'full_mailbox', not 'mailbox'. This means
that when
'mailbox' and 'full_mailbox' are the same length--that is, for
the default
namespace (no prefix), it happens to work. However, in any other namespace,
it won't, as 'full_mailbox' will always be longer then
'mailbox' if there
is a ns prefix, and hence that trailing separator won't be trimmed. (As a
matter of fact, in the unlikely instance that the prefix is a single
character this will trim the null character from 'mailbox', which
probably
isn't a good thing.)
So. Am I missing something, or crazy, or is this really a bug? Thanks,
-Brian
Timo Sirainen
2007-Aug-14 19:47 UTC
[Dovecot] namespaces and creation of folders that contain folders...
On Mon, 2007-08-13 at 21:58 -0500, bhayden at umn.edu wrote:> Hi Timo and all. imap/cmd-create.c contains the following bit of code:..> So. Am I missing something, or crazy, or is this really a bug? Thanks,It's a bug. Fixed: http://hg.dovecot.org/dovecot-1.0/rev/33690bb286af -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20070814/5668db45/attachment-0002.bin>
bhayden at umn.edu
2007-Aug-14 19:50 UTC
[Dovecot] namespaces and creation of folders that contain folders...
On Aug 14 2007, Timo Sirainen wrote:>On Mon, 2007-08-13 at 21:58 -0500, bhayden at umn.edu wrote: >> Hi Timo and all. imap/cmd-create.c contains the following bit of code: >.. >> So. Am I missing something, or crazy, or is this really a bug? Thanks, > >It's a bug. Fixed: http://hg.dovecot.org/dovecot-1.0/rev/33690bb286afExcellent! Thanks much. -Brian