gnus/nnml to mbox converter with python
François Pinard
pinard at iro.umontreal.ca
Sun Aug 12 10:55:06 EDT 2001
> I am considering writing a tool to convert mails out of the gnus/nnml
> mailspool format to ordinary mbox format (with python). Before rolling
> up the sleeves I wanted to know if something similar has been done before.
My feeling is that this should be an easy job if you want it quick.
You ignore the `.overview' file, and copy all other files, when their name
is a decimal number. I would pay attention at properly sorting the files by
numerical value. For each file copied, you need to prepend an envelope line
(the `From ' line), and postpend maybe one or two white lines. The envelope
`From ' could be any valid one, it does not need to especially relate to
the following message, as its contents is usually ignored in other tools.
However, if you want to do something more polished, like producing
read status lines in mail headers, you have to read `~/.newsrc' and
`~/.newsrc.eld' to extract the relevant information. You might also want
to clean out some Emacs generated headers, like X-Coding, X-Gnus-Mail-Source
or Xref. You decide of the level of difficulty you want :-). Most probably,
you do not need that, and it may be kept simple.
--
François Pinard http://www.iro.umontreal.ca/~pinard
More information about the Python-list
mailing list