Building email threads from unix mailboxes

Discussion in 'Python' started by Jed Parsons, Oct 18, 2004.

  1. Jed Parsons

    Jed Parsons Guest

    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?

    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.)

    Thanks for any tips,

    Jed
     
    Jed Parsons, Oct 18, 2004
    #1
    1. Advertising

  2. > 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?


    To be RFC 2822 compliant, In-Reply-To and References are sufficient.
    Other clients may add more headers, and not all clients are RFC 2822
    compliant.

    - Josiah
     
    Josiah Carlson, Oct 18, 2004
    #2
    1. Advertising

  3. Jed Parsons

    Jed Parsons Guest

    Thanks.

    Is the References header a running list of all the In-Reply-To headers
    so far in the thread?
     
    Jed Parsons, Oct 19, 2004
    #3
  4. Jed Parsons wrote:

    > Is the References header a running list of all the In-Reply-To headers
    > so far in the thread?


    It depends on the service. Some only keep a few of the last references,
    some only one, some retain the full list from the very beginning (at
    least as far as the RFC will allow).

    Probably if you wanted to handle robust threading, you'd want to go by
    In-Reply-To and References, backtracking manually (rather than relying
    on any given References list to be complete), and then, for systems like
    mail-to-news gateways which may break the In-Reply-To/References chain,
    group by similar subjects posted around the same time.

    --
    __ Erik Max Francis && && http://www.alcyone.com/max/
    / \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
    \__/ Love is the triumph of imagination over intelligence.
    -- H.L. Mencken
     
    Erik Max Francis, Oct 19, 2004
    #4
  5. Jed Parsons

    Mark Rowe Guest

    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?


    <http://www.jwz.org/doc/threading.html> has a good write-up about the
    threading algorithm used by Netscape Mail and News 2.0 and 3.0, and
    Grendel (<http://www.mozilla.org/projects/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 <http://www.amk.ca/python/code/jwz>.

    > Thanks for any tips,
    >
    > Jed


    Regards,

    Mark Rowe
    <http://bdash.net.nz/>
     
    Mark Rowe, Oct 19, 2004
    #5
  6. Jed Parsons

    Jed Parsons Guest

    Awesome! Thanks so much.

    j
     
    Jed Parsons, Oct 19, 2004
    #6
  7. Matthew Dixon Cowles, Oct 19, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Parsing mailboxes

    , Aug 24, 2004, in forum: Perl
    Replies:
    1
    Views:
    462
    Steve Bennett
    Aug 27, 2004
  2. Grzegorz Adam Hankiewicz
    Replies:
    3
    Views:
    375
    Andrew Dalke
    Jul 13, 2003
  3. Grzegorz Adam Hankiewicz
    Replies:
    0
    Views:
    339
    Grzegorz Adam Hankiewicz
    Jul 26, 2003
  4. Sorting Unix mailboxes

    , Sep 13, 2005, in forum: Python
    Replies:
    3
    Views:
    378
    Gregory K. Johnson
    Sep 16, 2005
  5. harold barker

    Sorting Unix mailboxes

    harold barker, Aug 4, 2007, in forum: Python
    Replies:
    0
    Views:
    311
    harold barker
    Aug 4, 2007
Loading...

Share This Page