/* Copyright (c) 2003-2018 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "mail-storage.h"
#include "mail-search-build.h"
#include "imap-expunge.h"
unsigned int *expunged_count)
{
struct mailbox_transaction_context *t;
if (mailbox_is_readonly(box)) {
/* silently ignore */
return 0;
}
/* Refresh the flags so we'll expunge all messages marked as \Deleted
by any session. */
"EXPUNGE");
*expunged_count += 1;
}
if (mailbox_search_deinit(&ctx) < 0) {
return -1;
} else {
if (mailbox_transaction_commit(&t) < 0)
return -1;
}
return expunges ? 1 : 0;
}