2023-05-20 12:52:25 +05:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
|
|
assertions = lib.optionals config.mailserver.ldap.enable [
|
|
|
|
{
|
|
|
|
assertion = config.mailserver.loginAccounts == {};
|
|
|
|
message = "When the LDAP support is enable (mailserver.ldap.enable = true), it is not possible to define mailserver.loginAccounts";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
assertion = config.mailserver.extraVirtualAliases == {};
|
|
|
|
message = "When the LDAP support is enable (mailserver.ldap.enable = true), it is not possible to define mailserver.extraVirtualAliases";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
assertion = config.mailserver.forwards == {};
|
|
|
|
message = "When the LDAP support is enable (mailserver.ldap.enable = true), it is not possible to define mailserver.forwards";
|
|
|
|
}
|
2024-06-04 20:31:28 +05:00
|
|
|
] ++ lib.optionals (config.mailserver.enable && config.mailserver.certificateScheme != "acme") [
|
2023-06-29 00:42:37 +05:00
|
|
|
{
|
|
|
|
assertion = config.mailserver.acmeCertificateName == config.mailserver.fqdn;
|
|
|
|
message = "When the certificate scheme is not 'acme' (mailserver.certificateScheme != \"acme\"), it is not possible to define mailserver.acmeCertificateName";
|
|
|
|
}
|
2023-05-20 12:52:25 +05:00
|
|
|
];
|
|
|
|
}
|