about summary refs log tree commit diff
path: root/init/mail.el
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2018-06-06T08·22+0200
committerVincent Ambo <mail@tazj.in>2018-06-06T08·22+0200
commit0806463a004de5258640664280b69b1118c624b2 (patch)
tree3e2c715bc10047839f0d386c65b91af1c4a29e9c /init/mail.el
parent66e86d2546c8abdc22cc7333e85e50eef3408c3d (diff)
fix(mail): Add hack to "warm up" GPG agent before sending mail
This is required in order to let password lookups work correctly when
shelling out to password-store from MSMTP, as it won't be calling
pinentry correctly otherwise.
Diffstat (limited to 'init/mail.el')
-rw-r--r--init/mail.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/init/mail.el b/init/mail.el
index 0d5fdc45374f..ecc6aa4648e9 100644
--- a/init/mail.el
+++ b/init/mail.el
@@ -42,4 +42,12 @@
                          ;; in the UI m(
                          ("vincent@aprila.no" . "aprila/Sende element")))
 
+;; MSMTP decrypts passwords using pass, but pinentry doesn't work
+;; correctly in that setup. This forces a warmup of the GPG agent
+;; before sending the message.
+;;
+;; Note that the sending function is advised because the provided hook
+;; for this seems to run at the wrong time.
+(advice-add 'notmuch-mua-send-common :before 'warmup-gpg-agent)
+
 (provide 'mail-setup)