[notmuch] gpg decryption
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Mon, 8 Mar 2010 11:49:54 +0000 (12:49 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:20 +0000 (09:36 -0800)
6e/23e8ec856a1a0b4db226cbd4999c419b760380 [new file with mode: 0644]

diff --git a/6e/23e8ec856a1a0b4db226cbd4999c419b760380 b/6e/23e8ec856a1a0b4db226cbd4999c419b760380
new file mode 100644 (file)
index 0000000..47e1214
--- /dev/null
@@ -0,0 +1,75 @@
+Return-Path: <Sebastian@SSpaeth.de>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 49D8C476B8A\r
+       for <notmuch@notmuchmail.org>; Mon,  8 Mar 2010 03:50:14 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.686\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.686 tagged_above=-999 required=5\r
+       tests=[AWL=-0.687, BAYES_50=0.001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id hS6AeWXr70lU for <notmuch@notmuchmail.org>;\r
+       Mon,  8 Mar 2010 03:50:13 -0800 (PST)\r
+Received: from homiemail-a25.g.dreamhost.com (caiajhbdcahe.dreamhost.com\r
+       [208.97.132.74])\r
+       by olra.theworths.org (Postfix) with ESMTP id 58946476B76\r
+       for <notmuch@notmuchmail.org>; Mon,  8 Mar 2010 03:50:13 -0800 (PST)\r
+Received: from sspaeth.de (mtec-hg-docking-1-dhcp-204.ethz.ch\r
+       [129.132.133.204])\r
+       by homiemail-a25.g.dreamhost.com (Postfix) with ESMTPA id D06AE678083\r
+       for <notmuch@notmuchmail.org>; Mon,  8 Mar 2010 03:49:56 -0800 (PST)\r
+Received: by sspaeth.de (sSMTP sendmail emulation);\r
+       Mon, 08 Mar 2010 12:49:54 +0100\r
+From: "Sebastian Spaeth" <Sebastian@SSpaeth.de>\r
+To: Notmuch development list <notmuch@notmuchmail.org>\r
+Date: Mon, 08 Mar 2010 12:49:54 +0100\r
+Message-ID: <87aaujyqvx.fsf@SSpaeth.de>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: [notmuch] gpg decryption\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 08 Mar 2010 11:50:14 -0000\r
+\r
+My bank frequently sends me transactions as an inline-armored gpg\r
+encrypted text. So I added the below 2 lines in my .emacs and added this\r
+function to the list of notmuch-show-hook functions:\r
+\r
+(defun spaetz/decrypt ()\r
+  (epa-decrypt-armor-in-region (point-min) (point-max)))\r
+\r
+Despite warning in the docs that this function should not be called from\r
+elisp programs directly, it works just fine for me. The only annoyance\r
+is that the function asks "Should I replace the current text (y/n)" in\r
+the status bar whenever it detects gpg text.\r
+It works for me and is a nice proof-of-concept which happens to solve my bank\r
+account itch, but definitely needs improvement:\r
+\r
+- We just feed it the whole notmuch-show buffer, it would be nicer to\r
+hand it the just the region of the message body/mime part. I wonder, if\r
+things like this should not better be done with dme's message-washing\r
+hooks rather than a notmuch-show hook?  \r
+\r
+- The annoying "should I replace the current text" question should not\r
+appear, ie we need to use some more low-level functionality and\r
+implement mime part "cleaning".\r
+\r
+- This will not handle encrypted text as an mime attachment, I guess.\r
+\r
+No clue, just tossing this out for now.\r
+\r
+Sebastian\r