[Dovecot] Non-blocking file_dotlock_open() in quota-maildir question

Timo Sirainen tss at iki.fi
Wed Jul 10 09:37:26 EEST 2013

On Mon, 2013-07-08 at 22:42 +0400, do1 at yandex.ru wrote:
> Hello,
> Is it safe to change lines in plugins/quota/quota-maildir.c::maildirsize_write() from
>   fd = file_dotlock_open_group(.., DOTLOCK_CREATE_FLAG_NONBLOCK, ..);
> to
>   fd = file_dotlock_open_group(.., 0, ..); ?
> Rationale is: exim+cpanel frequently leave stale maldirsize.lock, but when quota plugin try to dotlock maildirsize, it do this with NONBLOCK flag and just once, so first lock fails with EAGAIN and second may never happen. (When last mail is over quota this also prevent user from further receiving any mail because quota remain exceeded, forver. This is annoing problem.) I wonder if it is possible to do easy fix problem by removing NONBLOCK flag, but as I don't understand why this NONBLOCK flag is used in the first place I decided to ask developers in the list for approval.

Here's a better fix: http://hg.dovecot.org/dovecot-2.2/rev/24d6708cea76

More information about the dovecot mailing list