Add missing login map

This commit is contained in:
link2xt
2024-01-25 22:00:36 +00:00
parent ea36e73b8e
commit 6d6217812d
3 changed files with 16 additions and 0 deletions

View File

@@ -301,6 +301,18 @@ def _configure_postfix(config: Config, debug: bool = False) -> bool:
)
need_restart |= header_cleanup.changed
# Login map that 1:1 maps email address to login.
login_map = files.put(
src=importlib.resources.files(__package__).joinpath(
"postfix/login_map"
),
dest="/etc/postfix/login_map",
user="root",
group="root",
mode="644",
)
need_restart |= login_map.changed
return need_restart

View File

@@ -0,0 +1 @@
/^(.*)$/ ${1}

View File

@@ -49,3 +49,6 @@ virtual_mailbox_domains = {{ config.mail_domain }}
mua_client_restrictions = permit_sasl_authenticated, reject
mua_sender_restrictions = reject_sender_login_mismatch, permit_sasl_authenticated, reject
mua_helo_restrictions = permit_mynetworks, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, permit
# 1:1 map MAIL FROM to SASL login name.
smtpd_sender_login_maps = regexp:/etc/postfix/login_map