]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: If mailbox can't be opened, log an error but continue anyway.
authorTimo Sirainen <tss@iki.fi>
Mon, 12 Sep 2011 13:32:20 +0000 (16:32 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 12 Sep 2011 13:32:20 +0000 (16:32 +0300)
src/dsync/dsync-worker-local.c

index b168e57f7642999f340f35d74026ea839936dced..995759b7b94df3ae70d41a809029473991837ac2 100644 (file)
@@ -521,6 +521,7 @@ local_worker_mailbox_iter_next(struct dsync_worker_mailbox_iter *_iter,
        struct local_dsync_mailbox_change *change;
        struct local_dsync_dir_change *dir_change, change_lookup;
        struct local_dsync_mailbox *old_lbox;
+       enum mail_error error;
        const char *const *fields;
        unsigned int i, field_count;
 
@@ -560,8 +561,17 @@ local_worker_mailbox_iter_next(struct dsync_worker_mailbox_iter *_iter,
                struct mail_storage *storage = mailbox_get_storage(box);
 
                i_error("Failed to sync mailbox %s: %s", info->name,
-                       mail_storage_get_last_error(storage, NULL));
+                       mail_storage_get_last_error(storage, &error));
                mailbox_free(&box);
+               if (error == MAIL_ERROR_NOTFOUND ||
+                   error == MAIL_ERROR_NOTPOSSIBLE) {
+                       /* Mailbox isn't selectable, try the next one. We
+                          should have already caught \Noselect mailboxes, but
+                          check them anyway here. The NOTPOSSIBLE check is
+                          mainly for invalid mbox files. */
+                       return local_worker_mailbox_iter_next(_iter,
+                                                             dsync_box_r);
+               }
                _iter->failed = TRUE;
                return -1;
        }