Is there a library to parse Mozilla "mork" documents?

Discussion in 'Python' started by John Reese, Jan 21, 2005.

  1. John Reese

    John Reese Guest

    Mozilla, Firefox, Thunderbird, and so forth use this awful format
    called MORK to store all kinds of things: which messages you've read
    in a newsgroup, headers and indexes into the mbox file of messages in
    a mail folder, and address books. It's documented to some extent
    here:
    http://www.mozilla.org/mailnews/arch/mork/primer.txt

    Does anyone know of a Python library for parsing these files? A
    single file basically just stores the equivalent of a nested
    dictionary with text that can be declared separately and interpolated.
    jwz has an over-specific perl version at
    http://www.jwz.org/hacks/marginal.html, which I might have to try to
    translate if there's nothing already available in Python.
    John Reese, Jan 21, 2005
    #1
    1. Advertising

  2. John Reese

    Peter Rowell Guest

    John Reese wrote:
    > Mozilla, Firefox, Thunderbird, and so forth use this awful format
    > called MORK to store all kinds of things: which messages you've read

    [ snip ]

    I was searching on a similar question (about accessing the history)
    when I came across a nifty little bookmarklet. It dumps FF history in
    RDF format to the file of your choice. This temporarily solved
    my problem, although in the long run I want to have direct read
    access to the info.

    Perhaps you can get a few ideas and go from there. The bookmarlet
    was attached to Bugzilla item 241438.
    https://bugzilla.mozilla.org/show_bug.cgi?id=241438

    HTH,
    Peter
    Peter Rowell, Jan 21, 2005
    #2
    1. Advertising

  3. John Reese

    Tim Roberts Guest

    John Reese <> wrote:
    >
    >Mozilla, Firefox, Thunderbird, and so forth use this awful format
    >called MORK to store all kinds of things: which messages you've read
    >in a newsgroup, headers and indexes into the mbox file of messages in
    >a mail folder, and address books.


    Yes. What a crock that is. The MORK format is a great way to compress
    tabular information, IF the information consists of the same pieces of data
    over and over. E-mail boxes do not fit into that class, so I have no doubt
    that the typical Thunderbird MORK file is singificantly LARGER than the
    same file would be in, say, INI format.

    I wrote a Python script to parse it, but it isn't terribly robust. I was
    able to produce a dictionary, but I didn't do anything with the results.
    You're welcome to take a look:
    http://www.probo.com/timr/parsemsf.py
    --
    - Tim Roberts,
    Providenza & Boekelheide, Inc.
    Tim Roberts, Jan 21, 2005
    #3
  4. John Reese

    John Reese Guest

    On Thu, 20 Jan 2005 23:48:34 -0800, Tim Roberts <> wrote:
    > John Reese <> wrote:
    >>
    >>Mozilla, Firefox, Thunderbird, and so forth use this awful format
    >>called MORK to store all kinds of things: which messages you've read
    >>in a newsgroup, headers and indexes into the mbox file of messages in
    >>a mail folder, and address books.

    >
    > Yes. What a crock that is. The MORK format is a great way to compress
    > tabular information, IF the information consists of the same pieces of data
    > over and over. E-mail boxes do not fit into that class, so I have no doubt
    > that the typical Thunderbird MORK file is singificantly LARGER than the
    > same file would be in, say, INI format.
    >
    > I wrote a Python script to parse it, but it isn't terribly robust. I was
    > able to produce a dictionary, but I didn't do anything with the results.
    > You're welcome to take a look:
    > http://www.probo.com/timr/parsemsf.py


    Thanks, I'll work with this. I have to say that this has all been
    worth it just to read about Jamie Zawinski railing against this file
    format. I think your comment at the top sums it up well:

    # Why am I doing this?
    John Reese, Jan 21, 2005
    #4
    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. Dennis Benzinger
    Replies:
    1
    Views:
    360
    Dan Sommers
    Jul 25, 2004
  2. Paul Boddie
    Replies:
    0
    Views:
    417
    Paul Boddie
    Jan 21, 2005
  3. Replies:
    2
    Views:
    359
    Roman Yakovenko
    Mar 17, 2006
  4. Replies:
    1
    Views:
    470
    Juan T. Llibre
    Oct 18, 2006
  5. kuangye
    Replies:
    3
    Views:
    528
    Philip Semanchuk
    Mar 13, 2011
Loading...

Share This Page