Ignore encrypted parts when indexing.
authorJameson Graef Rollins <jrollins@finestructure.net>
Wed, 28 Dec 2011 20:14:29 +0000 (12:14 -0800)
committerDavid Bremner <bremner@debian.org>
Thu, 29 Dec 2011 21:44:43 +0000 (17:44 -0400)
It appears to be an oversight that encrypted parts were indexed
previously.  The terms generated from encrypted parts are meaningless
and do nothing but add bloat to the database.  It is not worth
indexing the encrypted content, just as it's not worth indexing the
signatures in signed parts.

lib/index.cc

index e8e9922b408a4d59a771aedf6783fc73126b0ad0..d8f8b2bf516247ccc14aec8927dc5ae703a830d3 100644 (file)
@@ -339,6 +339,10 @@ _index_mime_part (notmuch_message_t *message,
                if (i > 1)
                    fprintf (stderr, "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");
            }
+           if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {
+               /* Don't index encrypted parts. */
+               continue;
+           }
            _index_mime_part (message,
                              g_mime_multipart_get_part (multipart, i));
        }