Merge branch 'quotaUsers' into 'main'
dovecot: fix quota users assertion See merge request simple-nixos-mailserver/nixos-mailserver!511
This commit is contained in:
+15
-14
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user