From 4f3d21f386092fb4173cb1789bcbf2cec57b1142 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 24 Mar 2026 01:11:09 +0100 Subject: [PATCH 1/2] dovecot: fix storage basedir regression in ldap home During the rewrite of the LDAP userdb field lookups the default path for the mail storage directory accidentally leaked into the home directory path. --- mail-server/dovecot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix index 124ecf6..9c89c4e 100644 --- a/mail-server/dovecot.nix +++ b/mail-server/dovecot.nix @@ -79,7 +79,7 @@ let scope = ${mkLdapSearchScope cfg.ldap.scope} user_attrs = \ ${ldapUuidAttribute}=${ldapUuidAttribute}, \ - =home=/var/vmail/ldap/%{ldap:${ldapUuidAttribute}}, \ + =home=${cfg.mailDirectory}/ldap/%{ldap:${ldapUuidAttribute}}, \ =mail=maildir:~/mail${maildirLayoutAppendix}${maildirUTF8FolderNames}${ lib.optionalString (cfg.indexDir != null) ":INDEX=${cfg.indexDir}/ldap/%{ldap:${ldapUuidAttribute}}" } From 854cb3ad3a391fde06ff26eca28c481817bdb278 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 24 Mar 2026 01:23:42 +0100 Subject: [PATCH 2/2] tests: add regression test for custom ldap storage path By setting a custom mail storage path the home dir lookups will fail and signal something is wrong. --- tests/ldap.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ldap.nix b/tests/ldap.nix index 40b1390..2999bd8 100644 --- a/tests/ldap.nix +++ b/tests/ldap.nix @@ -125,6 +125,7 @@ in fqdn = "mail.example.com"; domains = [ "example.com" ]; localDnsResolver = false; + mailDirectory = "/var/lib/dovecot/vmail"; indexDir = "/var/lib/dovecot/indices"; aliases = {