I've develop webmail client for any mail server.
I want to implement message conversion for it — for example same emails fwd/reply/reply2all should be shown together like gmail does... 
My question is: what's the key to find those emails which are either reply/fwd or related to the original mail....
Google just seems to chain messages based on the subject line (so does Apple Mail by the way.)
How to maintain mail conversion (reply / forward / reply to all like gmail) of email using Python pop/imap lib?