What does DISCOURSE_SMTP_DOMAIN mean?

AI-generated summary

Users are discussing the purpose of the DISCOURSE_SMTP_DOMAIN setting in Discourse’s app.yml configuration, particularly why it’s needed alongside DISCOURSE_SMTP_ADDRESS. meglio asks for clarification, noting desktop clients typically don’t separate “address” and “domain”. icaria36 echoes the confusion and wonders whether to use the Discourse subdomain (e.g., discourse.example.com) or the root domain (example.com). thoka explains that DISCOURSE_SMTP_DOMAIN is passed directly to Rails’ ActionMailer and relates to the SMTP HELO/EHLO command, which identifies the sending host’s domain. icaria36 questions why this setting isn’t prompted during ./discourse-setup and remains uncommented, potentially misleading users with a default value. In a follow-up, icaria36 answers their own question, citing a Meta Discourse thread: the correct value is typically the mail server’s domain (e.g., mail.example.com), not the Discourse subdomain. The discussion highlights a gap in setup automation and documentation around SMTP domain configuration, which can affect email delivery if misconfigured.

While already having DISCOURSE_SMTP_ADDRESS, what does the DISCOURSE_SMTP_DOMAIN setting in containers/app.yml do?

It’s not that desktop clients usually ask for “address” and “domain” separately, so I got confused.

I have the same question. I searched for an answer and I found this topic.

More specifically I wonder whether here we should put the same subdomain the Discourse instance has (discourse.example.com) or the domain (example.com). And whether this is something related to the SMTP configuration at all.

It is passed directly to action_mailer

Actions_Mailer’s Docs designate it as a part of SMTP conversation.

Is there a reason why this line in app.yml

DISCOURSE_SMTP_DOMAIN: discourse.example.com # (required by some providers)

isn’t asked during ./discourse-setup and it isn’t commented either, introducing a false value in the configuration?

In case it helps future readers…

Replying to myself :sweat_smile: based on Emails have stopped sending - end of file reached - #25 by Falco, you need to add your mail domain i.e. mail.example.com.