Servidor SMTP conecta, envio de e-mail falha

For those people seeking solution to this - I’ve solved it - this post was crucial here: https://forum.level1techs.com/t/how-to-get-discourse-to-work-with-postfix/100042/11

The problem was that Discourse was unable to connect to my postfix server from docker. Technically the connection comes from another network and postfix did not have this network on the list of allowed networks. It’s enough to add docker network (in my case 172.17.0.0/16) to mynetworks in postfix config and then it works!
You first need to check if docker can connect to your postfix in the first place (I mean if the connection can be made before the allowed network check is executed in postfix). Remember to check postfix’s config in inet_interfaces. I assigned all because localhost won’t work for Discourse in docker.
If it still doesn’t work - please check postfix logs. In my case they are in /var/log/mail.log file.

Hope this will help somebody in the future. It took me long days to get it up and running, but now I finally don’t rely on any paid mailing service (I even wanted to, but I couldn’t make it work) and have it for free (remember to add SPF records to your domain! as otherwise Gmail and other mail providers will block your emails - they won’t even go to SPAM, but will be undelivered)

3 curtidas