Mailing List Archive

gnus/nnml to mbox converter with python
Hi,

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.

tia, Ulf

--
gpg public key at http://www.keyserver.net/
gnus/nnml to mbox converter with python [ In reply to ]
>>>>> "Ulf" == Ulf Kister <ulf.kister@t-online.de> writes:

Ulf> Hi,

Ulf> I am considering writing a tool to convert mails out of the
Ulf> gnus/nnml mailspool format to ordinary mbox format (with
Ulf> python).

Ulf> Before rolling up the sleeves I wanted to know if something
Ulf> similar has been done before.

You'll be glad you asked!

Gnus can do this for you.

Check this one out:

(Info-goto-node "(gnus)Mail Group Commands")

In particular:

`B r'
Respool the mail article (`gnus-summary-respool-article').
`gnus-summary-respool-default-method' will be used as the default
select method when respooling. This variable is `nil' by default,
which means that the current group select method will be used
instead. Marks will be preserved if GNUS-PRESERVE-MARKS is
non-`nil' (which is the default).

Ulf> tia, Ulf

Ulf> --
Ulf> gpg public key at http://www.keyserver.net/

--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
gnus/nnml to mbox converter with python [ In reply to ]
> 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
gnus/nnml to mbox converter with python [ In reply to ]
Hi,

thanks for the hints. From comp.emacs.xemacs I received another one,
pointing me to a gnus built-in functionality (slightly blushing :-)
and grepmail( http://grepmail.sourceforge.net/) which is written in
the wrong language for me (PERL), but ready-to-use.

pinard@iro.umontreal.ca (François Pinard) writes:

> [useful tips]

thanks, Ulf
--
gpg public key at http://www.keyserver.net/