2023-05-20 09:52:25 +02: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 17:31:28 +02:00
|
|
|
] ++ lib.optionals (config.mailserver.enable && config.mailserver.certificateScheme != "acme") [
|
2023-06-28 21:42:37 +02: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 09:52:25 +02:00
|
|
|
];
|
|
|
|
}
|