On 28 Dec 2015, at 23:16, Marc Perkel wrote:
I'm looking for a script to extract readable text from emails. I want
it demimed, ignore html, images, etc. What I'm looking for is just the
readable text (real words). Mostly just need to extract about the
first 200 characters of real text.
Can someone point me in the right direction?
You might be able to adapt or wrap the mimeprint script from the
examples includes in the Perl MIME-Tools package. It can disassemble and
decode all parts of a message for you.
Of course, there's no guarantee that a message *has* a meaningful text
body, or that the text part of a multipart/alternative message resembles
what a common MUA will show a user by rendering the HTML part.