Merge branch 'send-from-aliases' into 'master'

Add option sendFromAliases

See merge request simple-nixos-mailserver/nixos-mailserver!353
This commit is contained in:
Jos van den Oever 2025-03-16 08:11:39 +00:00
commit a218706ea6
2 changed files with 10 additions and 1 deletions

View File

@ -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 = {

View File

@ -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";