notmuch_indexopts_t *
notmuch_database_get_default_indexopts (notmuch_database_t *db)
{
- return talloc_zero (db, notmuch_indexopts_t);
+ notmuch_indexopts_t *ret = talloc_zero (db, notmuch_indexopts_t);
+ if (!ret)
+ return ret;
+
+ char * decrypt;
+ notmuch_status_t err = notmuch_database_get_config (db, "index.decrypt", &decrypt);
+ if (err)
+ return ret;
+
+ if (decrypt &&
+ ((!(strcasecmp(decrypt, "true"))) ||
+ (!(strcasecmp(decrypt, "yes"))) ||
+ (!(strcasecmp(decrypt, "1")))))
+ notmuch_indexopts_set_try_decrypt (ret, true);
+
+ free (decrypt);
+ return ret;
}
notmuch_status_t