dovecot: Don't fail if trying to delete a nonselectable mailbox.
dovecot at dovecot.org
dovecot at dovecot.org
Sat Oct 27 20:37:38 EEST 2007
details: http://hg.dovecot.org/dovecot/rev/427eeded8078
changeset: 6630:427eeded8078
user: Timo Sirainen <tss at iki.fi>
date: Sat Oct 27 20:37:35 2007 +0300
description:
Don't fail if trying to delete a nonselectable mailbox.
diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
src/plugins/quota/quota-storage.c | 11 +++++++++--
diffs (28 lines):
diff -r 0511e301acbc -r 427eeded8078 src/plugins/quota/quota-storage.c
--- a/src/plugins/quota/quota-storage.c Sat Oct 27 20:30:04 2007 +0300
+++ b/src/plugins/quota/quota-storage.c Sat Oct 27 20:37:35 2007 +0300
@@ -391,6 +391,7 @@ quota_mailbox_list_delete(struct mailbox
struct quota_transaction_context *qt;
struct mail *mail;
struct mail_search_arg search_arg;
+ enum mail_error error;
int ret;
/* This is a bit annoying to handle. We'll have to open the mailbox
@@ -399,8 +400,14 @@ quota_mailbox_list_delete(struct mailbox
calculations by adding/removing mails while we're doing this. */
box = mailbox_open(qlist->storage, name, NULL, MAILBOX_OPEN_FAST |
MAILBOX_OPEN_KEEP_RECENT | MAILBOX_OPEN_KEEP_LOCKED);
- if (box == NULL)
- return -1;
+ if (box == NULL) {
+ (void)mail_storage_get_last_error(qlist->storage, &error);
+ if (error != MAIL_ERROR_NOTPOSSIBLE)
+ return -1;
+
+ /* mailbox isn't selectable */
+ return qlist->module_ctx.super.delete_mailbox(list, name);
+ }
if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ, 0, NULL) < 0) {
mailbox_close(&box);
More information about the dovecot-cvs
mailing list