<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hello,<br/> <br/> 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.<br/> <br/> First it will list the empty Directory as Mailbox:<br/> doveadm mailbox list -u user | grep ^Trash<br/> Trash/sent-mail-archiv<br/> <br/> ls -l /var/spool/mail/user/mailboxes/Trash/sent-mail-archiv/<br/> total 0<br/> <br/> Buf if i try to delete it or list messages it failed:<br/> doveadm expunge -u "$u" $delete mailbox "$mbx" savedbefore "${day}d"<br/> doveadm(user): Error: Syncing mailbox 'Trash/sent-mail-archiv' failed: Mailbox doesn't exist: Trash/sent-mail-archiv<br/> Exit Code: 68<br/> <br/> <br/> doveadm search -u user mailbox Trash/sent-mail-archiv<br/> doveadm(user): Error: Couldn't get mailbox 'Trash/sent-mail-archiv' GUID: Mailbox doesn't exist: Trash/sent-mail-archiv<br/> <br/> All normal mailbox under 'sent-mail-archiv' was deleted as expected.</div></div></body></html>
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>i tried to workaround for this with</div> <div> </div> <div>@@ -58,6 +59,13 @@<br/> if [ $exit_code -ne 0 -a $exit_code -ne 130 ]; then<br/> echo "Unexpected error: doveadm expunge '$u'"<br/> echo "Exit Code: $exit_code"<br/> + if [ $exit_code -eq 68 ]; then<br/> + if ! [ "$(ls -A /var/spool/mail/${u}/mailboxes/${mbx})" ]; then<br/> + rmdir "/var/spool/mail/${u}/mailboxes/${mbx}"<br/> + else<br/> + echo "Error: Expected directory is empty!"<br/> + fi<br/> + fi<br/> rc=1<br/> fi<br/> done</div> <div> </div> <div>but this empty directory is also replicated and would be recreated.</div> </div></div></body></html>