cli: crypto: tell gmime to use gpg-agent
[notmuch] / crypto.c
index fbe5aeb6b3968168bb9cdd95bf3269f42b53b4ed..cb361e11557a99b33de25564afe53aff96dde463 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -45,6 +45,9 @@ notmuch_crypto_get_context (notmuch_crypto_t *crypto, const char *protocol)
            g_object_unref (session);
 #endif
            if (crypto->gpgctx) {
+#ifdef GMIME_ATLEAST_26
+               g_mime_gpg_context_set_use_agent ((GMimeGpgContext*) crypto->gpgctx, TRUE);
+#endif
                g_mime_gpg_context_set_always_trust ((GMimeGpgContext*) crypto->gpgctx, FALSE);
            } else {
                fprintf (stderr, "Failed to construct gpg context.\n");