在 Discourse 中设置发件人/From 电子邮件地址

Hi,

We are experiencing an interesting problem with discourse + mailgun.

Our email domain (@something.com) does not match the subdomain we are using in mailgun (mg.something.com). As a result all emails are sent as

noreply=something.com@mg.something.com; on behalf of; My Community noreply@something.com

This may be caused by the Sender not being set by discourse. In the email’s headers I can see that
[Sender]: noreply=something.com@mg.something.com

Both my email notification and email site title are set. Is there a way to force the sender=email notification in Discourse (latest version)?

Thx
Sebastien

1 个赞

You need to check the notification_email setting to match noreply@mg.example.com

1 个赞

We do not want to expose this subdomain to our users. Mailgun recommends the usage of subdomains when sending mails. The idea would be to force the sender headers in discourse. According to our test, it seems to work well.

Would it be possible to do that in discourse?

Contact mailgun for help.

In my experience using domain while verifying subdomain makes emails end up in spam.

1 个赞

This is the comment from my network manager.

I’ve been working with all our email systems, both internal and external, and also SPF, DKIM and DMARC setups -

For many of our providers, we are allowed to send through mailgun, as mg.example.com subdomain, but the sender and from fields are set to match @example.com - so there is no “on behalf of” issue.

For dmarc alignment, the really important parameter is the “d=” field when signing the email with dkim. If this is d=example.com, then everything is aligned because the @example.com is matching the top level sender domain (ie, outdomain.com) - so the mechanisms “SPF dmarc alignment” and “DKIM dmarc alignment” both show as “pass”. When eveything shows as pass, the email is accepted as valid.

So, we have a couple issues here. Can we set the “sender” and “from” fields?

Do you properly assign the domain in the “d=” when dkim signing the email?

In your settings, you can setup the domain to point to whatever domain you want.
My site is hosted on board.example.com and the emails come from example.com

Is that what you mean?

1 个赞

here it’s not related to the website url but to the SMTP Domain vs Sender domain.
Our smtp is mg.something.com whereas our sender domain is something.com.

My mailgun is setup as mg.example as well. Still uses example.com as the protocol.
edit maybe I’m just not understanding what you’re trying to imply.
Apologies.

Interesting. Do you receive email with sender displayed as
noreply=something.com@mg.something.com; on behalf of; My Community noreply@something.com

c0ry, it seems we are not able to set the “sender” and “from” (and the “return path”) fields to be the same. If they are not the same, you can get emails that say “sent on behalf of”. Then risk of spam classification is higher.

我一直在努力将出站邮件集成到 Office365 中。
有几个讨论邮件问题的帖子。
供参考:
默认情况下,如果发件人与登录用户不一致,Office365 会返回 554 错误(而 Discourse 的日志记录并不理想)。

发件人地址可以按其他地方讨论的方式设置:
rails r “SiteSetting.notification_email = ‘discourse@yoursite.com’”

但我认为这仅设置了初始发送的邮件。

注意,我的论坛 URL 与我的邮件域名无关……
对我来说,我需要在(图形界面)设置中配置以下内容:

  1. 通知邮件
  2. 站点联系人用户名——这意味着你必须拥有一个用户,其邮箱地址正是你想要用来发送邮件的地址(即你用于 SMTP 登录的邮箱)。

基本上,从 Discourse 发出的所有邮件的“发件人”字段必须与 SMTP 登录邮箱一致,才能使用“普通”的 Office365 SMTP 连接。希望上述设置能实现这一点,但如果能为每封邮件强制固定“发件人”字段,那就更完美了。

s