[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: cid images with emacs-w3m ?



>>>>> In <microsoft-free.3oznwhq3zb.fsf@ournature.org>
>>>>>	Jinhyok Heo <novembre+dated+1027907928.307f54@ournature.org> wrote:

> Is it possible to see cid images(images which come within mails, not
> URL) with emacs-w3m?

Well, I think there is a nonsense logic in the function
`mm-inline-text-html-render-with-w3m' and the option
`mm-inline-text-html-with-images'.  Could you try to use the
attached patch?  You need to set the option
`mm-inline-text-html-with-images' to non-nil to see cid images:

(setq mm-inline-text-html-with-images t)
--- lisp/mm-decode.el~	2002-04-30 02:01:14 +0000
+++ lisp/mm-decode.el	2002-07-24 02:40:56 +0000
@@ -127,14 +127,23 @@
 
 (defcustom mm-inline-text-html-with-images nil
   "If non-nil, Gnus will allow retrieving images in the HTML contents
-with <img> tags.  It has no effect on Emacs/w3.  For emacs-w3m, the
-value of the option `w3m-display-inline-images' will be bound with
-this value.  In addition, the variable `w3m-safe-url-regexp' will be
-bound with the value nil if it is non-nil to make emacs-w3m show all
-images, however this behavior may be changed in the future."
+with <img> tags.  It has no effect on Emacs/w3.  See also
+the documentation for the option `mm-w3m-safe-url-regexp'.
   :type 'boolean
   :group 'mime-display)
 
+(defcustom mm-w3m-safe-url-regexp "\\`cid:";
+  "Regexp that matches safe url names.  Some HTML mails might have the
+trick of spammers using <img> tags.  It is likely to be intended to
+verify whether you have read the mail.  You can prevent your personal
+informations from leaking by setting this to the regexp which matches
+the safe url names.  The value of the variable `w3m-safe-url-regexp'
+will be bound with this value.  You may set this value to nil if you
+consider all the urls to be safe."
+  :type '(choice (regexp :tag "Regexp")
+		 (const :tag "All URLs are safe" nil)
+  :group 'mime-display))
+
 (defcustom mm-inline-text-html-with-w3m-keymap t
   "If non-nil, use emacs-w3m command keys in the article buffer."
   :type 'boolean
--- lisp/mm-view.el~	2002-04-08 01:21:51 +0000
+++ lisp/mm-view.el	2002-07-24 02:40:48 +0000
@@ -281,9 +281,7 @@
 	(when charset
 	  (delete-region (point-min) (point-max))
 	  (insert (mm-decode-string text charset)))
-	(let ((w3m-safe-url-regexp (if mm-inline-text-html-with-images
-				       nil
-				     "\\`cid:";))
+	(let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
 	      (w3m-display-inline-images mm-inline-text-html-with-images)
 	      w3m-force-redisplay)
 	  (w3m-region (point-min) (point-max)))