From 4dcd114a2f27ea9f7071bb8d8fb903e2a31ed121 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 24 May 2026 03:48:25 +0200 Subject: [PATCH] dovecot: restore default mail_index_path Back in 2.3 the index was by default kept in the maildir. This is also the default in 2.4, but during the migration I put the dovecot home dir as the default index path, which is a breaking change and could cause client resyncs. Fixes: #359 --- mail-server/dovecot.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix index dc51c61..b420b0d 100644 --- a/mail-server/dovecot.nix +++ b/mail-server/dovecot.nix @@ -398,9 +398,7 @@ in fields = { home = "${cfg.storage.path}/%{user | domain}/%{user | username}"; inherit (cfg.storage) uid gid; - mail_index_path = "${ - if cfg.indexDir != null then cfg.indexDir else cfg.storage.path - }/%{user | domain }/%{user | username}"; + mail_index_path = mkIf (cfg.indexDir != null) "${cfg.indexDir}/%{user | domain}/%{user | username}"; }; }; "passdb declarative" = { @@ -428,9 +426,9 @@ in fields = { home = "${cfg.storage.path}/ldap/%{ldap:${cfg.ldap.attributes.uuid}}"; inherit (cfg.storage) uid gid; - mail_index_path = "${ - if cfg.indexDir != null then cfg.indexDir else cfg.storage.path - }/ldap/%{ldap:${cfg.ldap.attributes.uuid}}"; + mail_index_path = mkIf ( + cfg.indexDir != null + ) "${cfg.indexDir}/ldap/%{ldap:${cfg.ldap.attributes.uuid}}"; }; ldap_connection_group = "ldap-userdb-conn"; };