[PATCH] Add a defcustom for whether to block remote images by default.
authorJinwoo Lee <jinwoo68@gmail.com>
Thu, 29 Jan 2015 01:39:32 +0000 (17:39 +1600)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:47:52 +0000 (14:47 -0700)
75/abe649f23c205c1fbbf5411e9124b0b9f04566 [new file with mode: 0644]

diff --git a/75/abe649f23c205c1fbbf5411e9124b0b9f04566 b/75/abe649f23c205c1fbbf5411e9124b0b9f04566
new file mode 100644 (file)
index 0000000..a9ae13e
--- /dev/null
@@ -0,0 +1,101 @@
+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 427C3431FC9\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Jan 2015 17:40:12 -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 KBGwKc6bQmmj for <notmuch@notmuchmail.org>;\r
+       Wed, 28 Jan 2015 17:40:09 -0800 (PST)\r
+Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com\r
+       [209.85.223.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 08D55431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Jan 2015 17:40:09 -0800 (PST)\r
+Received: by mail-ie0-f177.google.com with SMTP id vy18so27647071iec.8\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Jan 2015 17:40:08 -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=/M0DVCBfm04qMEg82klhFkDK/4bjh6g2EQ43o8/nlfU=;\r
+       b=DFNT9Jv4rse9I9ngL/uk8n2hJGbq7jQIn53RiliJc8bDVrcWQEiujagri1GqNbJ9kq\r
+       5Ik5TkE+dSvn5L5W7QfEkRT6le1i7fyTLSkwtKD5sj9L9iD8wTyEIBzY8Cg6i2iIch/M\r
+       UjftqWkFwtVzfMjuvGKlSQ1tUXO7fkbF4RISRpPQBEVtwFV62Fb5OoHuzntCc4CtgXPk\r
+       7dc/olzTWIbgqy0QDaT8cYK7vAPImf4ykqnRJLYoHR6vBkUbzrK3GnFudpOt+esaUfW0\r
+       iKOOn7ASzwPXMXSG9oJCAK1doUep/ZHM4JnrWkS+G6JBvY849UYv42ecKX98iWKhMBCG\r
+       mE7Q==\r
+X-Received: by 10.43.139.79 with SMTP id iv15mr463152icc.81.1422495608622;\r
+       Wed, 28 Jan 2015 17:40:08 -0800 (PST)\r
+Received: from jinwoo-macbookair.roam.corp.google.com.com ([172.19.61.138])\r
+       by mx.google.com with ESMTPSA id ig15sm209173igb.10.2015.01.28.17.40.07\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\r
+       Wed, 28 Jan 2015 17:40:08 -0800 (PST)\r
+From: Jinwoo Lee <jinwoo68@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] Add a defcustom for whether to block remote images by\r
+ default.\r
+Date: Wed, 28 Jan 2015 17:39:32 -0800\r
+Message-Id: <1422495572-40384-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 01:40:12 -0000\r
+\r
+---\r
+ emacs/notmuch-show.el | 15 +++++++++++----\r
+ 1 file changed, 11 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 66350d4..bc48922 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-block-remote-images t\r
++  "Block remote images by default."\r
++  :type 'boolean\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,12 @@ 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 (if notmuch-show-block-remote-images\r
++                              "."\r
++                            shr-blocked-images)))\r
+     (shr-insert-document dom)\r
+     t))\r
\r
+-- \r
+2.2.2\r
+\r