Re: [PATCH v2] Omit User-Agent: header by default
[notmuch-archives.git] / e1 / 8a13ad395db124f5ca975a42657cbabeb78ac6
1 Return-Path: <todd@electricoding.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id B1441431FDB\r
6         for <notmuch@notmuchmail.org>; Thu, 15 Jan 2015 16:31:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 2.438\r
11 X-Spam-Level: **\r
12 X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
13         tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id Ub8JKbFtX-7o for <notmuch@notmuchmail.org>;\r
17         Thu, 15 Jan 2015 16:31:06 -0800 (PST)\r
18 Received: from s75.web-hosting.com (s75.web-hosting.com [198.187.31.9])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id DE37A431FDA\r
22         for <notmuch@notmuchmail.org>; Thu, 15 Jan 2015 16:31:04 -0800 (PST)\r
23 Received: from user-69-73-37-128.knology.net ([69.73.37.128]:60097\r
24         helo=localhost.localdomain)\r
25         by server75.web-hosting.com with esmtpsa (UNKNOWN:AES128-SHA256:128)\r
26         (Exim 4.82) (envelope-from <todd@electricoding.com>)\r
27         id 1YBuoZ-003S2e-W3; Thu, 15 Jan 2015 19:31:04 -0500\r
28 From: Todd <todd@electricoding.com>\r
29 To: notmuch@notmuchmail.org\r
30 Subject: [PATCH v3 3/5] Add indexing for the mimetype term\r
31 Date: Thu, 15 Jan 2015 18:30:27 -0600\r
32 Message-Id: <1421368229-4360-3-git-send-email-todd@electricoding.com>\r
33 X-Mailer: git-send-email 1.9.1\r
34 In-Reply-To: <1421368229-4360-1-git-send-email-todd@electricoding.com>\r
35 References: <1421368229-4360-1-git-send-email-todd@electricoding.com>\r
36 In-Reply-To: <1420849787-4401-1-git-send-email-todd@electricoding.com>\r
37 References: <1420849787-4401-1-git-send-email-todd@electricoding.com>\r
38 X-AntiAbuse: This header was added to track abuse,\r
39         please include it with any abuse report\r
40 X-AntiAbuse: Primary Hostname - server75.web-hosting.com\r
41 X-AntiAbuse: Original Domain - notmuchmail.org\r
42 X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]\r
43 X-AntiAbuse: Sender Address Domain - electricoding.com\r
44 X-Get-Message-Sender-Via: server75.web-hosting.com: authenticated_id:\r
45         todd@electricoding.com\r
46 X-Source: \r
47 X-Source-Args: \r
48 X-Source-Dir: \r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Fri, 16 Jan 2015 00:31:10 -0000\r
62 \r
63 Adds the indexing and removes the broken test flag\r
64 ---\r
65  lib/database.cc        |  1 +\r
66  lib/index.cc           | 10 ++++++++++\r
67  test/T190-multipart.sh |  4 ----\r
68  3 files changed, 11 insertions(+), 4 deletions(-)\r
69 \r
70 diff --git a/lib/database.cc b/lib/database.cc\r
71 index 0d2c417..3974e2e 100644\r
72 --- a/lib/database.cc\r
73 +++ b/lib/database.cc\r
74 @@ -254,6 +254,7 @@ static prefix_t PROBABILISTIC_PREFIX[]= {\r
75      { "from",                  "XFROM" },\r
76      { "to",                    "XTO" },\r
77      { "attachment",            "XATTACHMENT" },\r
78 +    { "mimetype",              "XMIMETYPE"},\r
79      { "subject",               "XSUBJECT"},\r
80  };\r
81  \r
82 diff --git a/lib/index.cc b/lib/index.cc\r
83 index 1a2e63d..c88ed8d 100644\r
84 --- a/lib/index.cc\r
85 +++ b/lib/index.cc\r
86 @@ -318,6 +318,16 @@ _index_mime_part (notmuch_message_t *message,\r
87         return;\r
88      }\r
89  \r
90 +    GMimeContentType *content_type = g_mime_object_get_content_type(part);\r
91 +    if (content_type) {\r
92 +       char *mime_string = g_mime_content_type_to_string(content_type);\r
93 +       if (mime_string)\r
94 +       {\r
95 +           _notmuch_message_gen_terms (message, "mimetype", mime_string);\r
96 +           g_free(mime_string);\r
97 +       }\r
98 +    }\r
99 +\r
100      if (GMIME_IS_MULTIPART (part)) {\r
101         GMimeMultipart *multipart = GMIME_MULTIPART (part);\r
102         int i;\r
103 diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh\r
104 index 57f1b61..de7d361 100755\r
105 --- a/test/T190-multipart.sh\r
106 +++ b/test/T190-multipart.sh\r
107 @@ -752,22 +752,18 @@ notmuch show --format=json --include-html id:htmlmessage > OUTPUT\r
108  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED.withhtml)"\r
109  \r
110  test_begin_subtest "indexes mime-type #1"\r
111 -test_subtest_known_broken\r
112  output=$(notmuch search mimetype:application/unique_identifier | notmuch_search_sanitize)\r
113  test_expect_equal "$output" "thread:XXX   2014-01-12 [1/1] Todd; odd content types (inbox unread)"\r
114  \r
115  test_begin_subtest "indexes mime-type #2"\r
116 -test_subtest_known_broken\r
117  output=$(notmuch search mimetype:text/some_other_identifier | notmuch_search_sanitize)\r
118  test_expect_equal "$output" "thread:XXX   2014-01-12 [1/1] Todd; odd content types (inbox unread)"\r
119  \r
120  test_begin_subtest "indexes mime-type #3"\r
121 -test_subtest_known_broken\r
122  output=$(notmuch search from:todd and mimetype:multipart/alternative | notmuch_search_sanitize)\r
123  test_expect_equal "$output" "thread:XXX   2014-01-12 [1/1] Todd; odd content types (inbox unread)"\r
124  \r
125  test_begin_subtest "search for non-existent mime-type"\r
126 -test_subtest_known_broken\r
127  output=$(notmuch search mimetype:non-existent/mime-type | notmuch_search_sanitize)\r
128  test_expect_equal "$output" ""\r
129  \r
130 -- \r
131 1.9.1\r
132 \r