1

I want to use mailcow as an isolated mail server, so it's not supposed to send mails to the outside. The goal is to allow open registration on the mail server, and users should be able to communicate with each other - but I don't want to annoy the rest of the world with spam bots which might register there, so blocking any outgoing mails to other servers is necessary.

Incoming mails are fine, but if there is a way to block that too, why not.

It is suprisingly hard to turn off federation with email; with postfix, I didn't find an easy way to do it (maybe with smtpd_relay_restrictions? It has some weird interactions with smtpd_recipient_restrictions and I don't really understand its behavior). mailcow is running postfix in a docker container, so a postfix solution might work, too. But as mailcow is simplifying many things about the postfix configuration, I wonder whether there is a better way.

My current solution? In the "Address Rewriting" tab, I added recipient maps for a few hundred mail servers. These maps deliver all outgoing mails to noreply@my.domain.tld, instead of the servers where they were supposed to go. A bot auto-replies from noreply@my.domain.tld that sending outgoing messages is not permitted. It works, but it's a bit ugly - having a clear SMTP error instead would be much nicer.

(Bonus points: is there a way to configure this for one mailcow domain, but not for others?)

missytake
  • 11
  • 1

0 Answers0