dovecot: fix quota users assertion
This commit is contained in:
@@ -173,22 +173,23 @@ in
|
|||||||
assertion = junkMailboxNumber == 1;
|
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)";
|
message = "nixos-mailserver requires exactly one dovecot mailbox with the 'special_use' flag set to '\\Junk' (${builtins.toString junkMailboxNumber} have been found)";
|
||||||
}
|
}
|
||||||
{
|
(
|
||||||
assertion =
|
|
||||||
let
|
let
|
||||||
usersWithQuota = attrNames (
|
usersWithQuota = attrNames (
|
||||||
filterAttrs (_: account: account.quota != null) config.mailserver.loginAccounts
|
filterAttrs (_: account: account.quota != null) config.mailserver.accounts
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
!cfg.quota.enable -> usersWithQuota == { };
|
{
|
||||||
|
assertion = !cfg.quota.enable -> usersWithQuota == [ ];
|
||||||
message = ''
|
message = ''
|
||||||
Without quota support enabled, per-user quotas cannot be applied to the following accounts:
|
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 =
|
warnings =
|
||||||
|
|||||||
Reference in New Issue
Block a user