Google Mail or Gmail threading or conversations demystified



Many of us like the mail threading or in Gamil they are also called as conversations and for those who do not like it, Google does gives us the option to disable threading. To do so, go to the General tab of your Gmail Settings, and select the radio button next to 'Conversation view off'.


 However for those of you who are interested in Gmail threading. Below is a threaded mail




Gmail threading is based on these factors. 

  1. Subject must be same or similar (it can have a prefix of Re:, Fw:)
  2. Sender must be a part of the thread OR in-reply-to must be used. (see this link for the basics) 
  3. Time from when the original was sent and its reply.

A typical header message looks as below:-

Message-ID: <13dsaf693.25715.YahooMailNeo@web126206.mail.ne1.yahoo.com>Date: Mon, 23 Sep 2013 04:44:53 -0700 (PDT)From: Divakar Nadig <xyz@yahoo.com>Reply-To: Divakar Nadig <xyz@yahoo.com>Subject: please see this dear son.....
To: * V e n u * <xyz@gmail.com>

See the below screenshot for a crash course on mails in a thread and their various components.



Advanced version explaining the flow


  • Subject line is the primary factor, which is used to gather candidate threads. The don't have to be exactly be the same, they could have Re:, Fw: and etc but no changes should have been made to the subject of the mail. 
  • These threads are then evaluated to see if the "References" fields (as in the above screenshot) of the header contain message-IDs of threads already in the mailbox. If a reference is found, it is threaded to that reference. 


  • If no references are found, it is then moved to a date-based search, and narrowed down to a list of candidates as follows:
  • The preferred option (typically conversations and automated messages):
  • The incoming message's from address is listed as a to/cc/ from address of a message in the candidate thread, and one of its to/cc addresses is also listed as a to/cc/ from address of a message in the candidate thread. If there are any candidates in the preferred option, it is not even consider the fallback candidates.
The fallback option (typically mailing lists): The from address doesn't match, but one of the incoming message's to/cc addresses is listed as a to/cc/from address of a message in the candidate thread.

If any candidate messages match one of these two options, they are evaluated based on the date of the message. We then choose to thread the message with either the nearest older message or the nearest newer message, whichever is closer, with some important provisos:


There is a different time limit for threading messages that are considered to be a reply or forward (as judged by whether or not the subject has an "re" or "fw" prefix) - these messages can be threaded together with the nearest candidate thread message if it is up to 7 days away.


If the incoming message is not an re/fwd, then we will only thread it with the nearest candidate message if it is within 12 hours away, and also if it is from the same sender.


Popular posts from this blog

Ansible - Error - stderr: E: There are problems and -y was used without --force-yes

Error: SMTPIN_ADDED_BROKEN@mx.google.com