Issues troubleshooting email

AI-generated summary

Issues Troubleshooting Email Summary

MST2 encountered issues with email on their Discourse installation using SparkPost. They followed the SparkPost guide and the Discourse troubleshoot guide but were stuck at the log checking step.

Stephen suggested checking DNS and resolving the mail server address from the server. After some clarification, MST2 revealed that they installed Discourse on a cloud server using Docker.

Stephen asked MST2 to verify the SMTP address entered during discourse-setup and to check the DNS resolution using PING or NSLOOKUP.

MST2 provided images of their setup, but Stephen asked them to SSH into their server and run specific commands to verify the SMTP address and DNS resolution.

MST2 found that the issue was due to a typo in the SMTP address during discourse-setup. Stephen confirmed the issue and provided options to correct it, including re-running discourse-setup or editing the app.yml file.

MST2 acknowledged the mistake and thanked Stephen for his help. MST2 planned to set up the email correctly and post again if issues persisted. Stephen wished them good luck and offered further assistance if needed.

So, I have installed Discourse and I am having issues with the email.
I‘m using SparkPost and followed this guide.
Now I used the troubleshoot guide, and at the part where you‘re supposed to check the discourse logs is where I‘m at right now. I looked at them and found this:


Now, I understand this as an email was sent but something is not known or failed?
Could someone help me?

Where did you install Discourse?

Is DNS working correctly? Can you resolve the mail server address from the server?

I installed discord on a cloud server.

What exactly do you mean with can you resolve the mail server address from the server?

I mean can you use PING or NSLOOKUP to resolve the address you entered during discourse-setup for sparkpost?

Did you follow the standard install guide? How did you install Discourse onto the server?

The STMP address from SparkPost?

I did everything like in the guide. I installed it with docker.

The address of the SMTP server, which is a DNS name, not the SMTP address sparkpost is using, which would be in the format user@realm.com


Anything here?
(Sorry if this is hard..)

So

SSH into your server and do this:

ping smtp.sparkpostmail.com

Also, if you:

cat /var/discourse/containers/app.yml | grep "smtp.sparkpostmail.com"

What’s the response?

If you don’t get back a line like this:

DISCOURSE_SMTP_ADDRESS: smtp.sparkpostmail.com

It’s very likely that you typo’d the address during discourse-setup, which would explain why your server can’t resolve it. You can re-run discourse-setup or edit the app.yml to correct it.

Since there is no response from this:

It means this:

Right?

If you’re SSH’d into the Discourse server and Discourse is installed in that path then yes.

You can check what’s in that line by doing this:

cat /var/discourse/containers/app.yml | grep "DISCOURSE_SMTP_ADDRESS:"

It should return something, if it doesn’t then there’s something more fundamental that’s awry with your setup.


Here we go

Oh I see it now, I wrote stmp even though it‘s smtp.

Yep, so you transposed two characters, which led to an invalid mail server address. DNS resolution failed and gave you the original error.

You can:

  1. re-run discourse-setup if you would prefer a prompt-driven process
  2. edit it by hand using vi or nano
  3. Use this to automatically substitute it for you:

sed -i 's/stmp.sparkpostmail.com/smtp.sparkpostmail.com/g' /var/discourse/containers/app.yml

Thanks for your help! I‘ll set it up the correct way now and I‘ll post in here again if it still does not work.

Good luck, it should be plain sailing from here, let us know if not.