# 发件人邮箱与通知邮箱不匹配，我无法理解原因

**URL:** <https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667>\
**Category:** Support\
**Created:** [2025年二月5日 17:09 UTC](https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667 "2025-02-05T17:09:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2025年二月5日 17:09 UTC](https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667/1 "2025-02-05T17:09:05Z")

</div>

我正在尝试在运行了大约 7 年的论坛上使用 `https://emailit.com/`（目前正在使用 mailgun）。Email It 拒绝发送，因为

```
 530 From header does not match MAIL FROM address

```

当我查看通过 Mailgun 发送的消息的电子邮件来源时，我看到有一行“Sender: ”，例如“Sender: [admin=example.com@www.example.com](mailto:admin=example.com@www.example.com)”。我在其他论坛的其他测试消息中没有看到这一行。

如果我删除所有插件，问题仍然存在。

如果我清除数据库，问题就会消失。

如果我恢复数据库，问题就会回来。

我尝试搜索自定义文本和设置。我使用 postgres 查询了数据库中的所有字段，查找“admin=www”以及其他一些内容（至少 AI 是这么说的，而且看起来很可信）。

我尝试添加一个 put 来查看传递给发送电子邮件的那个东西的消息（这是昨天的事，我已经忘记了类的名称）。我还没有在那里看到任何解释。

我感到很困惑。

任何关于下一步检查什么的建议都将不胜感激。

---

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [2025年二月5日 17:24 UTC](https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667/2 "2025-02-05T17:24:30Z")

</div>

发件人：有所不同。您收到的错误表明“信封”（RFC821 发件人地址）与“发件人:”标头（RFC822）之间存在差异。

我怀疑 emailit（或者可能是 Discourse，我们自己维护邮件服务器已经太久了）将信封发件人设置为您进行身份验证的电子邮件地址。

我认为 (!) 您应该确保 emailit 的 `notification_email` 和 `DISCOURSE_SMTP_USER_NAME` 是相同的。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2025年二月5日 17:47 UTC](https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667/3 "2025-02-05T17:47:40Z")

</div>

非常感谢！

> [@RGJ](#):
>
> 发件人：是不同的东西。您收到的错误表明“信封”（RFC821 发件人地址）与“发件人：”标题（RFC822）之间存在差异。

我担心会这样。我对 RFC822 的熟悉程度远不如 30 年前。我知道“From ”、“From: ”和“Sender: ”都是存在的，但除此之外了解不多了。

> [@RGJ](#):
>
> 我怀疑 emailit（或者可能是 Discourse，我们自己维护邮件服务器太久了）将信封发件人设置为您进行身份验证的电子邮件地址。

也许今年我会这么做。与现在相比，当我不得不将 Sendmail 和 UUCP 移植到 Linux 时，电子邮件似乎简单得多。🙂

> [@RGJ](#):
>
> 我认为（！）您应该确保 emailit 的 `notification_email` 和 `DISCOURSE_SMTP_USER_NAME` 相同。

这似乎很有希望。但没有成功。有趣的是，emailit 说 SMTP\_USER\_NAME 应该是“emailit”。

但是，同样，`app.yml` 中的 SMTP 相关内容（包括 notification\_emai）在此服务器上使用空的数据库时运行正常，但在恢复数据库后就会停止。

---

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [2025年二月5日 19:49 UTC](https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667/4 "2025-02-05T19:49:28Z")

</div>

> [@RGJ](#):
>
> 我认为 (!) 您应该确保 `notification_email` 和 `DISCOURSE_SMTP_USER_NAME` 对于 emailit 来说是相同的。

Discourse 将信封发件人设置为回复邮件地址。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2025年二月5日 20:40 UTC](https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667/5 "2025-02-05T20:40:36Z")

</div>

> [@supermathie](#):
>
> Discourse 将 envelope-from 设置为 reply-by-email 地址。

**即使禁用了 reply-by-email！** 🤷 😿

我看到那里有些东西（似乎与我看到的不符？），但认为既然禁用了 reply-by-email，那应该没关系。

我的天。太感谢你了！ 🚀 🎉

---

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [2025年二月5日 20:42 UTC](https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667/6 "2025-02-05T20:42:08Z")

</div>

> [@pfaffman](#):
>
> 但认为由于禁用了电子邮件回复，所以没关系

电子邮件回复地址对于检测传出电子邮件的退信至关重要 👍

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2025年三月7日 20:42 UTC](https://meta.discourse.org/t/email-sender-does-not-match-notification-email-and-i-cant-figure-out-why/350667/7 "2025-03-07T20:42:28Z")

</div>

此主题在上次回复后 30 天自动关闭。不再允许回复。
