Can domain name of discourse hosting and sending emails be different?

Hi,

I’m configuring emails for my discourse hosting. Discourse is hosted at discuss.xxxx.com.

I read in the documentation that for emails to work properly, we must verify and use the subdomain, e.g. discourse.example.com. So in my case sending domain must be discuss.xxxx.com

I’m using SendGrid to send emails and in SendGrid white label domains can not have the same name as one of the subdomains in DNS. So I’ll not be able to have discuss.xxxx.com as my verified sending domain.

I’m curious, can I set sending domain different than the discourse domain? I would prefer to set sending domain as forum@xxxx.com or forum.xxxx.com …what can be implications of this?

Looking forward to hear your views on this

2 Likes

If your mail service is configured to send from the domain you use, it’s fine. You can change the address that Discourse sends from by changing the notification email setting.

For the chicken-egg case where you need to receive email to gain access to your Discourse installation, you can edit the bottom of app.yml that looks like this:

run:
  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec: echo "End of custom commands"
3 Likes

Hi Jay,

Yes, I can change the app.yml and rebuild the app.

You mean it is completely fine to set sending domain as forum@abc.com or noreply@forum.abc.com even if discourse domain is discuss.abc.com right?

Yes, it’s fine if your mail delivery service will do it.

And, if you already have admin access to your Discourse, don’t change app.yml, just change notification_email in settings.

3 Likes

So for example, my domain is gofishcarolinas.com
I verified my email on elastic email using this domain, not discourse.gofishcarolinas.com

Now, in the app.yml file, I should change that email to what? admin@gofishcarolinas.com? This is for the first registration email.

Thanks.

1 Like

You can edit app.yml with nano to set the notification_email setting. At the bottom, you’ll see this:

  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec: echo "End of custom commands"
1 Like

I see that. Thanks. I’m just asking, what specifically should I change the setting to?

Based on the tutorial, I made noreply@gofishingcarolinas.com Would that be appropriate?

1 Like

Any address that you’ve configured elasticemail to send should work.

2 Likes