Sometimes I'll notice false positives (includes an email that isn't part of the thread) and false negatives (misses an email that should have been part of the thread). How does Gmail decide which messages should and shouldn't be part of a thread?

up vote 43 down vote accepted

The following conditions must be met:

  1. The subject must be similar (e.g. test and re: test will work; but test and test 123 won't).
  2. The sender must be a part of the thread OR the in-reply-to header must be used.

The in-reply-to header can be used via Gmail's interface by simply replying to the thread. This is what enables forwarded messages to be a part of the same thread even though the sender is different.

If you want more information, you can check out my blog post where I posted more detailed information about my findings.

  • 1
    Funny, there is a in-reply-to field, and google does not use that... – pihentagy Aug 25 '15 at 13:15
  • 4
    See this answer over on Quora - he says it is threaded by use of the Message-ID: header. Does anyone KNOW for sure how gmail decides to thread conversations? – yosh m Apr 23 '17 at 8:21

The short answer: the subject line.

Google states:

a conversation will break off into a new thread if the subject line of the conversation is changed, or if the conversation reaches over 100 messages.

More info from Google

  • Yes, that is what also says in the second link I provided. I though it would be good to also give some background on the whole matter :) – feniix Jul 1 '10 at 19:49
  • I've seen it break between 60 and 80, so I'm not sure how reliable that article is. But it's close. – dgw Aug 3 '10 at 3:03
  • i've always seen it break at 60 – Jayen Jul 29 '15 at 5:11
  • It was experimentally established (as of 2014) that subject parts in [brackets] are ignored: github.com/travis-ci/travis-ci/issues/… . – Beni Cherniavsky-Paskin Aug 3 '17 at 11:43
  • Not sufficient. If I have two people respond to the same Kijiji ad the subject line is identical, but they aren't in the same thread unless they are within a certain time window -- more than an hour less than 2 days. – Sherwood Botsford May 7 at 2:24

There are headers in an email message which contain information about which thread the email message belongs to. I don't know for sure that Gmail uses these headers, but I would be very surprised if it didn't. You can see the headers of an email message in Gmail.com by clicking the three dots and then "Show original".

If those headers don't exist, I presume Gmail will then fall back to guessing based on the subject line.

Relevent email headers:

  • Message-ID: every email message can include this header, and it is used to identify that email message uniquely. It can look like anything as long as it is unique, for instance, 199802242058.MAA24843@monk.via.net is a valid Message-ID.
  • In-Reply-To: this will contain the message ID of the email message that the current message is in response to. Gmail can use this information to put the message in the correct conversation.
  • References: this will contain a list of all the message IDs of all the previous emails in the conversation, according to the software that sent the email message. This is more durable than In-Reply-To, in case the recipient doesn't have the previous message in the conversation, but does have some of the messages before that.

References:

protected by Community Sep 18 '17 at 19:54

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.