Mercurial > dovecot > core-2.2
changeset 20487:9a844661e10c
lib-storage: Fixed mailbox_delete_empty() error message when mails exist
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Fri, 01 Jul 2016 12:23:59 +0300 |
parents | 3724c1e1d47b |
children | 04cd231e8e51 |
files | src/lib-storage/index/index-storage.c |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-storage.c Fri Jul 01 16:37:09 2016 +0300 +++ b/src/lib-storage/index/index-storage.c Fri Jul 01 12:23:59 2016 +0300 @@ -718,7 +718,13 @@ if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0) return -1; mailbox_get_open_status(box, STATUS_MESSAGES, &status); - if (status.messages != 0) { + if (status.messages == 0) + ; + else if (box->deleting_must_be_empty) { + mail_storage_set_error(box->storage, MAIL_ERROR_EXISTS, + "Mailbox isn't empty"); + return -1; + } else { mail_storage_set_error(box->storage, MAIL_ERROR_EXISTS, "New mails were added to mailbox during deletion"); return -1;