Page MenuHomePhabricator

First mail sent by Differential doesn't have a Message-ID header set properly
Closed, WontfixPublic

Description

In order for threading to work in email clients, the Message-ID header needs to be set on the initial email, with following emails having In-Reply-To / References set to that same Message-ID.

While this works properly for Maniphest, in the case of Differential the first message sent by Phabricator oddly doesn't do this properly. Instead, the first mail looks like a reply (having In-Reply-To / References headers, etc).

I've taken a look through the Phabricator source code and can't see anything immediately wrong or which would explain this behaviour. My suspicion is that reviews already exist prior to them being confirmed and the first mail being sent. This was working properly back in May, and had broken by June in case that helps with debugging.

An example message showing this is attached.

Event Timeline

I can't reproduce this: mail threads properly in my client.

In order for threading to work in email clients, the Message-ID header needs to be set on the initial email, with following emails having In-Reply-To / References set to that same Message-ID.

I also assert that this claim may be broadly untrue even about whichever client you're using, since it would prevent that client from threading properly if you were added to a thread partway through. In this case, you will never receive the message with the original Message-ID that started the thread. Presumably, however, your client handles this case properly.

In my case (using GMail) it appears to thread properly as well however apparently some clients (KMail) rely on these headers more heavily than others.

I've noticed that threading is broken with GMail though when the subject of the message changes, which correcting this may allow to operate correctly (my guess is that similar subjects get threaded in GMail as a fallback for mismatched headers like this)

In regards to the case where the initial messages are missing, I agree there isn't much we can do there, but it would be nice for the initial "Revision Created" message to have the Message-ID set correctly (and to not have In-Reply-To / References as it's the first message in the chain) for those clients that prefer to rely on those headers.

epriestley closed this task as Wontfix.Jan 2 2019, 3:39 PM
epriestley claimed this task.

It seems like any client which has this behavior must always break when a user is added to an existing thread (via, for example, "Reply All" + add them as a "Cc"). I think we're either missing something significant, or those clients (possibly just KMail?) aren't handling this situation correctly and this is a bug which should be fixed in those clients rather than Phabricator.

Regardless of our initial-email behavior, we'll encounter this situation if a user is added as a reviewer or subscriber later in an object's lifespan. This is a common occurrence.

If this is broken client behavior, I don't want to work around it in Phabricator (instead: report the issue to the maintainer of your mail client).

If this isn't broken client behavior, I think we must be missing something -- which might point at a different resolution. I don't know what the missing information is and don't have a reproduction case ("use KMail?") in order to figure it out. (If the reproduction case is just "use KMail", it feels like this is likely to be a KMail issue.)