Subject: Sending HTML attachments

From: "Srikanth V. Vallabhaneni" <[email-masked]>
Date: Thu, 1 Jul 1999 15:17:06 +0530 (IST)

Hi all,

I use Pine 4.10 for Solaris and am facing a problem *sending* HTML
attachments. 

When I send a HTML attachment, Pine attaches it with 'Content-type
header: text/plain' When the recepient tries to open the attachment by
clicking on it, Netscape's browser for instance, seems to interpret the
attached html file as a text file by reading the 'Content-type header'
and displays the html source instead.

While sending a mail, is there a way to configure Pine to attach a HTML
file, with the Content-type header 'text/html', so that browsers can
interpret the attachment correctly?

I've searched through the Pine-Info archives but haven't found a 
suitable solution. Any help will be sincerely appreciated.

-- 
Thanks in advance,
Srikanth

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

---

From: Satya <[email-masked]>
Date: Fri, 2 Jul 1999 00:17:56 +0530 (IST)

> I use Pine 4.10 for Solaris and am facing a problem *sending* HTML

i dont know about solaris, but on my rh5.2 it says (see below)

> and displays the html source instead.

quoted from
/usr/doc/pine-4.04/tech-notes/low-level.html#MIME-send :

   When an attachment is to be sent, Pine sniffs through it to try to set
   the right label (content-type and subtype). An attachment with any
   lines longer than 500 characters in it or more than 10% of the
   characters are 8-bit it will be considered binary data. Pine will
   recognize (and correctly label) a few special types including GIF,
   JPEG, PostScript, and some audio formats. Another method which can be
   more robust and flexible for determining the content-type and subtype
   is to base it on the file extension. This method uses a [16]MIME.Types
   File.

So you'd have to check your mime.types file. dunno where it is on solaris.

And from
/usr/doc/pine-4.04/tech-notes/config-notes.html#mime.types :

   Pine's MIME-TYPE support is based on code contributed by Hans Drexler
   &LT;[email-masked]&GT;. Pine assigns MIME Content-Types according to
   file name extensions found in the system-wide files
   /usr/local/lib/mime.types and /etc/mime.types, and a user specific
   ~/.mime.types file.

So you could check you ~/.mime.types

I'm sorry if i've stepped on anyone's toes, please don't lart me too badly
:)

-- 
Satya.
Freelance website designer and CGI/Perl programmer.
http://satyaonline.cjb.net/

---

From: "Srikanth V. Vallabhaneni" <[email-masked]>
Date: Fri, 2 Jul 1999 21:27:17 +0530 (IST)

Hi Satya,

Thanks for the pointer. 

I came across a section about sending messages in MIME in which my
question has almost been answered. It also seems to rule out the
mime.types file as a possible answer to my question. This is from:

http://www.washington.edu/pine/tech-notes.4.04/low-level.html#MIME-send

and it says...

'If it is not binary data (has only a small proportion of 8-bit 
characters in it,) the attachment is considered 8-bit text. 8-bit text
attachments are labeled "text/plain" with charset set to the value of
the user's character-set variable. If an attachment is ASCII (no 8-bit
characters) and contains no ESCAPE, ^N, or ^O characters (the characters
used by some international character sets), then it is considered plain
ASCII text. Such attachments are given the MIME label "text/plain;
charset=US-ASCII", regardless of the setting of the user's character-set
variable.' 

I am still wondering if anyone has come across a workaround where one
can distinguish between plain text and HTML files while sending mails. 

-- 
Thanks,
Srikanth

---

From: Terry Gray <[email-masked]>
Date: Fri, 2 Jul 1999 09:29:25 -0700 (Pacific Daylight Time)

Are you saying that you tried the mime.types suggestion and it didn't
work?  Or is your complaint that the section you cite below doesn't refer
to the mime.types override?

-teg

---

From: "Srikanth V. Vallabhaneni" <[email-masked]>
Date: Fri, 2 Jul 1999 22:15:25 +0530 (IST)

My mimetype search path points to my home directory and my .mime.types
file in the same directory has the following entry:

text/html   html htm

But in spite of that, when I try to attach a html file, it still
interprets it as a plain text file and defines 'content-type' as
text/plain 

My question is:

Going by that what I've observed and what the section says, it seems 
to suggest that the .mime.types file will be overridden by the content
of the attachment. Am I right here? 

and if I am, is there a workaround to define the 'content-type' header
for a html attachment as text/html rather than text/plain so that
external browsers can correctly interpret the attachment as a html
file and not a text file?
 
-- 
Thanks,
Srikanth

---

From: Satya <[email-masked]>
Date: Fri, 2 Jul 1999 22:40:27 +0530 (IST)

well, i'm not really surprised that pine thinks it's a plain text file,
considering that that's precisely what it is. it's the extension (.htm or
.html) that makes the difference -- that, and the markup. i really think
you should match the file's extension with what all the *mime.types files
on your system say.

---

From: Terry Gray <[email-masked]>
Date: Fri, 2 Jul 1999 10:13:48 -0700 (Pacific Daylight Time)

> of the attachment. Am I right here? 

No, I do not believe that was the intent.  Moreover, I just took a zip
file, renamed it to have a .html extension and attached it.  It was marked
as text/html.

Suggest running pine -d 9, doing a compose and attach, and then examining
the resulting .pine-debug1 file for evidence that the mime.types file was
processed or not.

-teg

---

From: "Daniel Sands" <[email-masked]>
Date: Fri, 2 Jul 1999 12:18:43 -0600

> file, renamed it to have a .html extension and attached it.  It was marked

I believe what he is talking about is if you rename a short ASCII text
document to .html and then attach it.  According to the description he cited,
this will be attached as "text/plain" without even referencing the mime-types
file.

---

From: "Srikanth V. Vallabhaneni" <[email-masked]>
Date: Fri, 2 Jul 1999 23:58:56 +0530 (IST)

> the resulting .pine-debug1 file for evidence that the mime.types file was

Running pine -d9 revealed the culprit. Turns out that pine was looking
at the wrong mime.types file. I was finally able to change the 
content-type to text/html.

Thanks much, Terry.

-Srikanth

---

From: "Eduardo Chappa L." <[email-masked]>
Date: Tue, 6 Jul 1999 11:28:53 -0700 (PDT)

I did the experiment of attaching a html file, with the mime file
pointing to a valid .mime file, which was read by pine and pine displayed a
message saying the attachment was a text/HTML file. Good it works!, however
I sent the message to myself and the attachment says it is a "text/PLAIN"
file. I think this result is not what was intended. Where is the problem?

Eduardo
http://www.math.washington.edu/~chappa/personal.html

---

From: Terry Gray <[email-masked]>
Date: Tue, 6 Jul 1999 11:40:12 -0700 (Pacific Daylight Time)

> file. I think this result is not what was intended. Where is the problem?

Eduardo, 
Do you mean that the message you sent to yourself ended up in your inbox
with the attachment labelled text/plain, even though Pine said it was
attaching it as text/html when you were sending it?  If so, pls check the
copy in your sentmail folder and see what it looks like.  Also you might
re-test with maximum debugging -d 9 and see if the .pine-debug1 shows any
anomolies. Feel free to send an example of the problem and any supporting
data to [email-masked]

-teg