IMAP namespaces

Submitted by gwolf on Thu, 12/02/2004 - 00:00
How come seemingly no one ever gets RFC 2342 right? I recently set up a Courier IMAP server for a new client. A nice setup, all in all... But my client was complaining he could not create any folders in it. All he ever got from the server was a not-so-nice Invalid mailbox name from the server. Dive into Courier's documentation and into RFC 2060. Having done some work wrapping network services (and, by far, most of my work was devoted to fully understanding and implementing SMTP and POP3), it was easy to get to this point: $ telnet my.server 143 * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2004 Double Precision, Inc. See COPYING for distribution information. 0 login gwolf@my.server passwd 0 OK LOGIN Ok. 1 list "" * * LIST (\HasNoChildren) "." "INBOX" 1 OK LIST completed 2 create dirname 2 NO Invalid mailbox name. 3 logout * BYE Courier-IMAP server shutting down 3 OK LOGOUT completed Why? Well, some more digging into Courier's docs (and knowing what to look for) got me to the answer: Courier expects the full hierarchy of mail directories to be located under INBOX. - So now, substitute 2 for: 2 create INBOX.dirname 2 OK "INBOX.dirname" created. 3 list "" * * LIST (\HasNoChildren) "." "INBOX.dirname" * LIST (\Unmarked \HasChildren) "." "INBOX" 3 OK LIST completed A-ha! Now... Isn't it assuming a bit too much to ask potentially millions of non-computer-savvy users to be able to understand all of their folders must be under a strange INBOX? Even more, users whose native tongue is _not_ English? Yes, of course. It was taken care of too - This RFC guys are not dumb at all! Just take a look at the just mentioned RFC 2342, an extension to the IMAP4 protocol (published on May 1998, 2.5 years after the IMAP4 standard came along) that allows a mail client to query the server on what its namespace is. And, guess the best thing, Courier _does_ implement this extension (check the greeting banner on my first snippet) 2 namespace * NAMESPACE (("INBOX." ".")) NIL (("#shared." ".")("shared." ".")) 2 OK NAMESPACE completed. Ok. Roll back 4.5 years into the future, until December 2004. You would expect every mail client on the surface of this ball to have this quite simple extension implemented, right? Think again. No, MS Outlook (as my client complains) doesn't. Horde's IMP doesn't either (although you can do some strange configuration on its servers.php file - in my case, I had to specify INBOX. both in the folders and namespace keys to satisfy a regular user's desires). Not even, I must admit, my dear Mutt gets this one right! (although in this last case it can be a case of by forbidding the user to do something stupid, you'd also be forbidding him to do a thousand clever things) I simply cannot understand why. :-(
( categories: )
Josh's picture

RE: IMAP namespaces

Use dovecot, it doesn't seem to do the INBOX thing, and seems to be very stable and compact as well.
migus's picture

RE: IMAP namespaces

IIRC you can create any folder but It must begin with a dot. At home I have ".migus-eu/", ".debian-private" and so on.... It is quite anying but It works nicely
Gunnar's picture

RE: IMAP namespaces

Nope :-( <tt>2 create .newfolder 2 NO Invalid mailbox name. </tt> But anyway, at least I have the answer... And I just have to ask users to use clueful IMAP clients :)
migus's picture

RE: IMAP namespaces

You blog does not like the dash :-)
Gunnar's picture

RE: IMAP namespaces

I know :-( And it seems it also doesn't like HTML tags in the comments :)
Andre Goncalves's picture

RE: IMAP namespaces

I've another answer from the server! a create inbox.test a NO Cannot create this folder.
Corrupted dbx. Outlook express wont open.'s picture

RE: IMAP namespaces

I have been using it when I have Corrupted dbx and Outlook express wont open. Outlook Express more stable and secure than other programs.