[Dovecot] Postfix locking equivalence?

Timo Sirainen tss at iki.fi
Sat May 17 13:23:46 EEST 2003

On Sat, 2003-05-17 at 13:03, Warren Togami wrote:
> /etc/postfix/main.cf.default:
> mailbox_delivery_lock = flock, dotlock
> Is flock equivalent to dovecot's fnctl locking?  For mbox what type of
> locking settings should I be using?  (No NFS, only local filesystem.)

Well.. flock isn't the same as fcntl. Dovecot supports flock too, so you
could set Dovecot to use that too.

Dotlock can do only exclusive mbox locking, ie. no-one else should
read/write the mbox at the time. It's the oldest locking method and
pretty much everyone uses at least that. If mail is only being appened
to mbox, it's enough alone (if everyone else uses dotlocking too).

fcntl and flock can do both exclusive and shared locks. That provides
read consistency when mails are being deleted from the middle of the
mailbox. Whenever you want to read mbox, you get a shared lock so no-one
can modify it while you're reading it, but that still allows others to
read the mbox at the same time.

It doesn't really matter if you use flock or fcntl, as long as everyone
uses the same. I think flock is more generally in client's defaults, but
I used fcntl because it's more standard and might work over NFS.

> If I understand this correctly, :0: in procmailrc would explicitly use
> dotlocks instead of "kernel-locks" as procmail calls it.  I'm not fully
> understanding all this locking stuff.

I don't know much about procmail, but if it does dotlocking it's enough.

> p.s.
> Timo, I received your test message after my prior posting attempt
> bounced.  I had this error message:

Yeah, sorry. The mail got into archives and I tried to resend it, but it
didn't seem to work :)

More information about the dovecot mailing list