unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* gpg decryption
@ 2010-03-08 11:49 Sebastian Spaeth
  2010-03-08 11:52 ` Sebastian Spaeth
  2010-03-08 16:47 ` Jameson Rollins
  0 siblings, 2 replies; 4+ messages in thread
From: Sebastian Spaeth @ 2010-03-08 11:49 UTC (permalink / raw)
  To: Notmuch development list

My bank frequently sends me transactions as an inline-armored gpg
encrypted text. So I added the below 2 lines in my .emacs and added this
function to the list of notmuch-show-hook functions:

(defun spaetz/decrypt ()
  (epa-decrypt-armor-in-region (point-min) (point-max)))

Despite warning in the docs that this function should not be called from
elisp programs directly, it works just fine for me. The only annoyance
is that the function asks "Should I replace the current text (y/n)" in
the status bar whenever it detects gpg text.
It works for me and is a nice proof-of-concept which happens to solve my bank
account itch, but definitely needs improvement:

- We just feed it the whole notmuch-show buffer, it would be nicer to
hand it the just the region of the message body/mime part. I wonder, if
things like this should not better be done with dme's message-washing
hooks rather than a notmuch-show hook?  

- The annoying "should I replace the current text" question should not
appear, ie we need to use some more low-level functionality and
implement mime part "cleaning".

- This will not handle encrypted text as an mime attachment, I guess.

No clue, just tossing this out for now.

Sebastian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-09 21:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-08 11:49 gpg decryption Sebastian Spaeth
2010-03-08 11:52 ` Sebastian Spaeth
2010-03-08 16:47 ` Jameson Rollins
2010-03-09 14:05   ` Sebastian Spaeth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).