[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Rewriting the Content-Type header with exim/procmail? - Solved!



From: "Marc Sherman" <msherman@projectile.dyndns.org>

> When I read pgp-signed mail sent from Mutt with Outlook
> Express 5 on a windows box, outlook interprets the body
> of the message as a text attachment, and displays no
> body for the message.
>
> I suspect that this is because Mutt is sending the message
> with the Content-Type header as:
> Content-Type: multipart/signed; micalg=pgp-md5;
>  protocol="application/pgp-signature"; boundary="some_random_junk"
>
> while Outlook sends (and presumably expects to receive)
> mail with the Content-Type header as:
> Content-Type: multipart/mixed;
>  boundary="----=_NextPart_000_005C_01BF77BC.205C4C60"
>
> My mail is being sent to a debian (frozen) machine
> running exim, and I'm reading it on a windows box
> using pop3.  Is there any filter I can install in
> exim (or procmail) on the debian machine which can
> take mail with a Content-Type of multipart/signed,
> and rewrite that header as Content-Type: multipart/
> mixed, dropping the micalg and protocol attributes
> but keeping the same boundary attribute?

I figured this one out on my own.  Here is the system
filter I wrote for exim to rewrite the Content-Type
header to use multipart/mixed instead of multipart/signed:

# Exim filter
if $header_Content-Type: matches
"(multipart/signed.*(\n\t.*)*boundary=)(.*)" then
    headers add "Content-Type: multipart/mixed; boundary=$3"
endif

You end up with two Content-Type headers in the mail, but
that's ok -- the 2nd one (which we just added) takes precedence.

- Marc



Reply to: