dovecot-2.0: dsync: Don't log unnecessary errors about not being...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jan 3 14:31:38 EET 2012


details:   http://hg.dovecot.org/dovecot-2.0/rev/69c6d7436f7f
changeset: 13007:69c6d7436f7f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jan 03 14:32:08 2012 +0200
description:
dsync: Don't log unnecessary errors about not being able to delete \Noselect mailbox dirs.

diffstat:

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

diffs (31 lines):

diff -r d06061408f6d -r 69c6d7436f7f src/dsync/dsync-worker-local.c
--- a/src/dsync/dsync-worker-local.c	Tue Jan 03 13:13:03 2012 +0200
+++ b/src/dsync/dsync-worker-local.c	Tue Jan 03 14:32:08 2012 +0200
@@ -1323,15 +1323,24 @@
 		(struct local_dsync_worker *)_worker;
 	struct mail_namespace *ns;
 	const char *storage_name;
+	enum mail_error error;
 
 	storage_name = dsync_box->name;
 	ns = mail_namespace_find(worker->user->namespaces, &storage_name);
 
 	mailbox_list_set_changelog_timestamp(ns->list, dsync_box->last_change);
 	if (mailbox_list_delete_dir(ns->list, storage_name) < 0) {
-		i_error("Can't delete mailbox directory %s: %s",
-			dsync_box->name,
-			mailbox_list_get_last_error(ns->list, NULL));
+		(void)mailbox_list_get_last_error(ns->list, &error);
+		if (error == MAIL_ERROR_EXISTS) {
+			/* we're probably doing Maildir++ -> FS layout sync,
+			   where a nonexistent Maildir++ mailbox had to be
+			   created as \Noselect FS directory.
+			   just ignore this. */
+		} else {
+			i_error("Can't delete mailbox directory %s: %s",
+				dsync_box->name,
+				mailbox_list_get_last_error(ns->list, NULL));
+		}
 	}
 	mailbox_list_set_changelog_timestamp(ns->list, (time_t)-1);
 }


More information about the dovecot-cvs mailing list