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:
- "templates/web.socketed.template.yml"
DISCOURSE_SMTP_ADDRESS: smtp.yandex.ru
DISCOURSE_SMTP_PORT: 465
DISCOURSE_SMTP_USER_NAME: _name_
DISCOURSE_SMTP_PASSWORD: _pass_
DISCOURSE_SMTP_ENABLE_START_TLS: true
No success. Got this
======================================== ERROR ========================================
Connection to port 2525 failed.
====================================== SOLUTION =======================================
The most likely problem is that your server has outgoing SMTP traffic blocked.
If you are using a service like Mailgun or Sendgrid, try using port 2525.
update: curl also fails on 2525
Stephen
(Stephen)
30. September 2018 um 20:51
4
Are you on DigitalOcean? They are known to block outbound mail ports on new servers, particularly on new accounts.
Reach out to them to get it unblocked if so, but use 587 if possible! 465 was revoked by the IETF years ago.
Not DigitalOcean. I use other Ubuntu VPS and Yandex as smtp server.
Curl fails on 25, 2525 and 587 ports, but works on 465
Stephen
(Stephen)
30. September 2018 um 21:01
6
Either way sounds like your provider is blocking you. Definitely worth reaching out to get the restriction removed.
1 „Gefällt mir“
I am able to connect to smtp server via telnet on ports 25, 587 and 465. So, I don’t think someone blocks ports.
The Question is why am I getting ReadTimeout with Discourse while with curl I can successfully send message (on 465 port)
pfaffman
(Jay Pfaffman)
30. September 2018 um 21:42
9
Try from inside the container.
./launcher enter app
You may have docker blocked from getting outside.
1 „Gefällt mir“
Stephen
(Stephen)
30. September 2018 um 21:49
10
Or whichever host is conducting traffic inspection, which would explain why it works until you wrap it in TLS.
1 „Gefällt mir“
Tried from within docker. Successfully sent with curl
root@server-app:/var/www/discourse# curl --url 'smtps://smtp.yandex.ru:465' --ssl-reqd \
--mail-from '...' --mail-rcpt '...' \
--upload-file mail1.txt --user 'login:pass'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 167 0 0 100 167 0 166 0:00:01 0:00:01 --:--:-- 167
root@server-app:/var/www/discourse#
2 „Gefällt mir“
What else can I try to make it work?
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)
update
I manually activated account with
rake admin:create
and in sidekiq section I see this:
{"type"=>"signup", "user_id"=>1, "email_token"=>"...", "current_site_id"=>"default"} Jobs::HandledExceptionWrapper: Wrapped ArgumentError: wrong authentication type none
webmayak
(Alex Kostin)
3. März 2019 um 14:36
13
@acinonyxjubatus did you find a solution? I have the same problem with smtp.yandex.ru on DigitalOcean one-click Discourse app…
pfaffman
(Jay Pfaffman)
3. März 2019 um 19:14
14
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:
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.ssl.template.yml"
...
expose:
- "80:80" # http
- "443:443" # https
...
DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
DISCOURSE_SMTP_PORT: 587
Good luck!
2 „Gefällt mir“
webmayak
(Alex Kostin)
12. März 2019 um 03:54
16
@acinonyxjubatus , thanks for your reply! With Mailgun Discourse really works “from scratch”… It solved the problem with outgoing mail for now. Thanks!
2 „Gefällt mir“
sidor1989
(Sidor1989)
14. April 2020 um 20:56
17
Has anyone found a solution? Yandex does not work with ports 465 and 567. But does the curl work correctly.
root@server-app:/var/www/discourse# curl --url 'smtps://smtp.yandex.ru:465' --ssl-reqd \
--mail-from '...' --mail-rcpt '...' \
--upload-file mail1.txt --user 'login:pass'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 167 0 0 100 167 0 166 0:00:01 0:00:01 --:--:-- 167
root@server-app:/var/www/discourse#
What could be the reason?
Yandex and Discourse are incompatible?
Stranik
(Evgeny)
28. April 2020 um 10:48
18
sidor1989:
ports 465 and 567.
587!
We use several Discourse sites with Yandex. And everywhere with port 587 it works great. Port 465 did not work initially.
2 „Gefällt mir“