More problems with the email package raising exceptions when trying to parse non-compliant messages. Even when lax parsing is enabled, a BoundaryError is raised when trying to parse the attached spam message. I'd like to see some sort of workaround to handle these cases more gracefully when when lax parsing is enabled. This behavior seems like 'strict' parsing behavior to me.
Logged In: YES user_id=85984 As Python 2.3a2 was just released, I'm worried that this one is going to fall through the cracks before 2.3-final is released which would be unfortunate because it would mean I'd have to continue bundling my own copy of email with my applications.
Logged In: YES user_id=12800 I see what you're saying, Jason, but I don't know how Parser could do much better. You can always fall back to email.Header.HeaderParser when all else fails (well all else modulo severely broken headers).
Logged In: YES user_id=12800 HeaderParser is a parser that stops after reading just the rfc 2822 headers, leaving the entirety of the body of the message as one big text payload. Sometimes that's the best you can do.
Logged In: YES user_id=85984 Ok, I see now. I ended up replacing use of email.message_from_file() with my own implementation based upon email.Parser.HeaderParser. HeaderParser completely slipped past me. I might suggest noting it a bit more prominently in the docs, perhaps in 2.2.1 under the description of the Parser class. Even if there's some redundancy, it will help bring HeaderParser to the attention of more programmers. You can close this one out, thanks.