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

dovecot at dovecot.org dovecot at dovecot.org
Tue Jan 3 14:42:17 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/997a2855fd74
changeset: 13884:997a2855fd74
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jan 03 14:42:51 2012 +0200
description:
dsync: Don't log unnecessary errors about not being able to delete \Noselect mailbox dirs.

diffstat:

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

diffs (31 lines):

diff -r ea9ab24972ed -r 997a2855fd74 src/doveadm/dsync/dsync-worker-local.c
--- a/src/doveadm/dsync/dsync-worker-local.c	Tue Jan 03 14:41:44 2012 +0200
+++ b/src/doveadm/dsync/dsync-worker-local.c	Tue Jan 03 14:42:51 2012 +0200
@@ -1288,15 +1288,24 @@
 		(struct local_dsync_worker *)_worker;
 	struct mail_namespace *ns;
 	const char *storage_name;
+	enum mail_error error;
 
 	ns = mail_namespace_find(worker->user->namespaces, dsync_box->name);
 	storage_name = mailbox_list_get_storage_name(ns->list, dsync_box->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