Portal Home > Knowledgebase > Articles Database > mbox vs maildir

mbox vs maildir

Posted by Red Squirrel, 05-31-2008, 03:38 PM
For an ISP/webhost style email setup, what is better, mbox or maildir? Everyone seems to recommend maildir, but the issue I'm thinking of is if people decide to store their mail on server it will eventually run out of inodes, and I'm sure reading 1 single file is much faster then reading thousands, or am I wrong?

Posted by activelobby4u, 05-31-2008, 06:04 PM
maildir ..the concept is very simple, if you need a single line from a large file of 100k lines, would you prefer storing it as one in 100k or in a separate file . In short the mail seek speed for the mails have improved with the maildir concept and hence all major mail servers today use the maildir format

Posted by ylsy, 06-01-2008, 06:36 AM
Also remember most IMAP servers have their own cache files so reading headers from files from maildir is actually pretty fast, as a lot of them are already cached. I think the biggest issue with mbox is file locking. Imagine you are reading emails over IMAP. You select two emails, and press Delete. At the same time, two other emails are coming from MTA doing local delivery to your mbox file on a NFS mount... Maildir will have absolutely no problem in this situation, but you'll expect very slow response from mbox due to the amount of file locking, or you'll just get a borked mailbox afterwards.

Posted by Red Squirrel, 06-01-2008, 12:35 PM
Hmm so speed is ok then, what about inodes? I read a while back that ext3 has a limited amount of inodes so even if you have 1TB drive, you're still limited to the number of files you can have. Is this a non issue or is it something I should worry about?

Posted by luki, 06-01-2008, 01:21 PM
You can specify the number of inodes to allocate when creating the file system. Choose something that fits your needs, say 100 million inodes for 1 TB disk, giving you < 10 KB average files size. You will likely run out of disk space before you run out of inodes. Note that the inode data takes space on the disk so you don't want to set it too high as you'll be just wasting your space.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Alabanza Web hosting (Views: 410)
vps6.net DOWN (Views: 427)
CAPTCHA Form (Views: 905)
PHP Error (Views: 360)