On Thu, Apr 30, 2020 at 03:27:29PM +0100, Sam Kuper wrote: > Unfortunately, one of the weaknesses in Python's email handling (which > might be related to some ambiguities or flaws in the RFCs on which they > are based - I'm not sure) relates to the problem of identifying a > "primary" (for want of a better word) text/plain part.
It's not a weakness in Python, per se. There isn't such a thing. That's one of the points I was trying to make before. MIME allows for the BODY of your message to be literally anything. You can't hueristically determine what the "main" part is because it doesn't exist, except in the minds of the humans who interact with the message... and as we've seen, their ideas about what the main part is may differ. And in any event, you can not do this without potentially losing some information that is important, since many such messages will have plain text parts that contain only garbage, where the actual content is only in the HTML part (or even some other piece). [The tools could assume the first plain-text part is the "main" part, and that would be a reasonable assumption, but some of the time it will be wrong.] A likely better option is to compress the folder. If HTML truly is the bloat, it should compress very efficiently. -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 -=-=-=-=- This message is posted from an invalid address. Replying to it will result in undeliverable mail due to spam prevention. Sorry for the inconvenience.
signature.asc
Description: PGP signature