Thanks for providing that extra info. From what I can see so far, it appears that your postfix installation is working fine, as you have reported that you can send emails through it directly. However, Mattermost is unable to talk to it because it can't open the TCP connection to it, as reported by the error you posted.
According to the error message, Mattermost is trying to connect to the IP address 172.18.0.1 on port 25. Can you verify that your host system has that IP address on the "docker" network interface? And can you check that postfix is listening on that port on that IP address. I'm not familiar with OSX so I'm not sure exactly how you would check this. On Linux, you could run sudo ifconfig
to check the first and sudo netstat -plnt
for check the second - perhaps OSX is similar.
Possible issues I suspect might be the cause:
postfix is only listening on "localhost", ie. 127.0.0.1. This means that the connection to it from the local
mail
command would work fine, as that connects to it locally, but the Mattermost container cannot connect to it because it is trying to reach it on the IP address172.18.0.1
.(less likely than 1) Your docker network interface is listening on a different IP address thyan 172.18.0.1