[script] dis/assembling mbox email

William Park opengeometry at yahoo.ca
Fri Jun 11 05:33:45 CEST 2004


In <comp.unix.shell> Skip Montanaro <skip at pobox.com> wrote:
> 
>     William> Time to time, I need to 
>     William>     - extract main header/body from a MIME email, 
>     William>     - parse and extract multipart segments, recursively,
>     William>     - walk through the email tree, and edit/delete/add stuffs
>     William>     - regenerate new MIME email.

>     William> Usage are 
>     William>     unmbox.sh dir < email
>     William>     mbox.sh dir > email

> You might be interested in the splitndirs.py script which is part of
> the Spambayes distribution.  There is no joindirs.py script, but it's
> perhaps a five-line script using the mboxutils.getmbox function (also
> part of Spambayes).

I think splitndirs.py is Python's version of 
    formail -s
Of course, the inverse is simply to concatenate the files, and that
would one-liner. :-)

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
No, I will not fix your computer!  I'll reformat your harddisk, though.



More information about the Python-list mailing list