4

I want to create a gmail client with the ability to view emails as conversations (threads). In imaplib, there is a method: IMAP4.thread(threading_algorithm, charset, search_criterion[, ...]) I think it could be the solution. Anybody has experience using it? Please give an example. Thanks.

Acorn
  • 49,061
  • 27
  • 133
  • 172

2 Answers2

1

That method is simply a wrapper to the IMAP4rev1 extension THREAD command. Have a look at this link which describes how that IMAP command works: https://www.rfc-editor.org/rfc/rfc5256

However, I'm not sure that Gmail actually implements the THREAD command. If it does, it should list 'THREAD=' among its capabilities.

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
Martin Melin
  • 111
  • 1
0

As far as I know, Gmail uses an algorithm that is private, and it's not stated in RFCs.

They use a combination of headers (like in-reply-to and references) and considering subject (but in a different way that THREAD=references does).

Mark Amery
  • 143,130
  • 81
  • 406
  • 459