dovecot-2.2: lib-storage: Write dovecot.mailbox.log entries usin...

dovecot at dovecot.org dovecot at dovecot.org
Tue Feb 26 11:30:24 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/b90a89ca840f
changeset: 15971:b90a89ca840f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Feb 26 11:30:11 2013 +0200
description:
lib-storage: Write dovecot.mailbox.log entries using virtual names, not storage names.
This file is used only by dsync, and the new dsync design uses only virtual
names everywhere. This of course means that now it's not easily possible to
use different virtual names for the same user, but nobody really did that
before anyway. The only other fully working solution would be to send both
the virtual and the storage names in dsync, but that's a bit of a waste.

diffstat:

 src/lib-storage/index/index-storage.c |  13 +++++++++++--
 src/lib-storage/mailbox-list.c        |   9 ---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diffs (70 lines):

diff -r 91631438abce -r b90a89ca840f src/lib-storage/index/index-storage.c
--- a/src/lib-storage/index/index-storage.c	Tue Feb 26 10:54:09 2013 +0200
+++ b/src/lib-storage/index/index-storage.c	Tue Feb 26 11:30:11 2013 +0200
@@ -595,7 +595,7 @@
 	/* failed directory deletion, but mailbox deletion succeeded.
 	   this was probably maildir++, which internally deleted the
 	   directory as well. add changelog record about that too. */
-	mailbox_name_get_sha128(box->name, dir_sha128);
+	mailbox_name_get_sha128(box->vname, dir_sha128);
 	mailbox_list_add_change(box->list, MAILBOX_LOG_RECORD_DELETE_DIR,
 				dir_sha128);
 	return 0;
@@ -731,7 +731,7 @@
 
 	/* we'll track mailbox names, instead of GUIDs. We may be renaming a
 	   non-selectable mailbox (directory), which doesn't even have a GUID */
-	mailbox_name_get_sha128(dest->name, guid);
+	mailbox_name_get_sha128(dest->vname, guid);
 	mailbox_list_add_change(src->list, MAILBOX_LOG_RECORD_RENAME, guid);
 	return 0;
 }
@@ -828,6 +828,7 @@
 	struct mail_namespace *ns;
 	struct mailbox_list *list = box->list;
 	const char *subs_name;
+	guid_128_t guid;
 
 	if ((list->ns->flags & NAMESPACE_FLAG_SUBSCRIPTIONS) != 0)
 		subs_name = box->name;
@@ -854,6 +855,14 @@
 		mail_storage_copy_list_error(box->storage, list);
 		return -1;
 	}
+
+	/* subscriptions are about names, not about mailboxes. it's possible
+	   to have a subscription to nonexistent mailbox. renames also don't
+	   change subscriptions. so instead of using actual GUIDs, we'll use
+	   hash of the name. */
+	mailbox_name_get_sha128(box->vname, guid);
+	mailbox_list_add_change(list, set ? MAILBOX_LOG_RECORD_SUBSCRIBE :
+				MAILBOX_LOG_RECORD_UNSUBSCRIBE, guid);
 	return 0;
 }
 
diff -r 91631438abce -r b90a89ca840f src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Tue Feb 26 10:54:09 2013 +0200
+++ b/src/lib-storage/mailbox-list.c	Tue Feb 26 11:30:11 2013 +0200
@@ -1473,7 +1473,6 @@
 int mailbox_list_set_subscribed(struct mailbox_list *list,
 				const char *name, bool set)
 {
-	guid_128_t guid;
 	int ret;
 
 	/* make sure we'll refresh the file on next list */
@@ -1481,14 +1480,6 @@
 
 	if ((ret = list->v.set_subscribed(list, name, set)) <= 0)
 		return ret;
-
-	/* subscriptions are about names, not about mailboxes. it's possible
-	   to have a subscription to nonexistent mailbox. renames also don't
-	   change subscriptions. so instead of using actual GUIDs, we'll use
-	   hash of the name. */
-	mailbox_name_get_sha128(name, guid);
-	mailbox_list_add_change(list, set ? MAILBOX_LOG_RECORD_SUBSCRIBE :
-				MAILBOX_LOG_RECORD_UNSUBSCRIBE, guid);
 	return 0;
 }
 


More information about the dovecot-cvs mailing list