mail-server/dovecot: check if quota is non-null instead of string

This check will avoid silently dropping the quota setting when set to
a non-string value, and instead yield an evaluation error when e.g.,
setting it to a number or other type.

Suggested-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Leon Schuermann 2025-02-02 09:44:47 -05:00
parent 6b425d13f5
commit daa141ef05

View File

@ -125,7 +125,7 @@ let
cat <<EOF > ${userdbFile}
${lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value:
"${name}:::::::"
+ (if lib.isString value.quota
+ (if value.quota != null
then "userdb_quota_rule=*:storage=${value.quota}"
else "")
) cfg.loginAccounts)}