From 059b50b2e729729ea00c6831124d3837c494f3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 13 Jul 2024 00:31:30 +0200 Subject: [PATCH] Allow setting userAttrs to empty string This allows overwriting the default values for user_attrs to be empty which is required when using virtual mailboxes with ldap accounts that have posixAccount attributes set. When user_attrs is empty string those are ignored then. --- default.nix | 2 +- mail-server/dovecot.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 6bd499c..45875a3 100644 --- a/default.nix +++ b/default.nix @@ -277,7 +277,7 @@ in dovecot = { userAttrs = mkOption { - type = types.str; + type = types.nullOr types.str; default = ""; description = '' LDAP attributes to be retrieved during userdb lookups. diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix index a6251fd..11f2708 100644 --- a/mail-server/dovecot.nix +++ b/mail-server/dovecot.nix @@ -76,7 +76,7 @@ let auth_bind = yes base = ${cfg.ldap.searchBase} scope = ${mkLdapSearchScope cfg.ldap.searchScope} - ${lib.optionalString (cfg.ldap.dovecot.userAttrs != "") '' + ${lib.optionalString (cfg.ldap.dovecot.userAttrs != null) '' user_attrs = ${cfg.ldap.dovecot.userAttrs} ''} user_filter = ${cfg.ldap.dovecot.userFilter}