From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 49D8C476B8A for ; Mon, 8 Mar 2010 03:50:14 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.686 X-Spam-Level: X-Spam-Status: No, score=-0.686 tagged_above=-999 required=5 tests=[AWL=-0.687, BAYES_50=0.001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hS6AeWXr70lU for ; Mon, 8 Mar 2010 03:50:13 -0800 (PST) Received: from homiemail-a25.g.dreamhost.com (caiajhbdcahe.dreamhost.com [208.97.132.74]) by olra.theworths.org (Postfix) with ESMTP id 58946476B76 for ; Mon, 8 Mar 2010 03:50:13 -0800 (PST) Received: from sspaeth.de (mtec-hg-docking-1-dhcp-204.ethz.ch [129.132.133.204]) by homiemail-a25.g.dreamhost.com (Postfix) with ESMTPA id D06AE678083 for ; Mon, 8 Mar 2010 03:49:56 -0800 (PST) Received: by sspaeth.de (sSMTP sendmail emulation); Mon, 08 Mar 2010 12:49:54 +0100 From: "Sebastian Spaeth" To: Notmuch development list Date: Mon, 08 Mar 2010 12:49:54 +0100 Message-ID: <87aaujyqvx.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: gpg decryption X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 11:50:14 -0000 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