Creating mailboxes

There are three kinds of mailboxes:

  1. Mailboxes that can have only messages.
  2. Mailboxes that can have only child mailboxes. This could also be called a directory.
  3. Mailboxes that can have both messages and child mailboxes. These are also called dual-use mailboxes.

If server doesn't support dual-use mailboxes, the user has to choose between creating a mailbox that can have messages and a directory. Many clients implement this badly, so users often complain that "the server doesn't support subfolders!" while in fact they are supported.

CREATE mailbox creates a mailbox that can have messages. CREATE mailbox/ creates a mailbox that can have child mailboxes. If the server supports dual-use mailboxes the latter might not actually do anything. It's not really even necessary, CREATE mailbox/foo could be used directly without creating the parent mailbox at all.

So unless you know that the server supports dual-use mailboxes your user interface should have some kind of a "create a directory" checkbox or some help text that lets user know that it's possible to create two types of mailboxes.

Dual-use state isn't actually server-specific. Some namespaces may have dual-use mailboxes while others may not. If you keep track of the dual-use status do it separately for each namespace. If server has at least one selectable (doesn't have \NoSelect flag) mailbox created (other than INBOX), you can figure out from its LIST reply if the namespace supports dual-use mailboxes. If the flags contain \NoInferiors it doesn't, otherwise it does.

If a mailbox has \NoInferiors flag, your client should give a helpful error message if user tries to create or rename a mailbox under it.

Renaming mailboxes

Deleting mailboxes