Maildir is a format for an e-mail spool that does not require file locking to maintain message integrity because the messages are kept in separate files with unique names. A Maildir is a directory (often named Maildir) with three subdirectories named tmp, new, and cur. The subdirectories should all reside on the same filesystem.
The process that delivers an e-mail message writes it to a file in the tmp directory with a unique filename. The filename can be almost any unique series of filename characters (except a colon), but a typical implementation might use the current time in seconds, the hostname, the process ID and some random numbers.
When the delivery process successfully stores the message in tmp it links it into the new directory and then unlinks the file in tmp. This is to avoid the mail user agent reading a partial message while it is being delivered.
When the mail user agent process finds messages in the new directory it moves them to cur (using the same link then unlink strategy) and appends an informational suffix to the filename before reading them. The information suffix consists of a colon (to separate the unique part of the filename from the actual information), a '2', a comma and various flags. The '2' specifies, loosely speaking, the version of the information that follows the comma. '2' is the only currently officially specified version, '1' being an experimental version. One can only assume that it was used while the Maildir format was under development.
Although Maildir was designed to be completely lockless, it doesn't support completely reliable concurrent mailbox accessing without locking. The problem is that if the Maildir is modified at the same time as another process is getting the list of files in a maildir, some of the files may be skipped by readdir() call, which results in mails getting temporarily lost. This is why some software supporting Maildir, such as Dovecot, uses its own non-standard locking with Maildir.
Maildir++ is an extension to the Maildir format. In addition to the normal Maildir structure described above, Maildir++ directories contain subdirectories with names that start with a '.' (dot) that are also Maildir++ folders.
The Maildir standard can not be implemented without modification on systems running Microsoft Windows, which does not tolerate the inclusion of colons in filenames.