From 10b577c650f41201b7b5991bb9947d3652bec997 Mon Sep 17 00:00:00 2001 From: isabel Date: Thu, 16 Apr 2026 01:04:07 +0100 Subject: [PATCH] dovecot: fix quota users assertion --- mail-server/dovecot.nix | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix index 2f83a86..dc729b0 100644 --- a/mail-server/dovecot.nix +++ b/mail-server/dovecot.nix @@ -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 - ); - in - !cfg.quota.enable -> usersWithQuota == { }; - message = '' - Without quota support enabled, per-user quotas cannot be applied to the following accounts: + ( + let + usersWithQuota = attrNames ( + filterAttrs (_: account: account.quota != null) config.mailserver.accounts + ); + in + { + 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`. - ''; - } + Either remove per user quota settings or re-enable `mailserver.quota.enable`. + ''; + } + ) ]; warnings =