[bug] notmuch requires Content-Disposition mime header value to be lower case

Johannes Schauer josch at debian.org
Thu Sep 17 01:39:56 PDT 2015


Hi,

Quoting Johannes Schauer (2015-09-17 10:36:12)
> Quoting Johannes Schauer (2015-09-17 09:00:56)
> > it seems that notmuch does not put the attachment tag if:
> > 
> >         Content-Disposition: ATTACHMENT; FILENAME=flyer-vk-web.pdf
> > 
> > but it works for:
> > 
> >         Content-Disposition: attachment; filename=flyer-vk-web.pdf
> > 
> > But rfc1341 says that the value should be treated as case insensitive (section 2).
> > 
> > I got an email with upper case Content-Disposition value in an email with
> > "User-Agent: Alpine 2.11 (LSU 23 2013-08-11)".
> > 
> > Please CC me as I'm not subscribed - thanks!
> 
> the fix seems to be to:
> 
> --- a/lib/index.cc
> +++ b/lib/index.cc
> @@ -377,7 +377,7 @@ _index_mime_part (notmuch_message_t *message,
>  
>      disposition = g_mime_object_get_content_disposition (part);
>      if (disposition &&
> -       strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
> +       strcasecmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
>      {
>         const char *filename = g_mime_part_get_filename (GMIME_PART (part));
>  
> 
> but then I saw that this was already done in your git.

whoops, I confused my local git repositories.

So the attached git format patch fixes the issue and adds a test case for this.

Funnily though there seem to be some weird newline differences that I cannot
explain, so I left them for somebody else to fix.

Thanks!

cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-allow-case-insensitive-content-disposition-values.patch
Type: text/x-diff
Size: 1505 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20150917/b95b7a06/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20150917/b95b7a06/attachment.sig>


More information about the notmuch mailing list