]> git.notmuchmail.org Git - notmuch/commitdiff
lib: content disposition values are not case-sensitive
authorJani Nikula <jani@nikula.org>
Sat, 26 Sep 2015 09:35:21 +0000 (12:35 +0300)
committerDavid Bremner <david@tethera.net>
Thu, 19 Nov 2015 11:47:29 +0000 (07:47 -0400)
Per RFC 2183, the values for Content-Disposition values are not
case-sensitive. While at it, use the gmime function for getting at the
disposition string instead of referencing the field directly.

This fixes "attachment" tagging and filename term generation for
attachments while indexing.

lib/index.cc
test/T190-multipart.sh

index e81aa81902883b56f30b01e0aafa2476d8622737..f166aefd2fc1f6f6c5ea1e306e4fc033ead09c59 100644 (file)
@@ -377,7 +377,8 @@ _index_mime_part (notmuch_message_t *message,
 
     disposition = g_mime_object_get_content_disposition (part);
     if (disposition &&
 
     disposition = g_mime_object_get_content_disposition (part);
     if (disposition &&
-       strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
+       strcasecmp (g_mime_content_disposition_get_disposition (disposition),
+                   GMIME_DISPOSITION_ATTACHMENT) == 0)
     {
        const char *filename = g_mime_part_get_filename (GMIME_PART (part));
 
     {
        const char *filename = g_mime_part_get_filename (GMIME_PART (part));
 
index 1caf6831b7c0ed01fe7000260f00ac801539e265..35678909b0ce110ca650c108a9478aae4139e5dd 100755 (executable)
@@ -764,7 +764,6 @@ output=$(notmuch search from:todd and mimetype:multipart/alternative | notmuch_s
 test_expect_equal "$output" "thread:XXX   2014-01-12 [1/1] Todd; odd content types (inbox unread)"
 
 test_begin_subtest "case of Content-Disposition doesn't matter for indexing"
 test_expect_equal "$output" "thread:XXX   2014-01-12 [1/1] Todd; odd content types (inbox unread)"
 
 test_begin_subtest "case of Content-Disposition doesn't matter for indexing"
-test_subtest_known_broken
 cat <<EOF > ${MAIL_DIR}/content-disposition
 Return-path: <david@tethera.net>
 Envelope-to: david@tethera.net
 cat <<EOF > ${MAIL_DIR}/content-disposition
 Return-path: <david@tethera.net>
 Envelope-to: david@tethera.net