[PATCH] Add a defcustom for whether to block remote images by default.

David Edmondson dme at dme.org
Wed Jan 28 22:40:22 PST 2015


A defcustom for `notmuch-show-text/html-blocked-images', which is used
to set `shr-blocked-images', would be more usable. It can default to "."
to achieve the same result.

On Thu, Jan 29 2015, Jinwoo Lee wrote:
> ---
>  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
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list