Converting Sympa GET-ed digests to mbox for swaml processing

Sympa (the mailing-list manager) can send you digests of previous posts with the GET command (also useful the LIST command).

The messages are not in mbox format that could be processed directly by swaml, but as a multipart digest email containing all the past emails sent to the list as MIME attachments.

I adapted the mailextract.py script (here’s the patch) to produce a file that’s almost a mbox, which can then be processed by formail (a procmail‘s command, with formail -ds) to reconstruct a proper mbox.

Here’s then the command-line to obtain a mbox :
python mailextract.py -u source_of_get-ed_email | formail -ds >archive.mbox

Then swaml can be used to process that mbox, in order to obtain RDF documents for the mailing-list posts.

Easy 😉