[Mailman-Developers] Headers and footers for MIME messages

Barry A. Warsaw barry@digicool.com
Wed, 28 Mar 2001 23:15:36 -0500


I've got a bit of a dilemma that I'd like to get your opinion on.  In
MM2.1, I can be more sane about adding headers and footers to messages
that flow through a list, especially when it comes to MIME messages.
Here are the cases I've identified:

1. A message comes in that is either text/plain or has no
   Content-Type.  In that case, I can just textually prepend any
   header and append any footer.  This is essentially what MM2.0.x
   does for all messages.

2. A message comes in that's multipart/mixed.  That's easy too, since
   we can just add the header and footers as additional text/plain
   subparts.

3. A message comes in that has some other main Content-Type than
   "multipart", e.g. image/gif.  This is a little tricker, but what I
   think you can do is transform the container message into a
   multipart/mixed, add the header and footers as subparts, and create
   a new subpart for the original message payload.  You'd need to copy
   the body of the original message, plus any Content-* headers, into
   the subpart, but I think you leave all other headers in the
   container alone.

4. A message comes in that is multipart/* but not multipart/mixed.
   What to do here?  I suppose we could play the same trick as
   #3, but it seems like an awful lot of work and potentially error
   prone.  Maybe not though.  Alternatively, we could add the header
   and footer to any existing preamble and epilogue, although they'll
   get hidden by most MIME-aware MUAs.

Or we could simply not add headers and footers for #3 and/or #4.

Let's assume for the moment <wink> that MM2.1 will have facilities to
hold, discard, chop apart, etc. MIME messages and that we're talking
about messages that are allowed to go though the list untouched.

Any other suggestions?  Any preferences?
-Barry