I saw in the setup guide and other questions that I need to use the same subdomain for Mailgun. So if I want to install Discourse at www.example.com, do i need to add www.example.com to Mailgun? Or example.com will work too?
AI-generated summary
The original poster, Alex_P, is seeking clarification on setting up Discourse with a www. domain and Mailgun. omarfilip explains that example.com is sufficient for Mailgun verification, and only the domain part is needed in app.yml. Alex_P is unsure about the technical difference between www. and forum. subdomains.
pfaffman clarifies that www. and forum. are different subdomains, but recommends configuring Mailgun to send from www.x.com to avoid potential future complications. However, Alex_P decides against this, citing the domain’s sole use for the forum and the possibility of using a different subdomain for mail in the future.
Alex_P ultimately verifies example.com with Mailgun, installs Discourse at www.example.com, and sets the notification email to noreply@example.com using the command line.
example.com is sufficient. You will need forum.example.com or other subdomain if your Discourse is on a subdomain.
Ok, thanks. But I still need to use www.example.com for DISCOURSE_HOSTNAME in app.yml, right?
No. only the domain part - example.com or forum.example.com - depending on your setup.
hm, I thought www. is technically the same subdomain as forum.?
I want Discourse to be at www.example.com (and example.com redirects to www.)
You’ll make that setup in the DNS zone file.
Create a CNAME record that sets www.example.com as an alias of example.com.
No. They are . . . different.
I recommend that you configure mailgun to send from www.x.com so that if you decide that you want to do something with mail and x.com in the future it won’t be complicated by it sharing the domain with Discourse.
probably not, the domain is just for forum. Also in this case I probably can just use another subdomain in the future like mail.x.com?
I think I never saw anyone sending from foo@www.... Tried to search from:www in my gmail, no results.
I mean, as I understand www is just a subdomain, maybe with some special handling in some cases because it’s commonly used.
So what I ended up doing was:
- Verify example.com with Mailgun
- Install Discourse at www.example.com
- The email arrived, but from unusual noreply@www.example.com instead of noreply@example.com. So I set the email via
docker exec -it app rails r 'puts SiteSetting.notification_email = "noreply@example.com"'(in this case probably an easier way would be just to finish the admin registration and then set email in the /admin UI).