dovecot-2.2: mbox: Moved .subscriptions back to control_dir/ roo...

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 20 21:04:47 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/9a913c803608
changeset: 16071:9a913c803608
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 20 21:04:29 2013 +0200
description:
mbox: Moved .subscriptions back to control_dir/ root instead of control_dir/.imap/

diffstat:

 src/lib-storage/index/mbox/mbox-storage.c         |  8 ++++++++
 src/lib-storage/list/mailbox-list-subscriptions.c |  7 +++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r f39c649057ea -r 9a913c803608 src/lib-storage/index/mbox/mbox-storage.c
--- a/src/lib-storage/index/mbox/mbox-storage.c	Wed Mar 20 20:56:58 2013 +0200
+++ b/src/lib-storage/index/mbox/mbox-storage.c	Wed Mar 20 21:04:29 2013 +0200
@@ -100,6 +100,14 @@
 
 	if (type == MAILBOX_LIST_PATH_TYPE_CONTROL ||
 	    type == MAILBOX_LIST_PATH_TYPE_INDEX) {
+		if (name == NULL && type == MAILBOX_LIST_PATH_TYPE_CONTROL &&
+		    list->set.control_dir != NULL) {
+			/* kind of a kludge for backwards compatibility:
+			   the subscriptions file is in the root control_dir
+			   without .imap/ suffix */
+			*path_r = path;
+			return 1;
+		}
 		if (name == NULL) {
 			*path_r = t_strconcat(path, "/"MBOX_INDEX_DIR_NAME, NULL);
 			return 1;
diff -r f39c649057ea -r 9a913c803608 src/lib-storage/list/mailbox-list-subscriptions.c
--- a/src/lib-storage/list/mailbox-list-subscriptions.c	Wed Mar 20 20:56:58 2013 +0200
+++ b/src/lib-storage/list/mailbox-list-subscriptions.c	Wed Mar 20 21:04:29 2013 +0200
@@ -110,6 +110,7 @@
 {
 	struct subsfile_list_context *subsfile_ctx;
 	struct stat st;
+	enum mailbox_list_path_type type;
 	const char *path, *name;
 	char sep;
 	int ret;
@@ -122,8 +123,10 @@
 		sep = mail_namespace_get_sep(src_list->ns);
 		dest_list->subscriptions = mailbox_tree_init(sep);
 	}
-	path = t_strconcat(src_list->set.control_dir != NULL ?
-			   src_list->set.control_dir : src_list->set.root_dir,
+
+	type = src_list->set.control_dir != NULL ?
+		MAILBOX_LIST_PATH_TYPE_CONTROL : MAILBOX_LIST_PATH_TYPE_DIR;
+	path = t_strconcat(mailbox_list_get_root_forced(src_list, type),
 			   "/", src_list->set.subscription_fname, NULL);
 	if (stat(path, &st) < 0) {
 		if (errno == ENOENT) {


More information about the dovecot-cvs mailing list