I have a mailserver:

  • Postfix for transfer
  • Dovecot/IMAP for reading
  • Maildir for storage
  • Thunderbird as main supported client (but of course, I want to be compatible with all)
  • Roundcube for webmail access

I can't seem to find a correct way to organise my Maildirs. Currently, my personal one looks like this:

drwx------ 5 bartvh bartvh   4096 May  5 19:42 .Drafts
drwx------ 5 bartvh bartvh   4096 May  7 16:55 .INBOX.Concepten // Dutch for drafts
drwx------ 5 bartvh bartvh   4096 May  7 12:14 .INBOX.Junk
drwx------ 5 bartvh bartvh   4096 May  7 12:14 .INBOX.Trash
drwx------ 5 bartvh bartvh   4096 May  7 16:54 .INBOX.Verzonden // Dutch for Sent
drwx------ 5 bartvh bartvh   4096 May  6 19:50 .Junk
drwx------ 5 bartvh bartvh   4096 Apr 27 14:41 .Ongewenste e-mail // Dutch for Junk
drwx------ 5 bartvh bartvh   4096 May  6 08:26 .Sent
drwx------ 5 bartvh bartvh   4096 May  6 12:09 .Trash
drwx------ 2 bartvh mail    45056 May  8 08:24 cur
-rw------- 1 bartvh bartvh     17 Feb 14 19:03 dovecot-keywords
-rw------- 1 bartvh bartvh  26778 May  8 08:24 dovecot-uidlist
-rw------- 1 bartvh bartvh   7264 May  8 08:24 dovecot.index
-rw------- 1 bartvh bartvh 411648 May  8 08:24 dovecot.index.cache
-rw------- 1 bartvh bartvh  19248 May  8 08:24 dovecot.index.log
drwx------ 2 bartvh mail    12288 May  8 08:24 new
-rw------- 1 bartvh bartvh    109 May  7 16:55 subscriptions
drwx------ 2 bartvh mail     4096 May  8 08:16 tmp

As you can see, it's a mess and there's a lot of double stuff. The ones with .INBOX before them were created by Thunderbird, the other ones I made myself, I think. However, I can't really seem to get TB working with them. They don't appear there. Additionally, all of a sudden, TB won't see any of the folders anymore. If I click Inbox->Concepten it will yell at me saying ".INBOX.INBOX.Concepten does not exist" ??

What can I do to organise this? What is the recommended way?

3 Answers 3


I Agree with @David_Collantes: the one making the mess is your various clients which I suspect have different ideas about your Maildir namespace.

In Thunderbird go to Server Setting -> Advanced and set your 'Personal namespace' to ".". You might also have to uncheck the 'Allow server to override these namespaces' box.

This setting controls where the client looks for folders. So you could make a subsection of your IMAP folders that's just for thunderbird.

  • While not the solution, it did point me in the right direction. I've solved TB things by: 1. Deleting all .INBOX things on the server 2. Making IMAP server root empty in TB 3. Unchecking "only show subscribed" May 9, 2009 at 14:08

Yeah, there's no real standard for how to organise mailboxes in a Maildir -- different programs have different ideas of how things should be laid out.

In all honesty, it's best just to access everything via IMAP and let the IMAP server deal with the foldering.

  • I do use IMAP to connect (is there any other way? You can't use the server files from a client directly like, say, SVN, right?) but as far as I know, the server doesn't care about the folders at all. Clients mess it all up. May 8, 2009 at 8:58
  • Oh, OK, I misunderstood the use of Tbird. Yes, most mail clients can read a Maildir locally if you run them on the server with the Maildirs on it. If Tbird is making a mess even via IMAP, something's a bit out of whack in it's config. Not sure what, I use mutt.
    – womble
    May 8, 2009 at 9:23
  • If you are careful with the layout of your mailboxes, IMAP and local access can work together just fine. Dovecot uses the Maildir++ laout, meaning the hierarchy of "folders" and "subfolders" is not based on subdirctories on the filesystem but a flat namespace of "."-separated names, so where that is used I get around it by having a script that creates symbolic links from the local Maildir directory hierarchy to a Maildir++ directory used for IMAP. But in fact I use IMAP that way all the time - mostly I just use the local mailboxes, but at times I access my mail remotely using IMAP. May 8, 2009 at 18:47

The one making the "mess" isn't the server, but your clients, when setting preferences on what name to give to directories, and while specifying the IMAP root path. With Dovecot, which is what you are using, you should leave the IMAP root empty on your clients settings, to automatically detect. On RoundCube, leave the following configuration settings as they come from default:

$rcmail_config['imap_root'] = null;
$rcmail_config['imap_delimiter'] = null;

So RoundCube will automatically determine the IMAP's root directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .