postfix: hardcode IP addresses of relays without DNS, drop messages to nine

This commit is contained in:
missytake
2026-01-11 23:57:27 +01:00
parent 2a07626f82
commit ee2b858661
4 changed files with 33 additions and 3 deletions

View File

@@ -60,7 +60,19 @@ class PostfixDeployer(Deployer):
mode="644",
)
need_restart |= lmtp_header_cleanup.changed
# Transport map that discards messages to nine.testrun.org
transport_map = files.put(
src=get_resource("postfix/transport"),
dest="/etc/postfix/transport",
user="root",
group="root",
mode="644",
)
need_restart |= transport_map.changed
if transport_map.changed:
server.shell(
commands=["postmap /etc/postfix/transport"],
)
# Login map that 1:1 maps email address to login.
login_map = files.put(
src=get_resource("postfix/login_map"),

View File

@@ -83,6 +83,9 @@ 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
# Discard messages to nine.testrun.org
transport_maps = hash:/etc/postfix/transport
# 1:1 map MAIL FROM to SASL login name.
smtpd_sender_login_maps = regexp:/etc/postfix/login_map

View File

@@ -0,0 +1,5 @@
no-dns.chatmail.at smtp:[77.42.80.106]
no-dns2.testrun.org smtp:[77.42.86.249]
nine.testrun.org discard:
* :