Hello,
before migrating to dovecot we used local mbox mail storage. The mail client creates only empty directory instead of mailbox. Now if a User deletes a Mailbox that is only an empty Directory doveadm sometimes failed.
First it will list the empty Directory as Mailbox:
doveadm mailbox list -u user | grep ^Trash
Trash/sent-mail-archiv
ls -l /var/spool/mail/user/mailboxes/Trash/sent-mail-archiv/
total 0
Buf if i try to delete it or list messages it failed:
doveadm expunge -u "$u" $delete mailbox "$mbx" savedbefore "${day}d"
doveadm(user): Error: Syncing mailbox 'Trash/sent-mail-archiv' failed: Mailbox doesn't exist: Trash/sent-mail-archiv
Exit Code: 68
doveadm search -u user mailbox Trash/sent-mail-archiv
doveadm(user): Error: Couldn't get mailbox 'Trash/sent-mail-archiv' GUID: Mailbox doesn't exist: Trash/sent-mail-archiv
All normal mailbox under 'sent-mail-archiv' was deleted as expected.