Re: Hi all
[notmuch-archives.git] / d2 / a4310bbb6dec027ad46f439d2b76b06c0bebe9
1 Return-Path: <tomi.ollila@iki.fi>\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 arlo.cworth.org (Postfix) with ESMTP id 515F26DE0A9A\r
6  for <notmuch@notmuchmail.org>; Fri, 11 Dec 2015 13:53:35 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.704\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.704 tagged_above=-999 required=5 tests=[AWL=0.052, \r
12  SPF_NEUTRAL=0.652] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id l0tSiscu6P4Z for <notmuch@notmuchmail.org>;\r
16  Fri, 11 Dec 2015 13:53:33 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18  by arlo.cworth.org (Postfix) with ESMTP id CB3C76DE005F\r
19  for <notmuch@notmuchmail.org>; Fri, 11 Dec 2015 13:53:32 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21  by guru.guru-group.fi (Postfix) with ESMTP id AF42310004A;\r
22  Fri, 11 Dec 2015 23:53:39 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
25  Notmuch Mail <notmuch@notmuchmail.org>\r
26 Subject: Re: [PATCH 1/9] reorganize indexing of multipart/signed and\r
27  multipart/encrypted\r
28 In-Reply-To: <1449718786-28000-2-git-send-email-dkg@fifthhorseman.net>\r
29 References: <1449718786-28000-1-git-send-email-dkg@fifthhorseman.net>\r
30  <1449718786-28000-2-git-send-email-dkg@fifthhorseman.net>\r
31 User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.1\r
32  (x86_64-unknown-linux-gnu)\r
33 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
34  $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
35  !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
36 Date: Fri, 11 Dec 2015 23:53:39 +0200\r
37 Message-ID: <m2a8pg7iu4.fsf@guru.guru-group.fi>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.20\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44  <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
46  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
51  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Fri, 11 Dec 2015 21:53:35 -0000\r
53 \r
54 On Thu, Dec 10 2015, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:\r
55 \r
56 > This prepares the codebase for a cleaner changeset for dealing with\r
57 > indexing some encrypted messages in the clear.\r
58 > ---\r
59 >  lib/index.cc | 38 ++++++++++++++++++--------------------\r
60 >  1 file changed, 18 insertions(+), 20 deletions(-)\r
61 >\r
62 > diff --git a/lib/index.cc b/lib/index.cc\r
63 > index f166aef..2fa6616 100644\r
64 > --- a/lib/index.cc\r
65 > +++ b/lib/index.cc\r
66 > @@ -333,27 +333,25 @@ _index_mime_part (notmuch_message_t *message,\r
67 >       GMimeMultipart *multipart = GMIME_MULTIPART (part);\r
68 >       int i;\r
69 >  \r
70 > -     if (GMIME_IS_MULTIPART_SIGNED (multipart))\r
71 > -       _notmuch_message_add_term (message, "tag", "signed");\r
72 > -\r
73 > -     if (GMIME_IS_MULTIPART_ENCRYPTED (multipart))\r
74 > -       _notmuch_message_add_term (message, "tag", "encrypted");\r
75 > -\r
76 > -     for (i = 0; i < g_mime_multipart_get_count (multipart); i++) {\r
77 > -         if (GMIME_IS_MULTIPART_SIGNED (multipart)) {\r
78 > -             /* Don't index the signature. */\r
79 > -             if (i == 1)\r
80 > -                 continue;\r
81 > -             if (i > 1)\r
82 > -                 _notmuch_database_log (_notmuch_message_database (message),\r
83 > -                                       "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");\r
84 > -         }\r
85 > -         if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {\r
86 > -             /* Don't index encrypted parts. */\r
87 > -             continue;\r
88 > -         }\r
89 > +     if (GMIME_IS_MULTIPART_SIGNED (multipart)) {\r
90 > +         _notmuch_message_add_term (message, "tag", "signed");\r
91 > +         /* FIXME: should we try to validate the signature? */\r
92 > +         \r
93 > +         /* FIXME: is it always just the first part that is signed in\r
94 > +          all multipart/signed messages?*/\r
95 >           _index_mime_part (message,\r
96 > -                           g_mime_multipart_get_part (multipart, i));\r
97 > +                           g_mime_multipart_get_part (multipart, 0));\r
98 > +         \r
99 > +         if (g_mime_multipart_get_count (multipart) > 2)\r
100 > +             _notmuch_database_log (_notmuch_message_database (message),\r
101 > +                                    "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");\r
102 > +     } else if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {\r
103 > +         /* Don't index encrypted parts */\r
104 \r
105 This could have the  _notmuch_message_add_term (message, "tag", "encrypted");\r
106 that was added in next patch file ?\r
107 \r
108 (i saw your latest proposal, here i am commenting so that the relevant\r
109 changes can be done in nest round...)\r
110 \r
111 \r
112 > +     } else {\r
113 > +         for (i = 0; i < g_mime_multipart_get_count (multipart); i++) {\r
114 > +             _index_mime_part (message,\r
115 > +                               g_mime_multipart_get_part (multipart, i));\r
116 > +         }\r
117 >       }\r
118 >       return;\r
119 >      }\r
120 > -- \r
121 > 2.6.2\r