<<< Date Index >>>     <<< Thread Index >>>

Re: ARGH! Mutt 1.5. breaks attachments behind my back



On Wed, Oct 06, 2010 at 09:28:16AM -0700, Michael Elkins wrote:
On Wed, Oct 06, 2010 at 05:18:03PM +0200, Stefan `Sec` Zehl wrote:
I found an annoying bug in mutts attachment handling which took me 2
days to debug.

Whenever you attach a file of content-type "application/pgp", mutt
re-encodes every 0x0a in the file into 0x0d 0x0a before base64-encoding
and sending it.

The bug is not easily noticed, because if you save this attachment from
within mutt, it reverses this transformation.

Mutt currently assumes application/pgp parts are produced by Mutt itself, so it is attempting to canonicalize the line endings. I suppose the solution is to add a bitfield to the BODY structure where it can be indicated that the user has manually set the content-type and not perform any automatic conversion.

Actually, this is not quite right. Mutt is making the assumption that all application/pgp parts are ASCII armored, because Mutt doesn't send binary PGP messages. Thus, Mutt is performing automatic line-ending canonicalization just like it would for text/plain. Unfortunately, the application/pgp MIME type is not standard, and doesn't have any parameter to indicate whether or not the data is ASCII armored.

me