Merge branch 'quotaUsers' into 'main'

dovecot: fix quota users assertion

See merge request simple-nixos-mailserver/nixos-mailserver!511
This commit is contained in:
Martin Weinelt
2026-04-16 00:23:56 +00:00
+6 -5
View File
@@ -173,22 +173,23 @@ in
assertion = junkMailboxNumber == 1;
message = "nixos-mailserver requires exactly one dovecot mailbox with the 'special_use' flag set to '\\Junk' (${builtins.toString junkMailboxNumber} have been found)";
}
{
assertion =
(
let
usersWithQuota = attrNames (
filterAttrs (_: account: account.quota != null) config.mailserver.loginAccounts
filterAttrs (_: account: account.quota != null) config.mailserver.accounts
);
in
!cfg.quota.enable -> usersWithQuota == { };
{
assertion = !cfg.quota.enable -> usersWithQuota == [ ];
message = ''
Without quota support enabled, per-user quotas cannot be applied to the following accounts:
${concatMapStringsSep "\n" (account: "- ${account}") quotaUsers}
${concatMapStringsSep "\n" (account: "- ${account}") usersWithQuota}
Either remove per user quota settings or re-enable `mailserver.quota.enable`.
'';
}
)
];
warnings =