> > Your "hit me with your best shot" comment indicates that you want a > > failure code or exception when the data is bad, and then a way to > > "retry accepting errors"? > >My curent thinking is that the email module should return an object >representing a partial parse. The way that you find out if it is >partial is to try to access some data that "should" be in the object. >If the parse succeeded, the accessor returns the data (which might be >empty). If the parse did not succeed, you get an AttributeError. >(This is just a paraphrase of what I wrote in response to Oleg.)
I agree - try to extract as much intelligence as we can from the malformed message, and hold the unparseable bits in a "bad chunk" object. If possible, when reserialising the message, e-mail the bad chunk verbatim, or possibly with minor fixes to keep the containing MIME structure legal if we have to. But I'd rather see "garbage-in and same garbage-out", than "garbage-in and even worse garbage out". Maybe the parsing should lazy where possible: don't recurse deeper into the structure if all we're doing is looking at a top level header, for instance. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ _______________________________________________ Email-SIG mailing list [email protected] Your options: http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com
