==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Sending mail to REDACTED . .
Testing sending to callumokane123@gmail.com using support@maniabots.xyz:REDACTED@smtp.zoho.com:587.
SMTP server connection successful.
Sending to callumokane123@gmail.com. . .
Sending mail failed.
==================== DONE! ====================
And I do not get the activation email for setting up account
My guess is that your forum is called forum.maniabots.xyz and is sending from noreply@forum.maniabots.xyz and your mail server won’t do it. There is a line at the bottom of app.yml that you can change to set the address. You have to edit it by hand.
## Any custom commands to run after building
run:
- exec: echo "Beginning of custom commands"
## If you want to set the 'From' email address for your first registration, uncomment and change:
## After getting the first signup email, re-comment the line. It only needs to run once.
- exec: rails r "SiteSetting.notification_email='support@maniabots.xyz'"
- exec: echo "End of custom commands"
Hi everyone,
Did anyone find a solution to this?
I’ve setup postfix on my docker host for outgoing emails. It works fine when I send emails from ssh via the mail command, but discourse docker is failing with the same error as the OP got. I’ve used a hint from this thread: How to set SMTP config to use localhost? and thanks to that I got rid of authentication error from discourse docker (I do not provide any user/password to discourse docker to connect to my email server) , but now getting ‘sending mail failed’. Any ideas?
I had no idea that setting up an email server would be the hardest part in my discourse journey… The discourse install is just flawless and so well thought unlike any linux email server setup.
That’s why all of the installation instructions say not to try to do it. Running a mail server is very hard now.
My guess is that Discourse is using the hostname for the email address that it sends from and your mail server won’t send it. But there are dozens of things that could be wrong.,all of which are beyond the scope of the help you can get here.
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)