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

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 12 16:31:00 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/74e945315e2c
changeset: 13455:74e945315e2c
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 12 16:30:51 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 ddb5c2a8f3d2 -r 74e945315e2c src/dsync/dsync-worker-local.c
--- a/src/dsync/dsync-worker-local.c	Mon Sep 12 16:23:21 2011 +0300
+++ b/src/dsync/dsync-worker-local.c	Mon Sep 12 16:30:51 2011 +0300
@@ -527,6 +527,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;
 
@@ -564,8 +565,17 @@
 	if (mailbox_get_status(box, status_items, &status) < 0 ||
 	    mailbox_get_metadata(box, metadata_items, &metadata) < 0) {
 		i_error("Failed to sync mailbox %s: %s", info->name,
-			mailbox_get_last_error(box, NULL));
+			mailbox_get_last_error(box, &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