I use mu4e with mbsync in emacs for email. Login info for email is retrieved from an encrypted file. The appropriated gpg keys are present and working in the offline gpg-qube.
Using "/usr/bin/qubes-gpg-client-wrapper" in place of "gpg" as a pass command in the mbsync file for retrieving login information from the encrypted file is working properly for retrieving my email, but when I try to send an email I get an error:
Error while decrypting with "gpg2":
gpg: encrypted with RSA key, ID <not sure if I'm supposed to share this # or not>
gpg: decryption failed: No secret key
I thought that I might just need to change the epg-gpg-program variable in emacs to qubes-gpg-client or /usr/bin/qubes-gpg-client-wrapper but neither of those two changes make any difference. It only results in the same error message, but with "gpg2" being replaced by "qubes-gpg-client" or "/urs/bin/qubes-gpg-client-wrapper".
I've scoured the internet and have exhausted my ability to try to troubleshoot this with my own understanding.
I'm hoping that someone here can point out what I've missed.
Here's the solution to this problem:
Apparently Emacs will trick you into thinking you've changed the epa-gpg-program variable, but it won't actually honor that change when it runs a gpg call.
This: https://blogs.fsfe.org/jens.lechtenboerger/2017/04/12/gnu-emacs-under-qubes-os/
Supposedly I should be able to use the following to make Emacs recognize qubes-gpg-client-wrapper:
(customize-set-variable 'epg-gpg-program "/usr/bin/qubes-gpg-client-wrapper")
But even though I'm running 25.3.1, it didn't work. I had to fall back to a second option:
(require 'epg-config)
(customize-set-variable 'epg-gpg-program "/usr/bin/qubes-gpg-client-wrapper")
(push (cons 'OpenPGP (epg-config--make-gpg-configuration epg-gpg-program))
epg--configurations)
This did the trick and actually got Emacs to recognize the changed variable.
I can now send email using emacs/mu4e and Qubes split gpg.
Are you asking about how to get mu4e up and running in emacs? If so, that is outside the scope of this message group and I'm certainly not the best place to go for information.
I would suggest doing your googles, as there are many guides for this process available scattered about.
Briefly, I have found that I'm happy with the an email setup that uses mu4e (https://www.djcbsoftware.nl/code/mu/mu4e.html) for interacting with email in emacs. I use isync/mbsync (http://isync.sourceforge.net/) for getting my mail from the server.
Guides like this one: http://www.macs.hw.ac.uk/~rs46/posts/2014-01-13-mu4e-email-client.html
...are helpful for giving you a template on how to set everything up, and it's just a matter of wading through the details to get it tuned to your own liking.