Add configuration option to alias entire domains and respective tests

This commit is contained in:
Thomas Preisner 2024-12-28 00:40:32 +01:00
parent 92d0a6e1f8
commit 5f49caec49
3 changed files with 71 additions and 2 deletions

View file

@ -127,6 +127,22 @@ in {
default = {};
};
virtualDomainAliases = lib.mkOption {
type = with lib.types; attrsOf str;
example = {
"aliasdomain.com" = "domain.com";
};
description = ''
Virtual aliasing of domains. A virtual alias `"aliasdomain.com" = "domain.com"`
means that all mail directed at `@aliasdomain.com` are forwarded to `@domain.com`.
This also entails, that any account or alias of `domain.com` is partially valid
for `aliasdomain.com`. For example, `user@domain.com` can receive mails at
`user@aliasdomain.com`. However, if `user@domain.com` shall be able to dispatch
mails using `user@aliasdomain.com`, an explicit alias needs to be configured.
'';
default = {};
};
extraVirtualAliases = lib.mkOption {
type = let
account = lib.mkOptionType {