Creating email folders


#1

How do I create email folders that are not subfolders of “INBOX”?

When I attempt to create new top-level folders, either through IMAP or squirrelmail, I get an error “Invalid Mailbox Name”.


#2

I don’t believe that you can create folders that arn’t sub-inbox. Sent and drafts are sub-inbox too… as I understand that’s just the way things go.

-Matttail


#3

That may be the case on Dreamhost, but it’s certainly not true of all hosts. Sent, Drafts, Junk etc. are often top-level folders in a normal IMAP setup, all stored in a user’s home directory.


#4

Oh no … this is a huge problem for me; and I already spent the over $300 on a two-year prepurchase of a Level 3 account.

My email client (OS X Mail) reports the number of unread messages of an entire tree heirarchy when they are collapsed. Since my stored email folders (that I was about to import from my former host) have ~20,000 unread emails, this means I will never be able to tell whether or not I actually have new mail without expanding the entire tree. But since I have seven accounts with large folder trees, I won’t be able to see all the inboxes on my screen if I keep them expanded!

When the folders are themselves top-level folders (not part of INBOX), OS X Mail lists them as an entirely separate group of folders. In order to rapidly process incoming mail, I need to be able to separately see how many unread emails are in my inbox.

I also need to be able to process my mailboxes with command-line tools; given the number of messages I have stored, this is a hell of a lot easier with a clean heirarchy than with everything dumped in INBOX.

That may be the case on Dreamhost, but it’s certainly not true of all hosts. Sent, Drafts, Junk etc. are often top-level folders in a normal IMAP setup, all stored in a user’s home directory.

Yes, in fact the ability to specify a pathname that your top-level folders reside in is part of the formal IMAP specification. Technically if Dreamhost does not have that capability, they aren’t really offering IMAP email.


#5

After a bit more googling, it turns out this particular issue is a namespace idiosyncracy of Courier-IMAP, the IMAP server software that Dreamhost uses. It can be compensated for (usually) in the email client. “INBOX.” is the root heirarchy for Courier-IMAP, but most mailclients can learn to interpret that namspace correctly if they do not do so automatically.

The solution in Mac OS X Mail.app (As of version 10.4) is to manually set the IMAP path prefix to “INBOX”. This instructs Mail to interpret any folder named INBOX.xxxx as if it were a root-level folder named “xxxx”.

I don’t know if there’s a solution for squirrelmail, or what the situation is for other mail clients.

Anyhow, I have added a section about this issue to the Mac OS X mail page on the wiki, along with a screenshot.


#6

This is probably a function of the IMAP server being used. DH uses Courier IMAP, and one of the FAQ’s says that “IMAP servers are free to use any folder namespace arrangement that’s technically convenient for them. Courier uses “INBOX.” as the namespace for private folders, and “shared.” as the namespace for public, shared, folders.” http://www.courier-mta.org/FAQ.html

I don’t use Mail, but one possibility is to make a new “inbox” as a subfolder of the system INBOX and use procmail to file new incoming messages there. That way all the folders you actually use will be at the same hierarchy level.

You can process mail using command line tools. Messages are stored using Maildir format, which means each message is in a separate file, and a folder has a cur and new subdirectories. The main INBOX is stored in ~/Maildir/cur and ~/Maildir/new; subfolders are subdirectories of ~Maildir with a period before the mail folder name.