i’m just going through the Admin Quick Start Guide i’m at the step where i’m trying to send a test email, and getting this error:
There was a problem sending the test email. Please double-check your mail settings, verify that your host is not blocking mail connections, and try again.
i’m with Mailgun. i thought it was working properly? i’ve used the “password reset” link from Discourse a few times, and it’s worked. i just checked the Mailgun logs, and i don’t see any failed or bounced emails. What else could be the issue?
The error message tell me to “verify your host is not blocking mail connections.” If it was, would those password reset emails even be working?
EDIT: Hmm. i’m not sure that’s it. When i look at Sent emails in my Discourse Admin panel, i see the four emails that were successfully sent (two forgot_password emails, two signup emails).
i was more referring to a page which, maddeningly, i can no longer find, which said “if you want to send emails with Discourse, MAKE SURE this field says this,” and it had an image of the field with zero context, so i had no idea where to find it.
Sometimes Digital Ocean blocks outgoing SMTP traffic. You can test with telnet SMTPSERVER 587 if it connects, that might not be the problem, but you probably don’t have telnet installed, so If mail’s not working, then re-run discourse-setup and use port 2525 instead of 587. Or, if you prefer pain, create a ticket, wait a day, and hope that they’ll unblock it for you.
i asked DigitalOcean to unblock ports 587 and 2525. This was their response:
Thank you very much for getting in touch with us! I can confirm that SMTP over IPv4 is not currently being filtered on your account. Please keep in mind, however, that SMTP over IPv6 is not currently available. Please let us know if you have any other questions!
I’ve had one install that couldn’t send to a self hosted mail server. It looked like the port was open (I could telnet there) but it never managed to send. I blamed it on their mail host.
I think the next thing is try it’s too delete that droplet and try a new one (or maybe try the new one first).
ActionController::RoutingError (No route matches [GET] “/sftp-config.json”) /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/debug_exceptions.rb:63:in call'_ _Started GET "/deployment-config.json" for 149.202.92.198 at 2018-01-18 12:26:42 +0000_ _ActionController::RoutingError (No route matches [GET] "/deployment-config.json")_ _/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/debug_exceptions.rb:63:in call’ Started POST “/admin/email/test” for 99.248.139.107 at 2018-01-18 12:35:55 +0000 Processing by Admin::EmailController#test as /
_ Parameters: {“email_address”=>“info@lockquest.com”}_ Sent mail to info@lockquest.com (1783.0ms) Completed 422 Unprocessable Entity in 2048ms (Views: 0.5ms | ActiveRecord: 3.5ms)
Like i said, the attempt to send to info@lockquest.com doesn’t appear on my Mailgun logs.
Just looking at that image again, i see i’ve got k1._domainkey.rabbithole.lockquest.com, and krs._domainkey.mail.lockquest. Should it be k1 or krs? There must be two different pages/guides that each use one of these versions, because i wouldn’t know enough to invent one!
UPDATE: i deleted the mail.lockquest.com domain from Mailgun, leaving only the rabbithole.lockquest.com domain there, and now the Forgot Password email from Discourse won’t send.
i DO see this in the logs:
Job exception: 535 5.7.0 Mailgun is not loving your login or password
Of course … if i add a new domain to Mailgun, it’s gonna have its own distinct password.
i re-ran setup with the new password, and - huzzah! The Forgot Password email came through, but more importantly, the test email did too! So, so happy. Fritos go back in the cupboard. Onto the next debilitating stumbling block.