Add sender/login maps for aliases

This commit is contained in:
niten 2023-10-13 17:42:43 -07:00
parent 7f6c999829
commit a17608509a
1 changed files with 11 additions and 2 deletions

View File

@ -319,8 +319,17 @@ in {
(mkRejectList cfg.blacklist.recipients);
virtual_mailbox_map = writeEntries "virtual_mailbox_map"
(map (domain: "@${domain} OK") allDomains);
sender_login_map = writeEntries "sender_login_maps"
(map (domain: "/^(.*)@${escapeDot domain}$/ \${1}") allDomains);
sender_login_map = let
defaultMaps =
map (domain: "/^(.*)@${escapeDot domain}$/ \${1}") allDomains;
userAliasMaps = concatMapAttrsToList (username: userAliases:
map (alias: "/^${escapeDot alias}$/ ${username}"))
cfg.aliases.user-aliases;
aliasUserMaps = mapAttrsToList (alias: users:
"/^${escapeDot alias}$/ ${concatStringsSep "," users}")
cfg.aliases.alias-users;
in writeEntries "sender_login_maps"
(defaultMaps ++ userAliasMaps ++ aliasUserMaps);
};
networks = cfg.trusted-networks;