]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mbox: Moved .subscriptions back to control_dir/ root instead of control_dir/.imap/
authorTimo Sirainen <tss@iki.fi>
Wed, 20 Mar 2013 19:04:29 +0000 (21:04 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 20 Mar 2013 19:04:29 +0000 (21:04 +0200)
src/lib-storage/index/mbox/mbox-storage.c
src/lib-storage/list/mailbox-list-subscriptions.c

index 955c71ffaf669ad0b6bcd2817240b35afb06e957..1218a307b0d09aea75e622495b3603660f640f7e 100644 (file)
@@ -100,6 +100,14 @@ mbox_list_get_path(struct mailbox_list *list, const char *name,
 
        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;
index 166b310014bc3c95a939189bd43ebb9b31398b63..b32c07d968280ea6ddde7e82890adeb2b08ba76d 100644 (file)
@@ -110,6 +110,7 @@ int mailbox_list_subscriptions_refresh(struct mailbox_list *src_list,
 {
        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 @@ int mailbox_list_subscriptions_refresh(struct mailbox_list *src_list,
                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) {