Subject: HTML mode

From: Dan Peterson <[email-masked]>
Date: Tue, 17 Oct 2000 10:59:10 -0400 (Eastern Daylight Time)

I frequently receive email that's in HTML format, but the email client
neglected to use the correct Content-Type header (text/html), instead the
Content-Type header is usually missing.

Pine sees this as plain text (as it should) and displays the entire
message including all the HTML tags.  I realize this is the correct
approach, but it isn't really the friendly approach.

I'm wondering if there's an option or configuration flag I can set to get
pine to try a little harder to interpret HTML content that isn't marked as
such?

Or, maybe there's a command I'm missing, similar to the "h" (view headers)
toggle.  That would force the page to be viewed as HTML even if the
Content-Type is missing or not "text/html"?

--
---------------------------------------------------------------
 Dan Peterson ([email-masked]) - AOL, Dulles, VA  703-265-0226
---------------------------------------------------------------

-- 
-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------

---

From: "Mike A. Harris" <[email-masked]>
Date: Tue, 17 Oct 2000 14:52:12 -0400 (EDT)

On Tue, 17 Oct 2000, Dan Peterson wrote:

>Date: Tue, 17 Oct 2000 10:59:10 -0400 (Eastern Daylight Time)
>From: Dan Peterson <[email-masked]>
>To: Pine Discussion Forum <[email-masked]>
>Content-Type: TEXT/PLAIN; charset=US-ASCII
>Subject: HTML mode
>

You could use "procmail" to preprocess messages.  You'd need a
procmail recipe that detects an all-HTML message body with no
content header, it then would add the header for you.

I have no idea an exact procmail recipe to do this, but some
piping through the unix "file" command might determine if it is
HTML or not, for messages lacking a content type header.

This would be a better question on the procmail mailing
list.  Someone would probably write it for you too.

Good luck,
TTYL

----------------------------------------------------------------------
      Mike A. Harris  -  Linux advocate  -  Open source advocate
              Computer Consultant - Capslock Consulting
                 Copyright 2000 all rights reserved
----------------------------------------------------------------------

[Quote: Linus Torvalds - Aug 27, 2000 - linux-kernel mailing list]
"And I'm right.  I'm always right, but in this case I'm just a bit more
right than I usually am." -- Linus Torvalds

---

From: Eduardo Chappa <[email-masked]>
Date: Tue, 17 Oct 2000 12:14:52 -0700 (PDT)

*** Dan Peterson ([email-masked]) wrote today:

:) I frequently receive email that's in HTML format, but the email client
:) neglected to use the correct Content-Type header (text/html), instead the
:) Content-Type header is usually missing.
:)
:) I'm wondering if there's an option or configuration flag I can set to get
:) pine to try a little harder to interpret HTML content that isn't marked as
:) such?

Hello Dan,

  Something you can try to see how it works for you is to use
"display-filters". You can make some educated guesses like "if the first
string of a line is <HTML>, then the message is a message in text/html
format". Of course the guess can be incorrect, but it works most of the
times. All you would need to do is add the following text to your
sending-filters configuration option:

_BEGINNING(<HTML>)_ /usr/local/bin/lynx -force_html _TMPFILE_

and after that

_BEGINNING(<html>)_ /usr/local/bin/lynx -force_html _TMPFILE_

That will take care of most of the messages.

  Now, about the disadvantages of this method.

 - The filter will be activated when you intend to reply the message, that
is to say, you'll run lynx when you want to reply to the message.

 - If a message is not in text/html format it will still be processed by
lynx if the filter is activated and the output may look ugly.

 In any case above, after quitting lynx you'll see the unprocessed
message, so you won't lose anything and may have gained something.

-- 
Eduardo
http://www.math.washington.edu/~chappa/pine/

---

From: Ed Arnold <[email-masked]>
Date: Wed, 18 Oct 2000 10:14:00 -0600 (MDT)

> pine to try a little harder to interpret HTML content that isn't marked as

I have an associated question about this I've asked before but not gotten
an answer to, thought I'd try again in case someone has an answer.

Even when there is a correct "Content-Type: text/html", I find that
netscape (specifically netscape-4.6) refuses to display an HTML
attachment because the temp file which pine saves does not have a
suffix of ".html".  When pine sees the following .mailcap entry (this
on unix):

text/html; netscape %s; description="HTML"

... it saves the text/html attachment as a pseudo-random filename
(in /var/tmp, as I recall) which does not have ".html" on the end,
then hands that off to netscape.  Consequently netscape can't determine
that the file is HTML.

Anyone know a way around this?

---

From: Dan Peterson <[email-masked]>
Date: Thu, 19 Oct 2000 16:35:56 -0400 (Eastern Daylight Time)

On Tue, 17 Oct 2000, Eduardo Chappa wrote:

> "display-filters". You can make some educated guesses like "if the
> first string of a line is <HTML>, then the message is a message in
> text/html format". Of course the guess can be incorrect, but it works
> most of the times. All you would need to do is add the following text
> to your sending-filters configuration option:
> 

Hmmm, I'm a bit confused, you mention display-filters at first, then
switch to sending-filters.  Was that just a typo?

I'm using PC-PINE, so I'd need to do make the display-filter command do
something different, since I don't have lynx.  Perhaps a perl script that
just looked at the message and added the correct Content-Type header?  Or
does the display-filter even get the headers?

As for sending-filter, I'm really not interested in changing the text when
I send it... at least that wasn't my original question.  All I want to be
able to do is VIEW an email that contains HTML, but does NOT use a
Content-Type of "text/html" (perhaps no Content-Type at all).

Since Pine is already capable of displaying the HTML, it would sure be
nice if there was some toggle (like the show headers toggle), that said
"View this message as if it's HTML... regardless of the Content-Type"...
maybe like "^H".

I wonder if there's any possibility something like that could be included
in the imminent 4.3x release. :-)

---

From: Gopi Sundaram <[email-masked]>
Date: Thu, 19 Oct 2000 17:05:15 -0400 (EDT)

> switch to sending-filters.  Was that just a typo?

Yes. It should be display filters all the way through.

> I'm using PC-PINE

You may not be able to use filters, because the Pipe command does not
work correctly on PC-Pine. I could be wrong on this point though.

Gopi.

-- 
Gopi Sundaram
[email-masked]
http://www.cse.sc.edu/~gopalan/Pine/