1.7 breaks the workaround we had for Mac Mail threading, namely always including “Re:” at the start of the subject
Setting for email subject Re: [%{site_name}] %{optional_pm}%{topic_title}
Unfortunately, Discourse 1.7 sensibly does not include an “In-Reply-To” on the first post, and this results in the first post being threaded separately from the replies in Mac Mail.
I have a hack to put the “In-Reply-To” back:
@message.header['Message-ID'] = incoming_message_id || post_message_id
- if post && post.post_number > 1
+ if post
@message.header['In-Reply-To'] = referenced_post_message_ids.first || topic_message_id
+ end
+ if post && post.post_number > 1
@message.header['References'] = [topic_message_id, referenced_post_message_ids].flatten.compact.uniq
end
but this is obviously less than ideal. That said, I’ve got no ideas for any better solution, and the alternative (the initial post being threaded separately from replies) is very bad for those of us using Mailing List Mode since it appears as an unanswered question even though there are answers.
I’m hopeful someone else will have some better idea to restore Mac Mail threading, or a better workaround, or something…? Failing that, at least this documents the issue for anyone else with lots of Mac forum users.
It doesn’t make sense to have the first post be a reply of… nothing…
Are you sure Mac Mail only uses the title to do the threading? That would be a huge oversight on their part to not use the References and In-Repy-To headers…
OK, let me try to be more clear on what I was and am seeing.
The only way I have found to get Mac Mail to thread Discourse properly is:
Subject always starts with “Re:” (even the first message).
Mail messages have an “In-Reply-To” header (even the first message).
Discourse 1.7 “fixes” the second case, sensibly omitting the “In-Reply-To” on the first message, which has the side effect of breaking the threading for that first message, resulting in the first message showing up by itself, and the remainder showing up in a separate thread (perhaps separated by other topics).
When I encountered the issue previously, I tried tests with Mac Mail and the various reply/references headers and never found a good alternative solution, even with perfectly formatted headers, except for “Re:” on all messages. But perhaps someone can come up with something that works properly on Mac Mail and that makes sense for Discourse to adopt.
I am not a Mac user and opposed to the idea to break Discourse in order to help those that use a broken Mail app. “Re” has a meaning and if you just use it always, it does not have any meaning anymore. I suggest to push Apple to fix their software or use other software.
I did not suggest breaking Discourse. Discourse already supports configurable subjects, and thus has no problem with the hack to always include the “Re:” instead of optionally including the “Re”.
I’m very glad that not everyone has to care about having a large number of Mac Mail readers, and it must be nice to be so optimistic as to think that reporting an issue to Apple (which has been done years ago) would result in a fix.
But sadly, I, and my many Mac Mail using Discourse forum users, have to deal with the fact that Mail is broken in this regard and Apple is not likely to fix it, and so it would be nice if there was some solution for my forum and other similarly Mac-heavy forums.
That said, Discourse’s handling of the In-Reply-To and Message-ID headers is not correct either - if it was I might have a stronger case to take to Apple (who would still do nothing to fix the issue). The change in version 1.7 does take Discourse a step closer to having valid headers in this regard, sadly it just results in worse behaviour with Mac Mail.
In Discourse 1.7, the initial message has a Message ID of something like:
Which is referencing a message ID that never exists.
I don’t actually believe that even if this was done Mail would get the threading right, but presumably there is some set of header behaviours that would work.
Is there anywhere that explains the version numbering and what’s in what version? I had no idea 1.7 development was finished at 1.7.2. Anyway, so not until 1.8 final.