# El hilado de correos electrónicos en modo ML no funciona en Thunderbird

**URL:** <https://meta.discourse.org/t/e-mail-threading-in-ml-mode-does-not-work-in-thunderbird/79657>\
**Category:** Feature\
**Created:** [2 Febrero, 2018 17:38 UTC](https://meta.discourse.org/t/e-mail-threading-in-ml-mode-does-not-work-in-thunderbird/79657 "2018-02-02T17:38:18Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fwolfst](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fwolfst/32/88859_2.png) [@fwolfst](https://meta.discourse.org/u/fwolfst)\
**Post date:** [2 Febrero, 2018 17:38 UTC](https://meta.discourse.org/t/e-mail-threading-in-ml-mode-does-not-work-in-thunderbird/79657/1 "2018-02-02T17:38:18Z")

</div>

I have one of these “dinosaur”-Settings, with the wish to replicate a mailing list.  
However, the threading in thunderbird does not work the way it should (with the latest Docker installation).  
Assume “A” and “B” are users and they send mails that should result in following thread:

```
A: message1
  B: reply1 to message1
    A: reply1 to reply1 to message1
      B: reply1 to reply1 to reply1 to message1
  A: reply2 to message1

```

How I see them in my thunderbird is the following

```
A: message1
  B: reply1 to message1
  A: reply1 to reply1 to message1
  B: reply1 to reply1 to reply1 to message1
  A: reply2 to message1

```

Its flat, like in only one level deep.  
I wonder a bit that nobody has these issues - probably its related to the fact that we do not use reply-key mail-addresses and tough maillinglist-setting everywhere possible.

I compared the Headers (`in-reply-to` and `references` are the relevant ones) to threads that fold well and found that I can “fix” the issue manually in my inbox by manipulating the headers such that the `references` is sorted such that the reply-to - message-id is **last**.

That would mean the bug lies in ordering of the references-header. This is found here:

> <https://github.com/discourse/discourse/blob/e8559f222c856455f38bf3edb62985b464581acb/lib/email/sender.rb#L112>

Unfortunately I will not soon find the time to setup a dev-environment and test these carefully. I suspect that the `uniq` kicks out the actual topic\_message\_id, so _maybe_ something along these lines would fix it:

```
[referenced_post_message_ids - topic_message_id].flatten.compact.uniq + [topic_message_id]

```

Although it looks quiet ugly, but you get the point.

---

_[View the full topic](https://meta.discourse.org/t/e-mail-threading-in-ml-mode-does-not-work-in-thunderbird/79657)._
