Calling all code critics

Robin Munn rmunn at pobox.com
Tue May 20 11:13:16 EDT 2003


Sammy <sammynash at uboot.com> wrote:
> Hi, all I'm a python beginner, and my first real project I have writen
> a bit of code that is run by procmail on incomming mime emails to
> extract attachments and body text as files.
> 
> Problem is it never extracts the message body, and it fails on
> malformed emails.
> I was wondering if you python wizzards out there could suggest some
> ways for me to fix my problems and make my code more robust ie handle
> dodge formatted email.
> 
> Thanks for your help,
> 
> Sam

Not sure I can help with "malformed emails" without a lot more details.
What kind of failures are we talking about here? Exceptions? More than
one MIME section saved into a single file?

As for the not extracting the message body: I see you assigning to a
variable called "bodytext", but I never see you do anything with that
variable. You never save it, print it, etc.

Anyway, just my thoughts.

[snip code]

-- 
Robin Munn <rmunn at pobox.com>
http://www.rmunn.com/
PGP key ID: 0x6AFB6838    50FF 2478 CFFB 081A 8338  54F7 845D ACFD 6AFB 6838




More information about the Python-list mailing list