Building email threads from unix mailboxes

Mark Rowe at
Tue Oct 19 09:01:27 CEST 2004

On Oct 19, 2004, at 11:24 AM, Jed Parsons wrote:

> What headers to I have to know about to build thread trees from Unix
> mailboxes?
> Is it enough to get the In-Reply-To header for each message and build a
> dictionary of { Message-ID: message } pairs?  Or is it more complicated
> than that?

<> has a good write-up about the 
threading algorithm used by Netscape Mail and News 2.0 and 3.0, and 
Grendel (<>). Jamie Zawinski 
was responsible for the design of Netscape Mail and News 2.0 and 3.0.

> If there isn't already a module to do this (and apologies if there is
> one and I don't know about it), are the current tools of choice the
> 'email' and 'mailbox' modules?  (And I guess I'd want to use the mime
> decoding tools in 'email' to deal with messages that come with
> attachments or html or other stuff.)

A.M. Kuchling has made a Python implementation of JWZ's algorithm 
available at <>.

> Thanks for any tips,
> Jed


Mark Rowe

More information about the Python-list mailing list