]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: When remote IMAP server becomes confused, don't mark our indexes corrupted.
authorTimo Sirainen <tss@iki.fi>
Tue, 20 Sep 2011 13:42:58 +0000 (16:42 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 20 Sep 2011 13:42:58 +0000 (16:42 +0300)
Mark them corrupted only when after a reconnection the initial mailbox sync
doesn't work.

src/lib-storage/index/imapc/imapc-mailbox.c

index b8d56697793b3a1aadcc81b349e2369c060e870d..1f3643aae0a460e69eb7ba2c140483639f1cc04b 100644 (file)
@@ -22,7 +22,14 @@ static void imapc_mailbox_set_corrupted(struct imapc_mailbox *mbox,
                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);
 }