# Allow reply-to individual instead of topic/forum (mailing list feature)

**URL:** <https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905>\
**Category:** Support\
**Created:** [2016年五月27日 14:24 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905 "2016-05-27T14:24:28Z")\
**Posts on this page:** 17\
**Page:** 3

<div class="post-metadata">

**Author:** ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)\
**Post date:** [2016年十一月22日 23:56 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/41 "2016-11-22T23:56:07Z")

</div>

Thanks Tarek!

Can you remove the reply all button change?

My second point is just that there is no reply to sender functionality. If I were to hit reply it would go to discourse, not directly to the sender by email, bypassing diacourse. Make sense?

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2016年十一月23日 04:45 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/42 "2016-11-23T04:45:44Z")

</div>

try editing this file:

> <https://github.com/tareko/discourse-replyto-individual/blob/master/config/locales/client.en.yml>

---

<div class="post-metadata">

**Author:** ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)\
**Post date:** [2016年十一月23日 04:47 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/43 "2016-11-23T04:47:51Z")

</div>

thanks, tarek! what about the second point? if I’m right then there’s no need for me even to have this plugin turned on. Mailing list mode seems to not be affected.

I’ll watch it for a few days and let you know what happens. 🚀

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2016年十一月23日 04:52 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/44 "2016-11-23T04:52:54Z")

</div>

I’m not sure how that comes to pass for you. For me, obviously it works as advertised. Did you perhaps not enable the plugin? settings \> plugins \> replyto-individual enabled

---

<div class="post-metadata">

**Author:** ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)\
**Post date:** [2016年十一月23日 04:54 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/45 "2016-11-23T04:54:52Z")

</div>

yep - it’s enabled.

does the plugin work with mailing list mode turned on?

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2016年十一月23日 04:55 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/46 "2016-11-23T04:55:29Z")

</div>

Yes. Not sure what’s happening on your installation there.

---

<div class="post-metadata">

**Author:** ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)\
**Post date:** [2016年十一月23日 04:56 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/47 "2016-11-23T04:56:01Z")

</div>

ok - we’ll let it play out for a few days. it’s a quiet, new forum and there haven’t been any posts since I enabled your plugin.

I did update just now to change them as follows - but the topic button still says “reply all” not “reply”.

 ![](https://global.discourse-cdn.com/meta/original/3X/a/1/a1cffb181eeae5633358619a640b1d921b33b5dd.png)

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2018年十月13日 14:50 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/48 "2018-10-13T14:50:56Z")

</div>

Hello all,

For those using this plugin, it is currently known to be broken. I’m working on fixing it at the moment.

---

<div class="post-metadata">

**Author:** ![silojerry](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@silojerry](https://meta.discourse.org/u/silojerry)\
**Post date:** [2018年十月25日 14:14 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/49 "2018-10-25T14:14:40Z")

</div>

Did it break a while ago, or did 2.1.2 break it? Wondering if I should hold off upgrading.

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2018年十月31日 18:17 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/50 "2018-10-31T18:17:05Z")

</div>

It broke in ~ August. It’s now fixed, so go ahead.

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2018年十月31日 18:18 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/51 "2018-10-31T18:18:14Z")

</div>

The plugin is now working again. Here’s the issue if for some reason one is bored and interested:

[https://github.com/tareko/discourse-replyto-individual/issues/1](https://github.com/tareko/discourse-replyto-individual/issues/1)

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2018年十一月1日 06:00 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/52 "2018-11-01T06:00:04Z")

</div>

I spoke too soon about this bug being fixed. For some reason, I cannot get a “Reply-To” header added into my email properly.

The current [lines in question](https://github.com/tareko/discourse-replyto-individual/blob/f5633f9c6851f4cfaa6553ae6a644e3619df9603/plugin.rb#L31) are these:

```plaintext
      if allow_reply_by_email?
        result[ALLOW_REPLY_BY_EMAIL_HEADER] = true
        if @opts[:private_reply] == true
          result['Reply-To'] = reply_by_email_address
        else
          p = Post.find_by_id @opts[:post_id]
          result['Reply-To'] = "#{p.user.name} <#{p.user.email}>"
          result['CC'] = reply_by_email_address
        end
      else
        result['Reply-To'] = from_value
end

```

This section is taken from the [Email::MessageBuilder class](https://github.com/discourse/discourse/blob/ceafcbc898ad453992d5e7a2df5da654461999fb/lib/email/message_builder.rb#L17).

If I leave the `Reply-To` set to its default ( `reply_by_email_address`), then all is well. However, if it is set to anything else (even “[test@test.com](mailto:test@test.com)”, then it will simply disappear from the end email headers. Similarly, if I replace Reply-To with something else like CC, then for some reason it does not build, and instead displays: `replies+%{reply_key}@emlondon.ca` (note, the `%{reply_key}` is correctly fixed in the Reply-To.

I really have no idea a) why this behaviour is happening; and b) Why it’s happening now after working for so long - what am I missing here in the API?

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2018年十一月1日 06:30 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/53 "2018-11-01T06:30:29Z")

</div>

I managed to fix the problem with the `reply_key` not being substituted using [this commit](https://github.com/tareko/discourse-replyto-individual/commit/ea90efa28b1b39d6948d9eecdeac7f2b7b3fc2cf), which modifies the `set_reply_key` method in the `Email::Sender` class. However, I still can’t figure out why `Reply-To` becomes null when I change it to anything but ‘reply\_by\_email\_address’. It is set correctly at the end of the `header_args` method, but I can’t figure out where it is unset.

Any thoughts? I think @featheredtoast is the staff member I see with the most recent edits to `Email::MessageBuilder`

Edit: After some debugging, this appears to happen somewhere in lib/mail/sender.rb before line 86, though not sure exactly where…

Edit #2: After further debugging, I found the problem to be the following line in the Email::Sender::set\_reply\_key method:

```plaintext
      @message.header['Reply-To'] =
        header_value('Reply-To').gsub!("%{reply_key}", reply_key)

```

This method was causing a Reply-To without a reply\_key to be wiped. I added a simple if statement to exclude the function if there was no “reply\_key” in it. As of this moment, the plugin is back to fully working status.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2021年八月8日 03:08 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/54 "2021-08-08T03:08:12Z")

</div>



---

<div class="post-metadata">

**Author:** ![jeff\_y](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeff_y/32/200242_2.png) [@jeff\_y](https://meta.discourse.org/u/jeff_y)\
**Post date:** [2021年八月12日 19:52 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/55 "2021-08-12T19:52:19Z")

</div>

我想最近的 Discourse 升级导致插件失效了。`replies-xyz@example.com` 不再被抄送。我已在 GitHub 上创建了一个 [问题](https://github.com/tareko/discourse-replyto-individual/issues/3)。

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2022年一月8日 10:41 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/56 "2022-01-08T10:41:18Z")

</div>

抱歉这么晚才看到此消息 - 我不知何故没有收到通知。我将在 GitHub 上跟进此事。

---

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [2022年八月27日 09:00 UTC](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905/57 "2022-08-27T09:00:31Z")

</div>

这已在 GitHub 中修复。其本质是 message\_builder.rb 和 sender.rb 的工作方式发生了一些变化，这破坏了插件的更改。例如，使用了 gsub! 而不是 gsub 来替换 reply\_key，这破坏了“to”标头。此外，出于某种原因，CC 因其只有 2 个字符而被 self.custom\_headers 阻止。也许是某个安全功能？但我禁用了它以使模块正常工作。新版本已发布在 [github](https://github.com/tareko/discourse-replyto-individual/) 上。感谢您的错误报告！

[上一頁](https://meta.discourse.org/t/allow-reply-to-individual-instead-of-topic-forum-mailing-list-feature/44905.md?page=2)
