aboutsummaryrefslogtreecommitdiff
path: root/lib/open.cc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-12-31 18:20:31 -0400
committerDavid Bremner <david@tethera.net>2021-03-20 07:39:12 -0300
commite823d05ae6dc920d4fc9abf774c3d2575d891d7b (patch)
treea66d028308be1a14a3b6f5fcae9feaa12cc3aede /lib/open.cc
parent986056bdbcfea642a2d08f7ee257f7aaaed433b9 (diff)
lib: support splitting mail from database location.
Introduce a new configuration value for the mail root, and use it to locate mail messages in preference to the database.path (which previously implied the mail messages were also in this location. Initially only a subset of the CLI is tested in a split configuration. Further changes will be needed for the remainder of the CLI to work in split configurations.
Diffstat (limited to 'lib/open.cc')
-rw-r--r--lib/open.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/open.cc b/lib/open.cc
index 3bb3e103..8fc17caf 100644
--- a/lib/open.cc
+++ b/lib/open.cc
@@ -263,6 +263,11 @@ _choose_xapian_path (void *ctx, const char *database_path, const char **xapian_p
if (status)
goto DONE;
+ trial_path = talloc_asprintf (ctx, "%s/xapian", database_path);
+ status = _trial_open (trial_path, message_ptr);
+ if (status != NOTMUCH_STATUS_PATH_ERROR)
+ goto DONE;
+
notmuch_path = talloc_asprintf (ctx, "%s/.notmuch", database_path);
status = _db_dir_exists (notmuch_path, message_ptr);
if (status)