acinonyxjubatus is having trouble sending email with Discourse behind an nginx setup, getting a Net::ReadTimeout error when trying to send registration activation emails via SMTP. The error persists despite being able to send emails successfully using curl on the same port (465).
Stephen and pfaffman suggest that the issue might be due to the provider blocking outgoing SMTP traffic, but acinonyxjubatus is able to connect to the SMTP server via telnet on ports 25, 587, and 465.
After trying various solutions, including switching to different ports and checking the logs, acinonyxjubatus ultimately resolves the issue by switching to Mailgun with port 587.
Later, webmayak and acinonyxjubatus confirm that Mailgun works with Discourse “from scratch”. However, sidor1989 and Stranik revive the topic, with Stranik suggesting that port 587 works with Yandex, while 465 does not.
I installed discourse behind nginx according this post. Also I have SSL certificate installed by certboot
Registration activation email is not sending and when I run ./discourse-doctor on email sending step I get
Net::ReadTimeout
However, everything is OK with curl. I send message on the same port (465) and receive message.
My settings are:
I checked logs and found nothing interesting
In production.log:
Started PUT "/finish-installation/resend-email" for ip at 2018-10-01 19:22:45 +0000
Processing by FinishInstallationController#resend_email as HTML
Parameters: {"authenticity_token"=>"..."}
Rendering finish_installation/resend_email.html.erb within layouts/finish_installation
Rendered finish_installation/resend_email.html.erb within layouts/finish_installation (0.8ms)
Rendered common/_special_font_face.html.erb (0.2ms)
Rendered layouts/_head.html.erb (0.3ms)
Completed 200 OK in 23ms (Views: 2.5ms | ActiveRecord: 3.6ms)
First I’d try using port 2525 (mailgun and others accept mail at that port). If that does not work, open a ticket with digital ocean to have them remove the block from the port.
Looks like Yandex blocks and/or delays emails or maybe Discourse works good only with Mailgun. After days of struggling I gave up and switched to mailgun and letsencrypt with this settings:
@acinonyxjubatus, thanks for your reply! With Mailgun Discourse really works “from scratch”.. It solved the problem with outgoing mail for now. Thanks!