# Email-in replies thread wrongly

**URL:** https://meta.discourse.org/t/email-in-replies-thread-wrongly/59365
**Category:** Bug
**Created:** [March 17, 2017, 5:34pm UTC](https://meta.discourse.org/t/email-in-replies-thread-wrongly/59365 "2017-03-17T17:34:33Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [March 17, 2017, 6:32pm UTC](https://meta.discourse.org/t/email-in-replies-thread-wrongly/59365/4 "2017-03-17T18:32:09Z")

</div>

The References/In-Reply-To headers match each other, but not what I thought Discourse was using:

> [@Discourse Emails not threaded properly in some Email clients](https://meta.discourse.org/t/emails-not-threaded/44444/2):
>
> Here’s what we use when we send an email post\_identifier = "\<topic/#{topic\_id}/#{post\_id}@#{host}\>" @message.header['Message-ID'] = post\_identifier This looks correct to me, we set the Message-Id header to the Id of the post. Your mail client should use that as the In-Reply-To header.

Edit:

I looked through some of the mail I’ve gotten from Meta, and see that the message IDs match the description given above:

```plaintext
From: Jay Pfaffman <meta@discoursemail.com>
Reply-To: Discourse Meta <meta+785bdce[...]@discoursemail.com>
To: [my discourse email address]
Message-ID: <topic/59203/270905@meta.discourse.org>
In-Reply-To: <topic/59203/270854@meta.discourse.org>
References: <topic/59203/270854@meta.discourse.org>
 <topic/59203@meta.discourse.org>

```

So, yes, I think the threading issue might be related to the `Message-ID` getting replaced.

---

_[View the full topic](https://meta.discourse.org/t/email-in-replies-thread-wrongly/59365)._
