Mark them corrupted only when after a reconnection the initial mailbox sync
doesn't work.
mbox->box.name, t_strdup_vprintf(reason, va));
va_end(va);
- mail_index_mark_corrupted(mbox->box.index);
+ if (!mbox->initial_sync_done) {
+ /* we failed during initial sync. need to rebuild indexes if
+ we want to get this fixed */
+ mail_index_mark_corrupted(mbox->box.index);
+ } else {
+ /* maybe the remote server is buggy and has become confused.
+ try reconnecting. */
+ }
imapc_client_mailbox_disconnect(mbox->client_box);
}