Difference Between Maildir and Mbox’s Directory Structure
Posted on August 17th, 2018
Maildir and Mbox are email formats which act as a directory for storing messages in email applications. Mbox was the original mail storage system on a cPanel server, but now Maildir is the default option. Mbox places all messages in the same file on the server, whereas, Maildir stores messages in individual files with unique names.
Directories in the Maildir format has three subdirectories. They are:
1) new: Each file in a new subdirectory is all incoming email messages received in a limited time. It is used for notifying the user to have a new message. The modification time of the files in the new directory is the delivery date of the message. The message is normally in RFC 822 format in which it starts with a “Return-path” line and a “Delivered-to” line.
2) Cur: The files in the cur directory are same as the new directory but, the files in cur are no longer new mail. They have been seen by the user’s mail reading program. That is, it saves only those messages, which have been read by the user.
3) tmp: tmp directory includes a temporary data file associated with the Maildir file extension directory. It is used for ensuring the reliable delivery of the message.
Benefits of Maildir
1) Maildir is more current.
2) Faster and stable than mbox.
3) The main advantage of this file format is that it can easily classify into subdirectories. When a new message arrives, it filters accordingly and moves in the respective subdirectories.
4) These files can be distributed over the network without any compatibility issues.
5) Compatible with both courier and dovecot mail servers.
6) Most secure format and minimum chances of data corruption.
7) Maildir directory creates one single file for every incoming mail messages.
Mailbox file format is also known as Mbox. Mbox is an email file type, which stores messages in plain text format. The email contents in the file comprise in the form of 7-bit ASCII text and the rest of email components (attachments, metadata etc..) are stored in encoded form. Mailbox works in a single file format in which all email messages are stored in a single file on the account, usually inbox.
Benefits of Mbox
1) The file format is universally supported.
2) Appending new mail in the mailbox is faster.
3) Searching text inside the mailbox is faster.
It has some file locking problems and problems when used with network file systems.
If the server is configured using a mbox server, then the Exim will write 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 work only in one format.
You can convert mbox to maildir format using a cPanel script. Users who want to migrate the data into cPanel and WHM servers, you can use the following script to change the file format. Log in to the server via SSH and run the following command:
This process may take up to 24 hours. It may vary according to the servers’ hardware and the number of accounts to convert. The user cannot send receive emails while the server is in the conversion process. It is recommended to overt the file format in off-peak time. You can see the following options after running the command:
Start maildir conversion process with Courier mail server
Start maildir conversion process with Dovecot mail server
First option used for converting the server from mbox to the Maildir storage format with Courier as the mail server.
Second option used for converting the server from mbox to the Maildir storage format with Dovecot as the mail server.
The third option (*) is used or exiting the script.
If you need any further assistance please contact our support department.