I seem to be having a problem with Discourse sending emails over SMTP.
I have verified my hostname with my Email Service Provider and have successfully sent emails with Telnet and via sendmail via the host VM as well as via Telnet within the Discourse Docker container.
I had a look at integrating ‘sendmail’ within the Docker container and received a ‘host name could not be resolved’ error when emailing directly from the CLI.
To me this means that there are no issues with communication between the VM and the SMTP service provider.
I have tried all the usual SMTP ports and I believe that the configuration in the app.yml file is correct. The VM is Linux 20.04, 24.04 and 22.04 have been used in tests also.
Check your email service provider’s limits. Sometimes the sending fails when the quota is reached. Try sending an e-mail from Outlook. It happened to me once. Your problem may be different, but it may still be useful to someone.
Thanks for the responses. I has a look over the weekend. I created a VM on Digital Ocean and set up SMTP with Brevo. Everything was okay.
So nothing wrong with Discourse.
I figure Discourse uses a Ruby GEM such as NET::smtp to mail and that by default there is no smtp server installed within the container. The issue we are facing is on an Azure tenant.
To me it feels like the request to the external SMTP service i.e. being blocked somewhere. By some kind of anti-SPAM mechanism sitting on top of the tenant.
I have a few more tests to carry out to narrow this down.
Any info on how Discourse facilitates email sending would be great I am a bit of a newcomer to Ruby on the Rails.