# 类别邮件需要 reply\_by\_email\_enabled 吗？

**URL:** <https://meta.discourse.org/t/category-email-in-requires-reply-by-email-enabled/393855>\
**Category:** Bug\
**Created:** [2026年一月20日 09:08 UTC](https://meta.discourse.org/t/category-email-in-requires-reply-by-email-enabled/393855 "2026-01-20T09:08:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<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:** [2026年一月20日 09:08 UTC](https://meta.discourse.org/t/category-email-in-requires-reply-by-email-enabled/393855/1 "2026-01-20T09:08:33Z")

</div>

## 现状

- `reply_by_email_enabled`（启用邮件回复）已禁用，我们_不希望_用户通过邮件进行回复
- 一个仅限管理员访问的分类，用于接收来自外部系统的通知
- 该分类已配置了电子邮件地址
- `email_in`（邮件接收）已启用
- 邮件已发送至该分类的邮箱地址
- 邮件因 `BadDestinationAddress`（错误的目标地址）而被退回

## 原因

经过一个小时的调试，我发现了以下 [FIX: Disallow replies to categories when reply by email disabled (#33… · discourse/discourse@e05ef50 · GitHub](https://github.com/discourse/discourse/commit/e05ef50c709afb9b4777223e22881b695868d4c2)

> 修复：当禁用邮件回复时，禁止向分类回复 ([#33641](https://github.com/discourse/discourse/pull/33641))
> 
> 当 `reply_by_email_enabled` 设置设为 false 时，我们不再在电子邮件通知中包含回复链接。然而，我们并未阻止向与分类关联的配置好的 `email_in` 地址发送实际电子邮件。此更改在 `Email::Receiver#check_address` 中考虑了该设置。

以及[受影响的代码](https://github.com/discourse/discourse/commit/e05ef50c709afb9b4777223e22881b695868d4c2#diff-fc9b77ad520bae78c4c71a3107a685a58427c10ff1da85c1cb993f164bd09624R872-R874)在 `reply_by_email_enabled` 未启用时将不再返回分类。

```plaintext
    def self.check_address(address, include_verp = false)
      # 仅在启用 'email_in' 时检查组/分类
      if SiteSetting.email_in
        group = Group.find_by_email(address)
        return group if group

        category = Category.find_by_email(address)
        return category if category && SiteSetting.reply_by_email_enabled? <-- 新增
      end

```

### 为什么？ 😱

我有许多疑问：

1. 为什么要做这个更改？无论如何，这只会使系统更加不灵活。如果我不希望人们向分类发送邮件，我只需从分类中移除邮箱地址即可？
2. 为什么要以这种方式实现？

- 似乎向组发送邮件不是问题？
- 如果 `reply_by_email_enabled` 为 false，则甚至无需查找分类？
- 通过不返回分类，错误变成了 `BadDestinationAddress`，这是非常错误的，而且_非常_难以调试

1. 现在突然依赖的这个设置名为 **回复** 邮件。但这并不是我正在做的事情。
2. PR 标题中也存在同样的混淆，标题为“禁止向分类回复”，但这与此无关（在 Discourse 中，“向分类回复”甚至是不可能的）。

除了实现方式之外，我实在看不出这样做的好处。

我想不出_任何_场景，说明如果希望防止人们向分类发送邮件，仅从分类中移除邮箱地址无法解决问题。其结果是，现在如果不启用全站邮件回复功能，就不可能让分类接收邮件。

如果有一个我遗漏的充分理由，欢迎将其重新分类为 #Contribute > Feature（贡献：功能）

---

_[View the full topic](https://meta.discourse.org/t/category-email-in-requires-reply-by-email-enabled/393855)._
