[Dovecot] migrating from mbox to maildir

Timo Sirainen tss at iki.fi
Mon Nov 26 14:43:44 EET 2007


On Sun, 2007-11-25 at 22:56 -0600, Kyle Wheeler wrote:
> On Saturday, November 24 at 10:13 PM, quoth mouss:
> >> If for some reason you are completely stuck with 0.99.x, then yes,
> >> changing to Maildir format is pretty easy, and there are plenty of
> >> conversion scripts out there in the world. Just ask Google. Keep in mind
> >> if the real problem is some bug in Centos that prevents Dovecot from
> >> using locks, then the Maildir conversion may not help much, because
> >> Maildir (in Dovecot) uses locks as well.
> >
> >why lock?
> 
> To quote the Dovecot wiki 
> (http://wiki.dovecot.org/MailboxFormat/Maildir):
> 
>      Although maildir was designed to be lockless, Dovecot locks the
>      maildir while doing modifications to it or while looking for new
>      messages in it. This is required because otherwise Dovecot might
>      temporarily see mails incorrectly deleted, which would cause
>      trouble. Basically the problem is that if one process modifies the
>      maildir (eg. a rename() to change a message's flag), another
>      process in the middle of listing files at the same time could skip
>      a file. The skipping happens because readdir() system call doesn't
>      guarantee that all the files are returned if the directory is
>      modified between the calls to it. This problem exists with all the
>      commonly used filesystems.

OSX with HFS+ seems to be an exception actually. Also it would be
possible to use inotify to avoid skipping files.

Also Dovecot uses dotlock files, not fcntl locks, to do the maildir
locking. Originally this was both because of NFS and because new
dovecot-uidlist was written to the dovecot-uidlist.lock file and
rename()d over. This isn't done anymore, so NFS is the only reason why
dotlocks are used. I guess v2.0 could use lock_method setting to figure
out if it should use fcntl/flock instead.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20071126/3a7ac6d2/attachment.bin 


More information about the dovecot mailing list