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

@@ -3,13 +3,23 @@
With this branch, you don't need DNS at all,
just a VPS with an IPv4 address,
let's take `77.42.80.106` as an example:
let's take `77.42.80.106` as an example.
First, choose a random domain name (it doesn't need working DNS)
and create a chatmail.ini config file:
```
cmdeploy init whatever.you.want
```
Then, in `cmdeploy/src/cmdeploy/postfix/transport`,
remove the line corresponding to your relay,
and add other for relays you know.
Now you can deploy the relay to your IP address:
```
cmdeploy run --skip-dns-check --ssh-host 77.42.80.106
```
Then you can login with a `dclogin://` code like this:
Finally, you can login with a `dclogin://` code like this, with the correct "domain name" and IP address:
`dclogin:s0m3r4nd0@whatever.you.want?p=w7i8da7h8uads92ycc2rufyl&v=1&ih=77.42.80.106&sh=77.42.80.106&sp=443&ip=443&ic=3&sc=3`

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:
* :