A user, Abhinav_Singh, is configuring email for their Discourse hosting and wants to know if the sending domain can be different from the Discourse domain. They are using SendGrid and cannot have the same domain name as one of the subdomains in DNS.
pfaffman confirms that the sending domain can be different, as long as the mail service is configured to send from the chosen domain. They suggest changing the notification email setting in Discourse or editing the app.yml file for the first registration email.
Abhinav_Singh and achamess seek further clarification, and pfaffman provides guidance on how to edit the app.yml file and what address to use for the notification email. It is recommended to use an address that has been configured with the email service (e.g., Elastic Email) to send emails. achamess confirms that using noreply@gofishcarolinas.com would be an appropriate choice.
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?
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"
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"