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;
{
struct subsfile_list_context *subsfile_ctx;
struct stat st;
+ enum mailbox_list_path_type type;
const char *path, *name;
char sep;
int ret;
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) {