[Dovecot] invalid mailbox name
Hi,
while migrating all mail from our old to our new server (using offlineimap, imap -> imap), I get the following error for one of my user's mailboxes:
ERROR: Folder 'Organisations.RS Env & IJRS'[local_hoekman] could not be created. Server responded: ('NO', ['Invalid mailbox name: Organisations.RS Env & IJRS'])
I suppose this is because of the ampersand in the mailbox name? Because other folder with spaces in it go just fine...
Is this a fixed thing? Why was my user able to create the folder once? And why is dovecot 1.2.15 refusing to create the folder now?
Migration is from dovecot 1.1.11 to 1.2.15.
Thanks, Vincent.
On 13.3.2012, at 10.46, Vincent Schut wrote:
Hi,
while migrating all mail from our old to our new server (using offlineimap, imap -> imap), I get the following error for one of my user's mailboxes:
ERROR: Folder 'Organisations.RS Env & IJRS'[local_hoekman] could not be created. Server responded: ('NO', ['Invalid mailbox name: Organisations.RS Env & IJRS'])
I suppose this is because of the ampersand in the mailbox name? Because other folder with spaces in it go just fine...
Is this a fixed thing? Why was my user able to create the folder once? And why is dovecot 1.2.15 refusing to create the folder now?
Old Dovecot versions didn't enforce mailbox names to be valid, new ones do. I guess user had a broken IMAP client that created a mailbox with invalid name and now Dovecot refuses to do it again.
Mailbox names are in "modified UTF-7" format. "&" character needs to be translated as "&-".
On 03/13/2012 10:00 AM, Timo Sirainen wrote:
On 13.3.2012, at 10.46, Vincent Schut wrote:
Hi,
while migrating all mail from our old to our new server (using offlineimap, imap -> imap), I get the following error for one of my user's mailboxes:
ERROR: Folder 'Organisations.RS Env& IJRS'[local_hoekman] could not be created. Server responded: ('NO', ['Invalid mailbox name: Organisations.RS Env& IJRS'])
I suppose this is because of the ampersand in the mailbox name? Because other folder with spaces in it go just fine...
Is this a fixed thing? Why was my user able to create the folder once? And why is dovecot 1.2.15 refusing to create the folder now?
Old Dovecot versions didn't enforce mailbox names to be valid, new ones do. I guess user had a broken IMAP client that created a mailbox with invalid name and now Dovecot refuses to do it again.
Mailbox names are in "modified UTF-7" format. "&" character needs to be translated as"&-".
Timo,
thanks for the quick follow-up. However, I'm afraid I don't really yet grasp your explanation about the utf-7 translation ("&" character needs to be translated as"&-"). To end my confusion, could you elaborate a bit on which of these interpretations is correct:
- when I want to create a folder with a "&" using a imap client, I have to type "&-"? or:
- the imap client (offlineimap in this case) should translate the "&" into "&-" on the fly (I can do that, you can give folder translation functions in offlineimap) or:
- the foldername on disk should contain "&-" instead of just "&" to denote the ampersand?
or did you mean something else altogether ("don't use folders with & in their names, they're evil")?
Vincent.
On 13.3.2012, at 11.10, Vincent Schut wrote:
Old Dovecot versions didn't enforce mailbox names to be valid, new ones do. I guess user had a broken IMAP client that created a mailbox with invalid name and now Dovecot refuses to do it again.
Mailbox names are in "modified UTF-7" format. "&" character needs to be translated as"&-".
Timo,
thanks for the quick follow-up. However, I'm afraid I don't really yet grasp your explanation about the utf-7 translation ("&" character needs to be translated as"&-"). To end my confusion, could you elaborate a bit on which of these interpretations is correct:
- when I want to create a folder with a "&" using a imap client, I have to type "&-"?
no.
or:
- the imap client (offlineimap in this case) should translate the "&" into "&-" on the fly (I can do that, you can give folder translation functions in offlineimap)
no.
or:
- the foldername on disk should contain "&-" instead of just "&" to denote the ampersand?
yes.
or did you mean something else altogether ("don't use folders with & in their names, they're evil")?
When user types "&", the IMAP client should translate it to "&-". Also in filesystem it should be shown as "&-" (although this will be configurable in future). On input IMAP client will of course also see it as "&-" and should translate it back to "&" before making it visible to user.
offlineimap works correctly in that it doesn't really need to do any kind of translation or validation, since it was originally IMAP client's fault for creating it and secondarily Dovecot's fault for allowing its creation. Although I guess offlineimap could have detected that this is an invalid mailbox name and translated it to something valid (this is how Dovecot v2.x's dsync works).
On 13.3.2012, at 11.10, Vincent Schut wrote:
- the imap client (offlineimap in this case) should translate the "&" into "&-" on the fly (I can do that, you can give folder translation functions in offlineimap)
Oh, and you probably shouldn't do any automated translations, since they're more likely to just break things. This isn't just about the & character, but any non-ascii, such as a mailbox called "pää" would be translated as "p&AOQA5A-". If you go and change & in there to &-, it would end up showing broken to user.
Unless there are a lot of these, it's easier to just rename the broken mailboxes in the source server.
On 03/13/2012 10:20 AM, Timo Sirainen wrote:
On 13.3.2012, at 11.10, Vincent Schut wrote:
- the imap client (offlineimap in this case) should translate the "&" into"&-" on the fly (I can do that, you can give folder translation functions in offlineimap)
Oh, and you probably shouldn't do any automated translations, since they're more likely to just break things. This isn't just about the& character, but any non-ascii, such as a mailbox called "pää" would be translated as "p&AOQA5A-". If you go and change& in there to&-, it would end up showing broken to user.
Unless there are a lot of these, it's easier to just rename the broken mailboxes in the source server.
Thanks Timo. Everything's clear now. There are only a few of these, I'll just rename them (and their line in the subscriptions file).
Vincent.
participants (2)
-
Timo Sirainen
-
Vincent Schut