Alternate namespace IMAP port (may help Outlook, OL Express, Apple Mail and BIS users)

Rob Mueller – 10 August 2008

Background summary: Since we started FastMail, we've been using cyrus as our IMAP server. By default, cyrus uses 2 different namespaces for folders: "INBOX" for personal folders, and "user" for shared folders. What this means is that all personal folders are actually a sub-folder of INBOX looking like this:

Since cyrus is a well used email server, and most people prefer personal folders being at the same level, most email software includes a "root prefix" option or the like, and setting that to "INBOX" will promote all the sub-folders of INBOX up one level, and display INBOX as Inbox, to create this:

The problem is that not all programs handle this as well as they should, some programs not at all, and for some when you do set the root prefix, it "hides" the "user" namespace, so you then can't use shared folders at all.

Alternate namespace: cyrus does have a mode where you can enable what's called the "altnamespace" feature. What this does is basically cause cyrus to internally remap folder names to (eg promote sub-folders of INBOX up one level), rather than getting the client to do it.

The problem is this is a server wide setting, and we can't just change it for everyone in one go, because every existing person that had an IMAP client setup would suddenly start getting errors. (eg their email client would try to select the folder INBOX.Drafts say, and the server would say that that folder doesn't exist anymore because it's now called just Drafts). Every existing user would have to remove the root prefix from their client, and then re-download a lot of email in many cases. This would cause massive disruption.

Solution: Well it turns out that while it's a server wide setting, it's actually per "service instance". What this means is that we can actually run two completely separate imap service instances at the same time, and one has regular namespace, and one has the "altnamespace" setting set. To make this accessible, we basically have to put it on a separate server/port.

So what I've done now is set this up, and map it to separate port numbers. So if you setup your email client with:

You'll get the alternate namespace IMAP instance.

Who is this for?: This is most useful for the following people:

Thunderbird users don't need to use this, because Thunderbird seems to be a bit smarter with an INBOX root prefix. It promotes the sub-folders correctly, but still shows the "user" namespace for shared folders as well.

Limitations: One thing the cyrus altnamespace instance doesn't handle properly is creating sub-folders of Inbox. I'm not entirely sure what will actually happen, but I'd recommend you don't do it.

If you have any issues, please email me at robm@fastmail.fm