# HG changeset patch # User Timo Sirainen # Date 1193506655 -10800 # Node ID 427eeded8078c978c00a75268a891148af9b208d # Parent 0511e301acbc4487ec88042d751328b200d534fa Don't fail if trying to delete a nonselectable mailbox. 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 @@ 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 @@ 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);