diff options
Diffstat (limited to 'lisp/email.el')
-rw-r--r-- | lisp/email.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/email.el b/lisp/email.el index 73aa22b..8b0f483 100644 --- a/lisp/email.el +++ b/lisp/email.el @@ -94,3 +94,16 @@ (let ((msg mu4e-compose-parent-message)) (when (and msg (member 'encrypted (mu4e-message-field msg :flags))) (mml-secure-message-sign-encrypt))))) + +(add-hook 'mu4e-view-mode-hook + (defun my/maybe-decrypt-inline () + "Attempt to decrypt inline PGP messages automatically." + (save-excursion + (goto-char (point-min)) + (re-search-forward "-----BEGIN PGP MESSAGE-----$" nil t) + (let ((armor-start (match-beginning 0))) + (when armor-start + (let ((armor-end (re-search-forward "^-----END PGP MESSAGE-----$" nil t))) + (when armor-end + (epa-decrypt-armor-in-region armor-start armor-end)))))))) + |