what is the difference b/w maildir and mailbox's directory structure

chuza

Well-Known Member
Jul 4, 2008
47
0
56
What is the difference between maildir and the old format. How to identify which is currently implemented. Anyone can tell me how to easily identify it from the directory structure. I know mailbox can be converted to /scripts/converttomaildir
 

sparek-3

Well-Known Member
Aug 10, 2002
2,021
226
368
cPanel Access Level
Root Administrator
Maildir will have each individual e-mail message stored as a file. In each mail account's folder on your file system you will see three directory: new, cur, and tmp.

As new message arrive at the mail account, the files for those messages are stored in the new folder.

Mailbox works on a single file structure. All e-mail messages are stored in a single file on the account, usually inbox.

In terms of IMAP folders, on mailbox these folders are actually new files like inbox but would be named the folder's name and again would contain all of the e-mail messages in that "folder".

With Maildir new "folders" are subfolders on the mail account, which again have the new, cur, and tmp directories beneath them.

The advantage with maildir is in the case of a large mail account with many megabytes of messages. Instead of loading up the entire inbox file or mailbox file, each individual message can be opened separately because each individual message is a file on the file system.
 

chuza

Well-Known Member
Jul 4, 2008
47
0
56
Thanks man, will check to see if I can understand it more. However, isnt /scripts/convert2maildir a server level scripts that just runs indiscriminately on all accounts on the server. Can you tell me how to convert one account through this script to maildir while keeping others unaffected in old style. What do you mean by interactive, thats what I also wana know in clearer terms, an example perhaps.
 
Last edited:

sparek-3

Well-Known Member
Aug 10, 2002
2,021
226
368
cPanel Access Level
Root Administrator
You can't convert just one account to Maildir (I suppose you could, but it will mess up mail delivery on the server either for that account or for the other accounts on the server).

Maildir and Mbox are completely different structures. Exim, the Mail Transport Agent on cPanel has to know how to store messages that come into the server. Think of it as the middle man between receiving e-mail messages and putting those messages in the proper mail account on the server.

If the server is configured as an Mbox server, then Exim will write the messages into an inbox file on the appropriate mail account.

If the server is configured as a Maildir server, then Exim will create a file in the appropriate directory structure of the mail account.

Exim can only work in one of these ways. It can't work for both. It has no way of knowing that Mail Account A is mbox, while Mail Account B is maildir.

Not to mention that you again run into this same problem with your POP3 and IMAP services. How do they know which structure to read if you are using a mixed set?

I won't say that its impossible to use a mixture of Maildir and Mbox on a server, but it would be a configuration nightmare, and hugely inefficient. Its not something that cPanel is going to support.