lazy expunge folder delete bug

Jan-Pieter Cornet johnpc at
Tue Aug 21 17:17:27 EEST 2018

Answering my own post...

On 22-6-18 16:52, Jan-Pieter Cornet wrote:
> There's a bug in "folder delete" for lazy expunge, type "1 namespace", as descibed on
> When trying to delete a mailbox that still has messages in it, but that has no EXPUNGED/<name> counterpart, the process hangs after the imap "DELETE" command, and the following appears in the log file after a 60s timeout:
> Jun 22 15:48:15 userimap6 dovecot: imap(xtra30): Error: Couldn't create mailbox list lock /var/mail/.8d1/index/4/03/xtra30/index/mailboxes.lock: file_create_locked(/var/mail/.8d1/index/4/03/xtra30/index/mailboxes.lock) failed: flock(/var/mail/.8d1/index/4/03/xtra30/index/mailboxes.lock, write-lock) failed: Timed out after 60 seconds (BUG: lock is held by our own process)
[...detailed example deleted...]
> Seems the delete operation locks the mailbox list, and then the expunge create hits the same lock. Is this something we can fix by changing settings? Eg use another location for the expunge lock?

Yes, that is indeed the solution.

I now set the VOLATILEDIR in the Expunged namespace to another directory, and it's no longer a problem to delete an entire folder that still contains mails.

The full setting of the location for the Expunged namespace is now:

location = mdbox:$home/:INDEX=$index/:MAILBOXDIR=expunged:LISTINDEX=expunged.list.index:SUBSCRIPTIONS=expunged.subscriptions:VOLATILEDIR=$index/expunged-volatile

(The variables $home and $index are expanded by the userdb before it returns this setting to dovecot).

Jan-Pieter Cornet <johnpc at>
Systeembeheer XS4ALL Internet bv

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the dovecot mailing list