dovecot-2.1: dsync: If mailbox can't be opened, log an error but...

dovecot at dovecot.org dovecot at dovecot.org
Fri Sep 16 16:59:32 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/3c8b44bb1974
changeset: 13482:3c8b44bb1974
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 12 16:32:20 2011 +0300
description:
dsync: If mailbox can't be opened, log an error but continue anyway.

diffstat:

 src/dsync/dsync-worker-local.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r a930318a74a1 -r 3c8b44bb1974 src/dsync/dsync-worker-local.c
--- a/src/dsync/dsync-worker-local.c	Mon Sep 12 14:27:46 2011 +0300
+++ b/src/dsync/dsync-worker-local.c	Mon Sep 12 16:32:20 2011 +0300
@@ -521,6 +521,7 @@
 	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 @@
 		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;
 	}


More information about the dovecot-cvs mailing list