bool search_args_initialized:1;
bool deleted:1;
bool notify_changes_started:1; /* if the box was opened for notify_changes */
+ bool first_sync:1; /* if this is the first sync after bbox was (re-)created */
};
ARRAY_DEFINE_TYPE(virtual_backend_box, struct virtual_backend_box *);
if (status.uidvalidity != bbox->sync_uid_validity) {
/* UID validity changed since last sync (or this is
the first sync), do a full search */
+ bbox->first_sync = TRUE;
ret = virtual_sync_backend_box_init(bbox);
} else {
/* build the initial search using the saved modseq. */
}
bbox = virtual_backend_box_lookup(ctx->mbox,
vrec->mailbox_id);
- if (bbox == NULL) {
+ if (bbox == NULL || bbox->first_sync) {
/* the entire mailbox is lost */
mail_index_expunge(ctx->trans, vseq);
continue;
i_zero(&add_rec);
bboxes = array_get(&ctx->mbox->backend_boxes, &count);
for (i = 0; i < count; i++) {
+ bboxes[i]->first_sync = FALSE; /* this is the end of the sync */
+
if (bboxes[i]->sync_seen)
continue;