1 Return-Path: <jinwoo68@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 20BCF431FC4
\r
6 for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 13:36:23 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=2.639 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_ENVFROM_END_DIGIT=1,
\r
14 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id libfKoN6EPI3 for <notmuch@notmuchmail.org>;
\r
18 Thu, 29 Jan 2015 13:36:20 -0800 (PST)
\r
19 Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com
\r
20 [209.85.220.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id C85E9431FBC
\r
23 for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 13:36:19 -0800 (PST)
\r
24 Received: by mail-pa0-f41.google.com with SMTP id kq14so43723660pab.0
\r
25 for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 13:36:19 -0800 (PST)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id;
\r
28 bh=qLPydc38mDxPE4hG3UjhLo4rMJGp8SlqNTTdoLtV0Ts=;
\r
29 b=yvsicgRiQpkq+XJ+2qjqRTdQO8dLK2UAd1FcxGFp3dP6WsQEjh/5XIOmu7NKr61/N4
\r
30 SwLz49IrAnY+XR00unBgon5JzgMqbLT5u2Y+gDfyH+7lu+7+G7w4fwvdVXjZnYEwuNts
\r
31 v7K4VdkKP7/5qloEiTDwMb4/Yd/dFEUFYQSyn1CKO8jTE/jkeNHa2ZDl9qBxMBHzeYfw
\r
32 /4PngWEz37uGWTcvFubavEH00Mm4yoA7XxZzPs7FqsizkTnSjs8iwdUuJ0d2OSMENU5X
\r
33 y05Lv3as0ctNOcDwbaShfldFbICyweZv+ZmvgcBceXhQl+LG6QgqqXMcHJYemjaUbGJm
\r
35 X-Received: by 10.66.62.138 with SMTP id y10mr3808929par.51.1422567379160;
\r
36 Thu, 29 Jan 2015 13:36:19 -0800 (PST)
\r
37 Received: from jinwoo-macbookair.roam.corp.google.com.net ([24.130.61.213])
\r
38 by mx.google.com with ESMTPSA id bq7sm8687628pdb.50.2015.01.29.13.36.18
\r
39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
\r
40 Thu, 29 Jan 2015 13:36:18 -0800 (PST)
\r
41 From: Jinwoo Lee <jinwoo68@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH] emacs: Add a defcustom that specifies regexp for blocked
\r
45 Date: Thu, 29 Jan 2015 13:35:52 -0800
\r
46 Message-Id: <1422567352-32647-1-git-send-email-jinwoo68@gmail.com>
\r
47 X-Mailer: git-send-email 2.2.2
\r
48 X-BeenThere: notmuch@notmuchmail.org
\r
49 X-Mailman-Version: 2.1.13
\r
51 List-Id: "Use and development of the notmuch mail system."
\r
52 <notmuch.notmuchmail.org>
\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
56 List-Post: <mailto:notmuch@notmuchmail.org>
\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
60 X-List-Received-Date: Thu, 29 Jan 2015 21:36:24 -0000
\r
62 It's default value is ".", meaning all remote images will be blocked
\r
66 This time setting gnus-blocked-images from the correct place.
\r
68 emacs/notmuch-show.el | 23 ++++++++++++++++++-----
\r
69 1 file changed, 18 insertions(+), 5 deletions(-)
\r
71 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
72 index 66350d4..6f38e0c 100644
\r
73 --- a/emacs/notmuch-show.el
\r
74 +++ b/emacs/notmuch-show.el
\r
75 @@ -136,6 +136,11 @@ indentation."
\r
77 :group 'notmuch-show)
\r
79 +(defcustom notmuch-show-text/html-blocked-images "."
\r
80 + "Remote images that have URLs matching this regexp will be blocked."
\r
81 + :type '(choice (const nil) regexp)
\r
82 + :group 'notmuch-show)
\r
84 (defvar notmuch-show-thread-id nil)
\r
85 (make-variable-buffer-local 'notmuch-show-thread-id)
\r
86 (put 'notmuch-show-thread-id 'permanent-local t)
\r
87 @@ -798,16 +803,24 @@ will return nil if the CID is unknown or cannot be retrieved."
\r
88 ;; URL-decode it (see RFC 2392).
\r
89 (let ((cid (url-unhex-string url)))
\r
90 (first (notmuch-show--get-cid-content cid)))))
\r
91 - ;; Block all external images to prevent privacy leaks and
\r
92 - ;; potential attacks. FIXME: If we block an image, offer a
\r
93 - ;; button to load external images.
\r
94 - (shr-blocked-images "."))
\r
95 + ;; By default, block all external images to prevent privacy
\r
96 + ;; leaks and potential attacks. FIXME: If we block an image,
\r
97 + ;; offer a button to load external images.
\r
98 + (shr-blocked-images notmuch-show-text/html-blocked-images))
\r
99 (shr-insert-document dom)
\r
102 (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
\r
103 ;; This handler _must_ succeed - it is the handler of last resort.
\r
104 - (notmuch-mm-display-part-inline msg part content-type notmuch-show-process-crypto)
\r
106 + ;; By default, block all external images to prevent privacy leaks
\r
107 + ;; and potential attacks. FIXME: If we block an image, offer a
\r
108 + ;; button to load external images.
\r
109 + ;; Note that GNUS-BLOCKED-IMAGES is effective only when
\r
110 + ;; MM-TEXT-HTML-RENDERER is 'gnus-w3m.
\r
111 + (let ((gnus-blocked-images notmuch-show-text/html-blocked-images))
\r
112 + (notmuch-mm-display-part-inline msg part content-type
\r
113 + notmuch-show-process-crypto))
\r
116 ;; Functions for determining how to handle MIME parts.
\r