Re: [PATCH] emacs: bugfix attachment content-type as mime-type handling

Subject: Re: [PATCH] emacs: bugfix attachment content-type as mime-type handling

Date: Wed, 31 Jul 2013 00:00:07 +0300

To: Mark Walters,


From: Tomi Ollila

On Tue, Jul 30 2013, Mark Walters <> wrote:

> Notmuch puts attachments in as declared content-type except when the
> content-type is application/octet-stream it tries to guess the type
> from the filename/extension. This means that viewing a pdf (for
> example) which is sent as application/octet-strem invokes the pdf
> viewer rather than just offering to save the part.
> Recent changes to the attachment handling (commit 1546387d) changed
> (broke) this. This patch stores the calculated mime-type with the part
> and changes the attachment part handlers can use it instead.
> ---
> This seems to fix the bug for me. I am not sure I like the naming
> (mime-type/content-type). Maybe it would be better to be explicit with
> something like calculated-content-type but probably that should be a
> more wholesale renaming.

I tested this (before and after applying the patch), using notmuch
remotely and viewing .
Before applying emacs promted me an output file, after applying xdg-open
was executed - which executed evince to show the pdf document in that email.

If this restores the behaviour that was experienced with notmuch 0.15(.2)
then this imho is a good fix to be applied quickly before 0.16 is released...

> Best wishes
> Mark