55

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?

5

3 Answers 3

47

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.

3
  • 1
    Funny, there is a in-reply-to field, and google does not use that...
    – pihentagy
    Aug 25, 2015 at 13:15
  • 5
    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, 2017 at 8:21
  • And does anyone know if there is a way to get Gmail to accept other reply prefixes than "Re"? E-mail clients configured to use Norwegian like to use "Sv" or "Svar", which is a translation of "Reply", as prefix when replying
    – hansfn
    Aug 11, 2023 at 11:11
17

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

5
  • 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, 2010 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, 2010 at 3:03
  • i've always seen it break at 60
    – Jayen
    Jul 29, 2015 at 5:11
  • It was experimentally established (as of 2014) that subject parts in [brackets] are ignored: github.com/travis-ci/travis-ci/issues/… . Aug 3, 2017 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. May 7, 2018 at 2:24
4

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, [email protected] 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:

1
  • Really old thread but I do want to chime in that the other answers are more correct - whether or not GMail uses these at all I suppose is a question, but the subject line seems to be the actual threading data used, not the email headers shown above.
    – Dwight
    May 10, 2022 at 17:50

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