[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.
authorJinwoo Lee <jinwoo68@gmail.com>
Thu, 29 Jan 2015 17:28:47 +0000 (09:28 +1600)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:47:53 +0000 (14:47 -0700)
51/b7807b5fb4e42b519d5d4f65490173cf6643fa [new file with mode: 0644]

diff --git a/51/b7807b5fb4e42b519d5d4f65490173cf6643fa b/51/b7807b5fb4e42b519d5d4f65490173cf6643fa
new file mode 100644 (file)
index 0000000..c94e31f
--- /dev/null
@@ -0,0 +1,102 @@
+Return-Path: <jinwoo68@gmail.com>\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 727CA431FC4\r
+       for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 09:29:31 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.639\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.639 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_ENVFROM_END_DIGIT=1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 p25ToVBO-Ngh for <notmuch@notmuchmail.org>;\r
+       Thu, 29 Jan 2015 09:29:28 -0800 (PST)\r
+Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com\r
+       [209.85.220.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 52AD3431FBC\r
+       for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 09:29:28 -0800 (PST)\r
+Received: by mail-pa0-f43.google.com with SMTP id eu11so41571115pac.2\r
+       for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 09:29:26 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id;\r
+       bh=uglp0OJ6jlnfbLcgIQDMsRQtUuEggrPxrLIrG5gKPNc=;\r
+       b=h26TIH2l8SHntvDp46FQhuNPlDt7etowGkXBzvDmmFjVcmZFuk7QKhMPgXnM/7o7cA\r
+       lxGr5YjseMgrrPlS+ew69K8wOtTe8VNsTUFyFRU1XfkKRP31aQeIuNT733zzj4ne9shz\r
+       Cpv7Xn1i1bd52XiHa+Lfg7rHNKmduR00uCEIchUWJZC2oKF9808OY5hJV+XQHUd2HMw5\r
+       l3qKsWOfkkUmNG41BfC14C12A4YwQBl+y/Hs9ZShHdal5wwzMNH2GU0pRf06pz1hW0vR\r
+       aeRa5NCj3ctVQYjvGVUR+TfJZhBFdIdICM6tI9uJepZiWT8RH4dus+pVNsdcdrX69631\r
+       jmGA==\r
+X-Received: by 10.66.66.196 with SMTP id h4mr2146760pat.127.1422552566215;\r
+       Thu, 29 Jan 2015 09:29:26 -0800 (PST)\r
+Received: from jinwoo-macbookair.roam.corp.google.com.net ([24.130.61.213])\r
+       by mx.google.com with ESMTPSA id gk2sm8368014pbc.14.2015.01.29.09.29.24\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\r
+       Thu, 29 Jan 2015 09:29:25 -0800 (PST)\r
+From: Jinwoo Lee <jinwoo68@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Add a defcustom that specifies regexp for blocked\r
+       remote images.\r
+Date: Thu, 29 Jan 2015 09:28:47 -0800\r
+Message-Id: <1422552527-16889-1-git-send-email-jinwoo68@gmail.com>\r
+X-Mailer: git-send-email 2.2.2\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: Thu, 29 Jan 2015 17:29:31 -0000\r
+\r
+It's default value is ".", meaning all remote images will be blocked\r
+by default.\r
+---\r
+ emacs/notmuch-show.el | 14 ++++++++++----\r
+ 1 file changed, 10 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 66350d4..cc6aca9 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -136,6 +136,11 @@ indentation."\r
+   :type 'boolean\r
+   :group 'notmuch-show)\r
\r
++(defcustom notmuch-show-text/html-blocked-images "."\r
++  "Remote images that have URLs matching this regexp will be blocked."\r
++  :type '(choice (const nil) regexp)\r
++  :group 'notmuch-show)\r
++\r
+ (defvar notmuch-show-thread-id nil)\r
+ (make-variable-buffer-local 'notmuch-show-thread-id)\r
+ (put 'notmuch-show-thread-id 'permanent-local t)\r
+@@ -798,10 +803,11 @@ will return nil if the CID is unknown or cannot be retrieved."\r
+          ;; URL-decode it (see RFC 2392).\r
+          (let ((cid (url-unhex-string url)))\r
+            (first (notmuch-show--get-cid-content cid)))))\r
+-      ;; Block all external images to prevent privacy leaks and\r
+-      ;; potential attacks.  FIXME: If we block an image, offer a\r
+-      ;; button to load external images.\r
+-      (shr-blocked-images "."))\r
++      ;; By default, block all external images to prevent privacy\r
++      ;; leaks and potential attacks.  FIXME: If we block an image,\r
++      ;; offer a button to load external images.\r
++      (shr-blocked-images notmuch-show-text/html-blocked-images)\r
++      (gnus-blocked-images notmuch-show-text/html-blocked-images))\r
+     (shr-insert-document dom)\r
+     t))\r
\r
+-- \r
+2.2.2\r
+\r