diff --git a/default.nix b/default.nix index ec88f7e..1304d45 100644 --- a/default.nix +++ b/default.nix @@ -492,6 +492,15 @@ in default = {}; }; + sendFromAliases = mkOption { + type = types.bool; + default = false; + description = '' + Specifies if members of an alias can send mail with the alias in the + From: header. + ''; + }; + forwards = mkOption { type = with types; attrsOf (either (listOf str) str); example = { diff --git a/mail-server/postfix.nix b/mail-server/postfix.nix index 5a93dc2..505fd05 100644 --- a/mail-server/postfix.nix +++ b/mail-server/postfix.nix @@ -144,7 +144,7 @@ let smtpd_sasl_security_options = "noanonymous"; smtpd_sasl_local_domain = "$myhostname"; smtpd_client_restrictions = "permit_sasl_authenticated,reject"; - smtpd_sender_login_maps = "hash:/etc/postfix/vaccounts${lib.optionalString cfg.ldap.enable ",ldap:${ldapSenderLoginMapFile}"}${lib.optionalString (regex_valiases_postfix != {}) ",pcre:/etc/postfix/regex_vaccounts"}"; + smtpd_sender_login_maps = "hash:/etc/postfix/vaccounts${lib.optionalString cfg.ldap.enable ",ldap:${ldapSenderLoginMapFile}"}${lib.optionalString cfg.sendFromAliases ",$virtual_alias_maps"}${lib.optionalString (regex_valiases_postfix != {}) ",pcre:/etc/postfix/regex_vaccounts"}"; smtpd_sender_restrictions = "reject_sender_login_mismatch"; smtpd_recipient_restrictions = "reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject"; cleanup_service_name = "submission-header-cleanup";