This fixes copying messages with keywords to a virtual mailbox, where
syncing happened too late and caused assert-crash (status was only used to
lookup list of keywords).
The crash could have been solved another way too, but it's probably better
if automatic syncing isn't always performed. doveadm index -n parameter
handling also relies on this behavior.
if (!box->opened) {
if (mailbox_open(box) < 0)
return -1;
- }
- if (!box->synced) {
if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FAST) < 0)
return -1;
}
do forced CLOSE. */
bool mailbox_is_inconsistent(struct mailbox *box);
-/* Gets the mailbox status information, opening the mailbox if necessary. */
+/* Gets the mailbox status information. If mailbox isn't opened yet, try to
+ return the results from mailbox list indexes. Otherwise the mailbox is
+ opened and synced. If the mailbox is already opened, no syncing is done
+ automatically. */
int mailbox_get_status(struct mailbox *box, enum mailbox_status_items items,
struct mailbox_status *status_r);
/* Gets the mailbox status, requires that mailbox is already opened. */