Cannot get email working on new install


(Sascha F Zeller) #1

after having read this article: Troubleshooting email on a new Discourse install I have followed all the steps mentioned, and yet the activation email is still not arriving.

I have the following entries:

DISCOURSE_DEVELOPER_EMAILS: 'sfz@dynomotion.com’
DISCOURSE_SMTP_ADDRESS: a2ss19.a2hosting.com (I have also tried mail.dynomotion.com)
DISCOURSE_SMTP_PORT: 587 (I have also tried port 2525)
DISCOURSE_SMTP_USER_NAME: sfz@discourse.dynomotion.com
DISCOURSE_SMTP_PASSWORD: MyPassword

And I uncommented the line at the end of yml.app to read like this:

- exec: rails r "SiteSetting.notification_email='sfz@dynomotion.com'"

Finally I tried this:

./launcher enter app
rails r "SiteSetting.notification_email = 'sfz@dynomotion.com'"
exit

But, like I said, no activation email.

Thank you,
Sascha


Troubleshooting email on a new Discourse install
#2

this should be the web address of your SMTP mail provider, e.g. smtp.mailprovider.com

These should be the user (often “SMTP_Injection”) & secret provided by your mail provider.

You will need to set up the correct TXT entry in your sites DNS too with a key provided by your mail provider then verify it at your mail account or it won’t accept requests.


(Sascha F Zeller) #3

All values there SMTP server address, password etc.) the are correct ones - I have changed sfz@discourse.mycompany.com to sfz@mycompany.com, and it still doesn’t work. Also, uncommenting that line at the end of app.yml as suggested above did not help. I just won’t get an activation email no matter what I try…


#4

Sascha please check you have opened the port on your server to ensure the requests are allowed to get out to your mail provider.


(Sascha F Zeller) #5

OK, how do I do that?


#6

You need to modify the security settings in your cloud server account to allow SMTP inbound and outbound traffic on port 587. The interface to do this depends on your cloud provider.

NB some Cloud providers require you to send proof of ID before they will permit SMTP connectivity - this is true for e.g. Scaleway.


(Sascha F Zeller) #7

So, the cloud server running Discourse is on DigitalOcean, but my mail service is with A2 Hosting. That web server has nothing pre-installed, so I am not sure how to change any mail server settings. I did find an article on setting up a mail delivery agent:


Is that what I need to do in your opinion?


#8

No, I don’t believe so, because you are not using your DO cloud server to do the actually forwarding of email to end users. Instead you using your mail service to do this (on A2hosting apparently) - a quick search of this meta brings up little on that service provider - you might want to contact their support?

Check your log for clues:

tail shared/standalone/log/rails/production.log

A2hosting doesn’t seem to be a popular mail service on here. Are you using it successfully for emails for other websites already? Using a well known dedicated email service may improve reliability of sending emails because some IP addresses get blacklisted for mail spam, so using a well managed brand of email service that polices itself is very important.

Have you considered alternatives?

Here’s the recommended list:

Although I use:


(Sascha F Zeller) #9

We don’t really want to change our hosting company (been happy with them for a long time, our entire e-commerce website depends on the way everything is set up and as you may have guessed I’m not a developer - so I’m afraid of breaking stuff ;-).

But I will contact them to say if they can point me in the right direction.

The production log has a lot of entries like:
ActionController::RoutingError (No route matches [POST] “azenv.php”)
(No route matches [HEAD]
etc.

BTW, my outgoing SMTP port is 465.

Thank you for your time responding to my question, it’s very much appreciated!


#10

Yes, check with their support team. Make sure the mail server login details are correct, the port is correct and if required you have set up the DNS properly and verify that with your mail provider.


(Sascha F Zeller) #11

One more thing: in the example above, it states:
“Please note that in any email provider, you must verify and use the subdomain, e.g. discourse.example.com . If you verify the domain only, e.g. example.com , mail will not be configured correctly.”

I have tried that as well, but now in my app.yml I have my regular email address (without subdomain) under username and just uncommented the line toward the bottom that says:

rails r "SiteSetting.notification_email = 'sfz@dynomotion.com'"

Is that correct?


#12

I don’t have ‘discourse’ in my domain and it still works.

Mine is like : ‘noreply@mydomain.org’

But please note I have specifically set up a ‘sending domain’ with Sparkpost that is just ‘mydomain.org

This is specifically set up in a TXT record in DNS with a DKIM key Sparkpost provides and i’ve verified this domain using their website account functionality. FWIW I’ve set up the TXT record using an AWS Hosted Zone, but you could use any DNS tool …


(Sascha F Zeller) #13

I’ve been struggling with this for more than three weeks now and am afraid I have to abandon my Discourse experiment. Nothing I tried worked. My email provider has confirmed that the settings I used are correct but they never found any email attempts (activation email) from Discourse on their server…


(Tom Litchfield) #14

I feel your pain, we’ve been struggling for weeks also. We can send test emails but not activation emails. We’re resorting to hacking the core code to get emails to work.


(Richard - DiscourseHosting.com) #15

That sounds like sidekiq is not running.


(Tom Litchfield) #16

Sidekiq is running. No redis errors too.


(Sascha F Zeller) #17

I am not sure I have sidekiq installed. The locate command didn’t find anything. How can I check for that?


(Christoph Loesch) #18

Would be good to add for exchange users to know they might need to switch to “login” authentication.
see this thread: SMTP connection problem, docker installation


(Sascha F Zeller) #19

we actually liked Discourse so much that we wanted to replace our
existing forum (https://www.dynomotion.com/forum ) with it. Since
we did not want to change our hosting service, we rented a 2GB
space on a Linux server (VPS cloud hosting) from Digital Ocean. I
then installed Docker as well as Discourse
(http://discourse.dynomotion.com) - so far, so good!

However, I never received an activation email. After a lot of
questions and answers
(https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326 ),
and endless modifications to the app.yml, rebuilds etc. etc. I
still could not make it work (tried different ports on the SMTP
server, edited email from sfz@dynomotion.com to
sfz@discourse.dynomotion.com , uncommented that last line in the
app file and so on).

The problem is that I am not a developer and have very limited
knowledge of Linux and how to use a command line. I also have
only limited time to work through these issues, and I am thinking
that if getting email to work on Discourse is that hard for me,
what do I do when more serious problems arise. So, unfortunately,
in the end we probably have to keep our existing forum.

Discourse looks like a great product and perhaps one day it will be easier to install and run.


#20

IT is occasionally tricky, particularly integration. If you decide to go the self-install route you have to deal with the technical hurdles. None are insurmountable, even by non-devs. And not every developer is a good SA! :slight_smile: Your alternative is to use their full hosting service.