Multisite installation with seperated smtp emails

AI 生成的摘要

The discussion revolves around configuring separate SMTP email settings for different sites in a multisite Discourse installation. suanfazu and 5minpause initially struggled to achieve this, and sam confirmed that multisite installations currently don’t support multiple outgoing SMTP servers.

However, sam expressed willingness to consider a pull request for this feature, suggesting that email settings should be in site settings with the option to be shadowed by globals.

SimonBiggs explored the possibility of funding the implementation of this feature, but later discovered that the desired effect could be achieved by not setting the DISCOURSE_NOTIFICATION_EMAIL environment variable, allowing site-specific email settings to be configured.

silverdr proposed the details of the changes that could be implemented, including the possibility to override all SMTP configuration variables per site or, at a minimum, override the SMTP user name and password per site.

I followed this post to setup doctor multisites.

but how to configure different smtp email settings for different sites?

I tried this as well and couldn’t get the second site to use different settings from the first site.

Perhaps @sam could offer an opinion, if this is a known bug or something else.

We don’t support multiple outgoing SMTP servers in multisite

Thanks for the answer. Is this something you would consider given a pull request? Does it make sense to invest time in?

Sure, if you can pull it off, its pretty complicated, but I would be open to have a PR for it and would kind of prefer if email settings were in site settings as long as they can be shadowed by globals.

嗨 @sam,

如果我实现这个功能,是否有潜在的资金支持?我们目前正在研究从政府(https://www.nsw.gov.au/grants-and-funding/mvp-ventures-program)获得 MVP 补助金,您提供的任何资金我们都可以让政府进行 1:1 的匹配,这将是惊人的 :slight_smile:。

祝好,
Simon

您能详细说明所有拟议的变更吗?

你好 @sam,

我实际上刚刚意识到,如果我不设置以下环境变量:

DISCOURSE_NOTIFICATION_EMAIL

在 app.yml 中,那么以下配置项将出现在设置中:

我可以使用它来实现我想要的精确效果。

感谢 @sam 对此的开放态度 :slight_smile:,但看起来这次我不需要 PR 了。

最大/最佳:

  • 在多站点配置中为每个站点覆盖所有 SMTP 配置变量的可能性
    • DISCOURSE_SMTP_ADDRESS
    • DISCOURSE_SMTP_PORT
    • DISCOURSE_SMTP_USER_NAME
    • DISCOURSE_SMTP_PASSWORD
    • DISCOURSE_SMTP_ENABLE_START_TLS
    • DISCOURSE_SMTP_DOMAIN

最小:

  • 为每个站点覆盖以下与 SMTP 相关的变量的可能性
    • DISCOURSE_SMTP_USER_NAME
    • DISCOURSE_SMTP_PASSWORD

在他们对应的 config/multisite.yml 中

最小背景:鉴于没有其他选择,我可以进行设置以适应一个 SMTP 服务器,但肯定需要单独的 SMTP 用户(发件人)。从 Discourse 站点运行所在域以外的地址发送邮件,不幸的是,这看起来是一个交易破坏者。