@@ -210,10 +210,11 @@ int mailbox_list_create(const char *driver, struct mail_namespace *ns,
210210 }
211211
212212 e_debug (ns -> user -> event ,
213- "%s: root=%s, index=%s, indexpvt=%s, control=%s, inbox=%s, alt=%s" ,
213+ "%s: root=%s, index=%s, fts_index=%s, indexpvt=%s, control=%s, inbox=%s, alt=%s" ,
214214 list -> name ,
215215 list -> set .root_dir == NULL ? "" : list -> set .root_dir ,
216216 list -> set .index_dir == NULL ? "" : list -> set .index_dir ,
217+ list -> set .fts_index_dir == NULL ? "" : list -> set .fts_index_dir ,
217218 list -> set .index_pvt_dir == NULL ? "" : list -> set .index_pvt_dir ,
218219 list -> set .control_dir == NULL ?
219220 "" : list -> set .control_dir ,
@@ -333,6 +334,8 @@ mailbox_list_settings_parse_full(struct mail_user *user, const char *data,
333334 dest = & set_r -> inbox_path ;
334335 else if (strcmp (key , "INDEX" ) == 0 )
335336 dest = & set_r -> index_dir ;
337+ else if (strcmp (key , "FTS_INDEX" ) == 0 )
338+ dest = & set_r -> fts_index_dir ;
336339 else if (strcmp (key , "INDEXPVT" ) == 0 )
337340 dest = & set_r -> index_pvt_dir ;
338341 else if (strcmp (key , "INDEXCACHE" ) == 0 )
@@ -1485,6 +1488,22 @@ bool mailbox_list_set_get_root_path(const struct mailbox_list_settings *set,
14851488 path = set -> root_dir ;
14861489 }
14871490 break ;
1491+ case MAILBOX_LIST_PATH_TYPE_FTS_INDEX :
1492+ if (set -> fts_index_dir != NULL ) {
1493+ if (set -> fts_index_dir [0 ] == '\0' ) {
1494+ /* in-memory indexes */
1495+ return 0 ;
1496+ }
1497+ path = set -> fts_index_dir ;
1498+
1499+ /* Preserve the old behavior of using the index directory if
1500+ * fts_index_dir is not set. */
1501+ } else if (set -> index_dir != NULL ) {
1502+ path = set -> index_dir ;
1503+ } else {
1504+ path = set -> root_dir ;
1505+ }
1506+ break ;
14881507 case MAILBOX_LIST_PATH_TYPE_INDEX_PRIVATE :
14891508 path = set -> index_pvt_dir ;
14901509 break ;
0 commit comments