mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
postfix: discard all messages to nine.testrun.org
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from pyinfra.operations import apt, files, systemd
|
||||
from pyinfra.operations import apt, files, systemd, server
|
||||
|
||||
from cmdeploy.basedeploy import Deployer, get_resource
|
||||
|
||||
@@ -52,6 +52,19 @@ class PostfixDeployer(Deployer):
|
||||
)
|
||||
need_restart |= header_cleanup.changed
|
||||
|
||||
# Transport map that discards messages to nine.testrun.org
|
||||
transport_map = files.put(
|
||||
src=get_resource("postfix/discard-nine.map"),
|
||||
dest="/etc/postfix/discard-nine.map",
|
||||
user="root",
|
||||
group="root",
|
||||
mode="644",
|
||||
)
|
||||
need_restart |= transport_map.changed
|
||||
if transport_map.changed:
|
||||
server.shell(
|
||||
commands=["postmap /etc/postfix/discard-nine.map"],
|
||||
)
|
||||
# Login map that 1:1 maps email address to login.
|
||||
login_map = files.put(
|
||||
src=get_resource("postfix/login_map"),
|
||||
|
||||
2
cmdeploy/src/cmdeploy/postfix/discard-nine.map
Normal file
2
cmdeploy/src/cmdeploy/postfix/discard-nine.map
Normal file
@@ -0,0 +1,2 @@
|
||||
nine.testrun.org discard:
|
||||
* :
|
||||
@@ -82,6 +82,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/discard-nine.map
|
||||
|
||||
# 1:1 map MAIL FROM to SASL login name.
|
||||
smtpd_sender_login_maps = regexp:/etc/postfix/login_map
|
||||
|
||||
|
||||
Reference in New Issue
Block a user