Emails are not threaded in Outlook 2013

When turning on emails for every post to a forum, the emails do not thread correctly, at least in Outlook 2013. It looks like there’s an attempt to make it work, based on the In-Reply-To headers, but somehow it’s still not working :(. I imagine Outlook has some strange heuristics you might have to appease…

Can you provide information on these heuristics?

I don’t know them myself, and can’t find anything with a quick Google. But, comparing to GitHub notification emails (which are correctly threaded), here are some differences I notice:

  • Discourse emails have different Sender headers for each email, whereas GitHub emails do not have a Sender header. (This manifests in the UI via Outlook’s “$Sender on behalf of $From” for Discourse, whereas GitHub just uses “$From”)
  • GitHub emails have List-Post headers; Discourse emails do not.
  • Discourse emails have different Reply-To addresses; GitHub emails use the same one for each thread. (Both use different Reply-To names.)

I put together a gist with the headers of two Discourse emails in the same thread, plus two GitHub emails in the same thread, which can be analyzed further. I’ll try tweeting to see if anyone can connect me with the Outlook team as well for a more definitive answer.


Great stuff. I’d really like to fix this once we figure out exactly what we need to change.

There are a lot of List- headers here:

List-ID: felixge/node-sandboxed-module
List-Post: <>
List-Unsubscribe: <>,

The only one we have is

List-Unsubscribe: <>

We can certainly add these headers:

List-ID, List-Archive, List-Post

It looks like:

List-ID = topic title, e.g. URL fragment? /t/topic-title/1234
List-Archive = topic URL
List-Post = duplicate the email reply address

The difference in Reply-To could also help?

Reply-To: felixge/node-sandboxed-module


Reply-To: domenic <>

Ok I added


Which was oddly in the code already as a function, but not present on any outgoing emails at all, anywhere, on any site, for… reasons I don’t understand. It was also in the code as lower case List-Id, whereas GitHub puts it in as upper case List-ID. At any rate, this header was not present on any Discourse emails, which I think is a big, big problem.

In the case that email replies are enabled, I also added


which is simply a copy of the Reply-To header the way GitHub does it, so we’ll copy that header into that field if email replies are enabled.

I need @eviltrout’s help to build List-Archive since I can’t figure out a way to get to the current URL of the topic in that part of the code.

It looks like Mandrill may be interfering here, and stripping List-ID and List-Post. I verified the header arrives in the logged API call on their end, but it never arrives on the client… I also opened a support ticket on our paid Mandrill account.


Here is a gist with headers from a YahooGroups email and reply.

Interesting candidate headers include:

Mailing-List: list; contact
Delivered-To: mailing list
List-Id: <>
Precedence: bulk
List-Unsubscribe: <>
1 Like

Apparently In-Reply-To is another possibly important header. documents in detail what the References and In-Reply-To headers are meant to be, but basically as near as I can figure it:

In-Reply-To: lists the message ids of all the messages this reply is replying to (so whatever message was selected for the “Reply” button, plus any message quoted. Just the former would probably be sufficient.

References: lists the parent’s References header followed by the parent’s message ID.

If you look at ours currently, it looks like this:

Message-ID: <539a986f8300_5a3fae28acd8c8201e9@forum.mail>
In-Reply-To: <topic/>
References: <topic/>


Message-ID: <539a9904d40bd_5a3fae28d5b8242036d@forum.mail>
In-Reply-To: <topic/>
References: <topic/>

which is clearly wrong. The first one was the original PM, so should not have an In-Reply-To or References header, and the second one (the reply, should look like this:

Message-ID: <539a9904d40bd_5a3fae28d5b8242036d@forum.mail>
In-Reply-To: <539a9904d40bd_5a3fae28d5b8242036d@forum.mail>
References: <539a986f8300_5a3fae28acd8c8201e9@forum.mail>

And a reply to that reply should look like this:

Message-ID: <adsassadfdfsdfs_sddfsdfsaererfgdsf@forum.mail>
In-Reply-To: <539a986f8300_5a3fae28acd8c8201e9@forum.mail>
References: <539a986f8300_5a3fae28acd8c8201e9@forum.mail> <539a9904d40bd_5a3fae28d5b8242036d@forum.mail>

Does that help?

1 Like

All topic replies are conceptually “in reply to” the topic, though.

Do you mean that the first posted message is a reply to the (empty, created) topic, or do you mean that all following replies are replies to the original message?

Either way, the “References” and “In-Reply-To” list message ids, not topics. They need to list the message IDs of previous emails.

The first post (post_number=1) should not have References or In-Reply-To headers because there is no previously existing message ID.

All following replies could simply be Reference: , In-Reply-To . That would be fine (minimal, but fine) as far as I can see.

If you want the References and In-Reply-To headers to be “topic/”, that would be fine, but only if you make sure that first email has message id “topic/” which might be ok, but is probably a bit dangerous. Otherwise, topic/ wont be a message ID of any existing email message so it’s not going to be legitimate.

And on the topic of, I’ve done some more testing, and as far as I can see the “Re:” is by far the most important thing for its threading. It will generally thread the emails together as long as the subjects have “Re:”, and will not thread them together if they don’t no matter what headers they have as far as I can tell.



Thanks for generating that email and sending it to us. I appreciate your diligence and effort. In this case it does look like these headers are getting stripped out when we break apart the SMTP message and convert it to an API call through our SMTP Integration. We’ve previously added support for a few common headers as we’ve continued to develop our product, but at this time we don’t have support for the List-ID and List-Archive headers. These might be ones that we can similarly allow through, but I don’t have a timeframe for when that may be implemented.

I have shared all of this with our developers so that they are aware of the need for this and can work on incorporating that feature.

We need to switch away from recommending Mandrill while this is the case. Absence of these List-* headers can break threading in mail clients, depending on the mail client of course…

But then they just replied

Thanks for getting back to us! We should actually be able to push a change pretty shortly to add support for these headers, and I’m glad to let you know once that change has gone live.

So maybe playing the Blogger Jackass Card worked in this case.


The changes are complete. The List-ID and List-Archive headers will no longer be stripped out during conversion of your SMTP messages.

Yay! So hopefully this will start working for all sites that use Mandrill now…


Getting back to the subject of the topic: can anyone confirm that, with changes since June, email notifications from Discourse are properly threaded in Outlook 2013?

1 Like

Trying to reply to this post to see what happens…

(EDIT: ok, I forgot to turn on email notifications wnen visiting the site recently for before doing this, apparently. So instead of spamming this thread twice more, I’ll just subscribe to the currently-most-active thread and report back.)

I can confirm that the emails are still not properly threaded in Outlook 2013 :frowning:

New gist at Discourse headers for 2014-10-13 · GitHub

Still no List-Post header, although who knows if that’s the important one.

I wasn’t originally subscribed to the topics I just subscribed to, so it’s possible if you guys are using the “In-Reply-To the top post” strategy (instead of the “In-Reply-To most recent post on the thread”) threading won’t work unless you receive the email for the first post. I’ve stayed subscribed to all of so if that happens to be the case we should know after a few posts.

I wonder if the "Re: " subject prefix is important!?

No idea… someone with knowledge of Outlook 2013 internals will need to step up, otherwise it’ll just be the way it is.

From your gist, here are the current relevant headers that I know of:

Subject: [Discourse Meta] [feature] Possibility to selectively (or completely) mark notifications as read
From: Mittineague <>
Reply-To: Discourse Meta <>
In-Reply-To: <topic/>
References: <topic/>
Auto-Submitted: auto-generated
List-ID: <>
List-Unsubscribe: <>
Precedence: list

One thing I did notice , comparing your GitHub email header gists:

Reply-To: felixge/node-sandboxed-module


Reply-To: Discourse Meta <>

@techapj can you improve us here so we are using topic/20227 instead of Discourse Meta here as the “friendly” reply-to name here, like GitHub does?

Couple other worries about magical incantations needed:

  • Re: in the email title? So ghetto, but we do now support it (off by default).
  • Message-ID: might need to be something other than the random generic technobabble string our mail server seems to slap on there. Is it safe for us to include this header @michael?

Where is that setting? I can’t find it in user preferences at least, and although I am an admin for, I don’t see any real adjustable settings there.

Hi @domenic!

Update to the latest version, then see:

Happy to report that since upgrading to the latest Discourse and turning on the optional Re: prefix, the emails are now threading.


Well, it does not really work in every client:




Thunderbird seems to grab the "Re: " prefix and the other clients don’t. As the In-Reply-To headers are wrong these clients could not do any threading. As mentioned before the specs are here (chapter 3.6.4):

I have edited the In-Reply-To and References Headers manually according to the specs. I have replaced these topic links with the appropriate message IDs. Suprise, surprise, it threads well in every client:



@codinghorror: Have a look at rfc2822 and @peternlewis post above. That’s the real issue with its intended solution. Adding an Re: prefix is just a workaround for some clients.