Great Circle Associates List-Managers
(April 2001)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: appending to multipart/alternative messages
From: James M Galvin <galvin @ acm . org>
Date: Fri, 06 Apr 2001 22:25:58 -0400 (EDT)
To: Omar Thameen <omar @ clifford . inch . com>
Cc: list-managers @ GreatCircle . COM
In-reply-to: <20010406172212.A13082@clifford.inch.com>

I should point out that your description of how multipart/alternative
works is specific to your MUA.  Conceptually, what is supposed to happen
is that an MUA reads through the message from beginning to end, caching
the current content-type if it understands it.  It then simply stops at
the first content-type it does not understand, displays the cached
content, and then continues outside the multipart/alternative.  Thus,
adding a new last body part to the multipart/alternative would not work
in any case.

I can tell you what I do, which is not a perfect solution but works
quite well for me and my lists.  The presence of multipart/alternative
is limited on my lists.  Your mileage may vary.

The trailer is only added to either of the following two types of
messages:

1. If the message has exactly one body part and its content-type is
   text/plain.

2. If the message is multipart/digest and the first part is text/plain.

In all other situations the trailer is simply not appended.

As you realize, in a MIME world to do what you want and do it correctly
is no easy task.  In the presence of multipart/alternative you need to
be prepared to add the trailer to all possible content types.  To add
the trailer only to the (presumably first) text/plain part at a minimum
defeats the purpose and in any case is contrary to the definition of
multipart alternative.  Worse, just how do you add a trailer to any
content-type that is not text, for example a picture?

One solution I've thought about is simply taking the content (you know,
just the body) of every message and pushing it into the first part of a
multipart/mixed.  Part two would then be the trailer, of course.  This
solution is undesirable for aesthetic reasons, but is otherwise
completely legal since it leaves the original message content intact.

If I did this I was planning to be smart and first try my two rules
above.  If they didn't apply then I would do the conversion to
multipart/mixed.

Hope this helps,

Jim



On Fri, 6 Apr 2001, Omar Thameen wrote:

    Date: Fri, 06 Apr 2001 17:22:12 -0400
    From: Omar Thameen <omar@clifford.inch.com>
    To: list-managers@GreatCircle.COM
    Subject: appending to multipart/alternative messages
    
    [Resending because I forgot to obfuscate the list command words.]
    
    Greetings:
    
    I'd really like to make sure that every message that is sent out on
    lists that I host has a footer (aka trailer) message which gives 
    unzubscribe information.  The problem is that in multipart/alternative
    messages (RFC 1521), each of the parts is an "alternative" version of
    the same information.
    
    The gist is that when you add MIME part to the end of the message, 
    that's the only thing that gets displayed because of the way MUAs
    are supposed to parse the various parts.  
    
    Specifically, the parts are displayed in increasing order of complexity,
    and the MUA is supposed to start from the end and work backwards,
    displaying the first that it can.  When you add the text/plain part
    at the end, the MUA displays that and stops, since all MUAs should
    support text/plain.
    
    So my question is whether anyone has dealt with this situation or has
    any suggestions.  The options I see are hackish and unsatisfying:
    1) Adding the footer to all parts of the message.  You'd have to limit
       this to text/plain, text/richtext, and text/html.
    2) Changing the MIME encoding to text/multipart and adding the footer.
       This means that the recipient will view all versions of the message.
    
    Omar
    
    
    
    




References:
Indexed By Date Previous: appending to multipart/alternative messages
From: Omar Thameen <omar@clifford.inch.com>
Next: Re: appending to multipart/alternative messages
From: Richard Rognlie <rrognlie@gamerz.net>
Indexed By Thread Previous: appending to multipart/alternative messages
From: Omar Thameen <omar@clifford.inch.com>
Next: Re: appending to multipart/alternative messages
From: Richard Rognlie <rrognlie@gamerz.net>

Google
 
Search Internet Search www.greatcircle.com