From ef11a1b065d893a0afb6460e334b4bffc7f999e5 Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Mon, 20 Apr 2026 16:36:31 +0200 Subject: [PATCH] local: add support for database.mail_root notmuch config option This option was introduced in 0.32, and allows for the DB path to be decorrelated to the maildir location. See notmuch-config(1) for details. --- lieer/local.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lieer/local.py b/lieer/local.py index a9e5f79..dd29ee1 100644 --- a/lieer/local.py +++ b/lieer/local.py @@ -367,8 +367,9 @@ def load_repository(self, block=False): ## Check if we are in the notmuch db with notmuch2.Database() as db: + mail_root = db.config.get("database.mail_root", db.path) try: - self.nm_relative = str(Path(self.md).relative_to(db.path)) + self.nm_relative = str(Path(self.md).relative_to(mail_root)) except ValueError: raise Local.RepositoryException( "local mail repository not in notmuch db"