From: Ansgar Wiechers on
On 2010-05-20 Jeroen Geilman wrote:
> On 05/19/2010 10:30 PM, Alex wrote:
>> Is it possible to strip the entire HTML content and pass only the
>> text? Perhaps the right way to say it would be to pass only the MIME
>> text and strip everything else?
>
> I found this fantastic little util called "mailtextbody" - it does
> just that: strips off all non-text parts and leaves a clean,
> text-only message.

Sounds interesting, but how does it handle html-only mails (i.e. mails
with no text/plain MIME part) or mails that are declared text/plain, but
contain HTML nonetheless?

Regards
Ansgar Wiechers
--
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky

From: Jeroen Geilman on
On 05/20/2010 09:31 AM, Ansgar Wiechers wrote:
> On 2010-05-20 Jeroen Geilman wrote:
>
>> On 05/19/2010 10:30 PM, Alex wrote:
>>
>>> Is it possible to strip the entire HTML content and pass only the
>>> text? Perhaps the right way to say it would be to pass only the MIME
>>> text and strip everything else?
>>>
>> I found this fantastic little util called "mailtextbody" - it does
>> just that: strips off all non-text parts and leaves a clean,
>> text-only message.
>>
> Sounds interesting, but how does it handle html-only mails (i.e. mails
> with no text/plain MIME part) or mails that are declared text/plain, but
> contain HTML nonetheless?
>
> Regards
> Ansgar Wiechers
>
Good point ;)

Mail that does not contain a text-only representation of the content may
safely be dropped, since it violates the RFCs.

Malformed messages (yes, I'm looking at you M$ Outhouse) are anotehr
matter, and will almost always cause problems - anywhere.

I'm not saying "use this, it's foolproof".

I am saying I found it, it does what it advertises, it's simple, and a
lot less hassle to configure and maintain than the various MIME* solutions.

One possible application (one we use it for, incidentally) would be to
strip out the mailtextbody and send it over a smaller medium, such as
SMS or Twitter, and keep the original mail separately.

YMMV

Gr.,

J.

From: Victor Duchovni on
On Fri, May 21, 2010 at 09:33:51PM +0200, Jeroen Geilman wrote:

> Mail that does not contain a text-only representation of the content may
> safely be dropped, since it violates the RFCs.

This is false. No RFC requires a text/plain message body.

--
Viktor.

P.S. Morgan Stanley is looking for a New York City based, Senior Unix
system/email administrator to architect and sustain our perimeter email
environment. If you are interested, please drop me a note.