Maildir

From LQWiki
(Redirected from MailDir)
Jump to navigation Jump to search

maildir is a structure for directories of incoming mail messages. It solves the reliability problems that plague mbox files and mh folders. Features include no locking, separate files, reliable over NFS.

There are three different folders within each maildir folder - cur, new and temp. The new folder accepts all incoming mail to that maildir. Once the email has been seen by a MUA, or mail-reading agent, the email is moved to the cur folder. The tmp folder acts as a failsafe to try to ensure no email is lost.

For a more full description and technical overview, see its man page.

Maildir as an approach

If you decide to use maildirs, you may have to set this in

  • your MTA so it stores arriving mails in maildirs
for postfix, set home_mailbox = Maildir/ in /etc/postfix/main.cf
if you use courier-imap you do not have to do anything
  • your pop server so it knows where to fetch mails
you can use courier for pop as well for imap
  • your procmail so it knows e.g. where to put mails that have been fetched via pop from other accounts
set DEFAULT=$HOME/Maildir/ in /etc/procmailrc