From 4edb0eaec682ee442546cd8a79844655604baa05 Mon Sep 17 00:00:00 2001 From: Jinwoo Lee Date: Thu, 29 Jan 2015 17:39:32 +1600 Subject: [PATCH] [PATCH] Add a defcustom for whether to block remote images by default. --- 75/abe649f23c205c1fbbf5411e9124b0b9f04566 | 101 ++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 75/abe649f23c205c1fbbf5411e9124b0b9f04566 diff --git a/75/abe649f23c205c1fbbf5411e9124b0b9f04566 b/75/abe649f23c205c1fbbf5411e9124b0b9f04566 new file mode 100644 index 000000000..a9ae13ef3 --- /dev/null +++ b/75/abe649f23c205c1fbbf5411e9124b0b9f04566 @@ -0,0 +1,101 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 427C3431FC9 + for ; Wed, 28 Jan 2015 17:40:12 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.639 +X-Spam-Level: ** +X-Spam-Status: No, score=2.639 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_ENVFROM_END_DIGIT=1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +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 KBGwKc6bQmmj for ; + Wed, 28 Jan 2015 17:40:09 -0800 (PST) +Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com + [209.85.223.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 08D55431FAF + for ; Wed, 28 Jan 2015 17:40:09 -0800 (PST) +Received: by mail-ie0-f177.google.com with SMTP id vy18so27647071iec.8 + for ; Wed, 28 Jan 2015 17:40:08 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id; + bh=/M0DVCBfm04qMEg82klhFkDK/4bjh6g2EQ43o8/nlfU=; + b=DFNT9Jv4rse9I9ngL/uk8n2hJGbq7jQIn53RiliJc8bDVrcWQEiujagri1GqNbJ9kq + 5Ik5TkE+dSvn5L5W7QfEkRT6le1i7fyTLSkwtKD5sj9L9iD8wTyEIBzY8Cg6i2iIch/M + UjftqWkFwtVzfMjuvGKlSQ1tUXO7fkbF4RISRpPQBEVtwFV62Fb5OoHuzntCc4CtgXPk + 7dc/olzTWIbgqy0QDaT8cYK7vAPImf4ykqnRJLYoHR6vBkUbzrK3GnFudpOt+esaUfW0 + iKOOn7ASzwPXMXSG9oJCAK1doUep/ZHM4JnrWkS+G6JBvY849UYv42ecKX98iWKhMBCG + mE7Q== +X-Received: by 10.43.139.79 with SMTP id iv15mr463152icc.81.1422495608622; + Wed, 28 Jan 2015 17:40:08 -0800 (PST) +Received: from jinwoo-macbookair.roam.corp.google.com.com ([172.19.61.138]) + by mx.google.com with ESMTPSA id ig15sm209173igb.10.2015.01.28.17.40.07 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); + Wed, 28 Jan 2015 17:40:08 -0800 (PST) +From: Jinwoo Lee +To: notmuch@notmuchmail.org +Subject: [PATCH] Add a defcustom for whether to block remote images by + default. +Date: Wed, 28 Jan 2015 17:39:32 -0800 +Message-Id: <1422495572-40384-1-git-send-email-jinwoo68@gmail.com> +X-Mailer: git-send-email 2.2.2 +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: Thu, 29 Jan 2015 01:40:12 -0000 + +--- + emacs/notmuch-show.el | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index 66350d4..bc48922 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -136,6 +136,11 @@ indentation." + :type 'boolean + :group 'notmuch-show) + ++(defcustom notmuch-show-block-remote-images t ++ "Block remote images by default." ++ :type 'boolean ++ :group 'notmuch-show) ++ + (defvar notmuch-show-thread-id nil) + (make-variable-buffer-local 'notmuch-show-thread-id) + (put 'notmuch-show-thread-id 'permanent-local t) +@@ -798,10 +803,12 @@ will return nil if the CID is unknown or cannot be retrieved." + ;; URL-decode it (see RFC 2392). + (let ((cid (url-unhex-string url))) + (first (notmuch-show--get-cid-content cid))))) +- ;; Block all external images to prevent privacy leaks and +- ;; potential attacks. FIXME: If we block an image, offer a +- ;; button to load external images. +- (shr-blocked-images ".")) ++ ;; By default, block all external images to prevent privacy ++ ;; leaks and potential attacks. FIXME: If we block an image, ++ ;; offer a button to load external images. ++ (shr-blocked-images (if notmuch-show-block-remote-images ++ "." ++ shr-blocked-images))) + (shr-insert-document dom) + t)) + +-- +2.2.2 + -- 2.26.2