[ic] MIME header confusion for some mail clients (Eudora/PINE)

Randy Moore ramoore@axion-it.net
Thu, 01 Feb 2001 02:00:27 -0500

I've been digging into the much discussed problem of MIME headers for order 
reports (etc/report) from the demo for certain mail clients. In my case, it 
is Eudora but some PINE users have seen the same problem.

Basically what seems to happen is that with the default 'etc/report' setup, 
we only see the MIME block for the credit card number.  Our mail clients 
hide the entire order_text section.

I've figured out that this is due to the Content-Type header at the top of 
the email message (not the ones included with each MIME block).

This first Content-Type header is always:
Content-Type: multipart/alternative; BOUNDARY .......

But my understanding is that this tells the mail client to pick whichever 
of the following content type options it can best display (I could easily 
be wrong with this interpretation BTW).

So, I looked for a way to change this header to
Content-Type: multipart/mixed; BOUNDARY ......

Which (I believe) lets the mail client treat each MIME block separately.

In the "sub mime" code in Interpolate.pm, I found that there is an option 
called "attach_only", which if set would change the Content-Type appropriately.

After much experimenting, I realized that setting the "attach_only" option 
in my [tag op=mime] tags in 'etc/report' will not help because some other 
call to the 'sub mime' subroutine is setting this first MIME tag.

I found it in Order.pm, at line 1877:
$mime = Vend::Interpolate::mime('header', {}, '') if $use_mime;

But from this there is no run-time way of setting the "attach_only" option.

I can (and did) change this line to:
$mime = Vend::Interpolate::mime('header', {attach_only => 1}, '') \
	if $use_mime;

This worked perfectly for me, but is clearly not what was intended for 
general use.

BTW, I know I could simply remove all the MIME tags from 'etc/report' and 
Eudora would get along just fine, but I'm interested in a more universal 
solution here (a demo that works for everyone).

So does any one know of a general solution out of this? I don't know what 
(if any) problems there would be if the default Content-Type were changed 
from multipart/alternative to multipart/mixed.

Suggestions anyone?
Randy Moore
Axion Information Technologies, Inc.

email     ramoore@axion-it.net
phone   301-408-1200
fax        301-445-3947