[Mailman-i18n] Re: Add header/footer to MIME multipart
Martin Ramsch
m.ramsch@computer.org
Wed Nov 13 01:24:18 2002
Barry A. Warsaw <barry@python.org> wrote:
> | Another option for MIME multipart messages is to embed the
> | message parts into a _new_ multipart/mixed structure which
> | contains
> | 1st the header as text/plain, then
> | 2nd all parts of the message itself, then
> | 3rd the footer as text/plain.
[...]
> My main reservation about doing this is about the best way to craft
> this new outer multipart/mixed message. In all the other cases, we're
> basically keeping the outer chrome intact, e.g. the headers from the
> originally sent message are basically passed through.
The same is possible here!
You keep _all_ of the original header lines, just changing the
MIME header lines, basically
Content-Type
and Content-Length
Example, imagine you'd have this mail:
Recieved: blablabla 1
Recieved: blablabla 2
...many more headers...
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Some text about the Euro =A4
To add header and footer text as seperate MIME parts, you _just_
change the Content-Type header here (and delete or update
Content-Length header, if present):
Recieved: blablabla 1
Recieved: blablabla 2
...many more headers...
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="choosesomethingunique"
Put some explanatory text here for non-MIME-conformant mail clients.
--choosesomethingunique
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Here goes the header text, with some schöne Umlauts, if you like
--choosesomethingunique
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Some text about the Euro =A4
--choosesomethingunique
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Here goes the footer text
--choosesomethingunique--
So it's pretty simple: just move the MIME header lines down into
its new seperate part, leave all other header lines alone!
Not too difficult :-)
Regards,
Martin
PS: I just had a beer (or was it two, or four?) so fergive me
any writing mitakes :)
More information about the Mailman-i18n
mailing list