aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-12-08 01:23:59 -0500
committerDavid Bremner <david@tethera.net>2017-12-08 08:08:46 -0400
commit076f86025d519522cde5787def6c03fc308e8ebc (patch)
treec70e0281aa8621054870c108c047881cec02fad3 /lib
parentd137170b23f8ccd9f967445e101d6f694df1cad4 (diff)
cli/new, insert, reindex: change index.decrypt to "auto" by default
The new "auto" decryption policy is not only good for "notmuch show" and "notmuch reindex". It's also useful for indexing messages -- there's no good reason to not try to go ahead and index the cleartext of a message that we have a stashed session key for. This change updates the defaults and tunes the test suite to make sure that they have taken effect.
Diffstat (limited to 'lib')
-rw-r--r--lib/indexopts.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/indexopts.c b/lib/indexopts.c
index a04d1c1c..26a31e89 100644
--- a/lib/indexopts.c
+++ b/lib/indexopts.c
@@ -26,7 +26,7 @@ notmuch_database_get_default_indexopts (notmuch_database_t *db)
notmuch_indexopts_t *ret = talloc_zero (db, notmuch_indexopts_t);
if (!ret)
return ret;
- ret->crypto.decrypt = NOTMUCH_DECRYPT_FALSE;
+ ret->crypto.decrypt = NOTMUCH_DECRYPT_AUTO;
char * decrypt_policy;
notmuch_status_t err = notmuch_database_get_config (db, "index.decrypt", &decrypt_policy);
@@ -38,8 +38,10 @@ notmuch_database_get_default_indexopts (notmuch_database_t *db)
(!(strcasecmp(decrypt_policy, "yes"))) ||
(!(strcasecmp(decrypt_policy, "1"))))
notmuch_indexopts_set_decrypt_policy (ret, NOTMUCH_DECRYPT_TRUE);
- else if (!strcasecmp(decrypt_policy, "auto"))
- notmuch_indexopts_set_decrypt_policy (ret, NOTMUCH_DECRYPT_AUTO);
+ else if ((!(strcasecmp(decrypt_policy, "false"))) ||
+ (!(strcasecmp(decrypt_policy, "no"))) ||
+ (!(strcasecmp(decrypt_policy, "0"))))
+ notmuch_indexopts_set_decrypt_policy (ret, NOTMUCH_DECRYPT_FALSE);
}
free (decrypt_policy);