Some notes regarding Mailcow Dockerized
Some time ago, I started investigating several self-hosted mail solutions.
I recently settled on using https://mailcow.email/
Because I am doing this on a couple of Proxmox machines at home, port 25 is blocked by my ISP, so I swiched to using a smarthost for relay
This showed a couple of interesting things
1. The mailcow unbound server does not follow /etc/resolv.conf, it needs to be manually configured if you are also hosting internal zones
Solution: Edit the file data/conf/unbound/unbound.conf and add entries per self-hosted zone:
- data/conf/unbound/unbound.conf
forward-zone: name: "internal.home.arpa" forward-addr: 10.10.53.1
Obviously, change the values to match your settings
2. Because I am using a smarthost, emails coming from inside the LAN would go out to the smarthost and then get back in again, wasteful
Solution: Edit the file data/conf/postfix/custom_transport.pcre and add entries per self-hosted domain:
- data/conf/postfix/custom_transport.pcre
/domain-2.arpa$/ : /domain-2.arpa$/ : /domain-3.arpa$/ :
This is a regex filter, so the slash and the dollar-sign+slash at the end are needed
You can also add a value, something like this:
/domain-4.arpa$/ : [smtp] smart-host-something.com
But that can be done from the Mailcow admin GUI.
Good luck