[gnus git] branch master updated: m0-5-11-g70df7dd =1= mm-decode: don't touch MIME type for multipart/encrypted children

Daiki Ueno <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  70df7ddd0c8cf764e92586c91800b9ede7d93ea8 (commit)
      from  ae6c8be1a889b91c962d39182c31838175f812fc (commit)


- Log -----------------------------------------------------------------
commit 70df7ddd0c8cf764e92586c91800b9ede7d93ea8
Author: Daiki Ueno <[email protected]>
Date:   Thu May 24 10:45:38 2012 +0900

    mm-decode: don't touch MIME type for multipart/encrypted children
    
    The commit 1bf64efe introduced auto detection of actual MIME types
    for application/octet-stream.  That changes the MIME type of
    encrypted part to "text/plain" when it has filename parameter with
    ".asc", and causes decryption failure.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 00473af..565b10c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-28  Daiki Ueno  <[email protected]>
+
+	* mm-decode.el (mm-inhibit-auto-detect-attachment): New variable.
+	(mm-dissect-singlepart): Don't guess the MIME type of
+	application/octet-stream parts if mm-inhibit-auto-detect-attachment is
+	set.
+	(mm-dissect-multipart): Bind mm-inhibit-auto-detect-attachment if the
+	toplevel MIME type is multipart/encrypted.
+
 2012-05-27  Katsumi Yamaoka  <[email protected]>
 
 	* gnus-msg.el (gnus-msg-mail): Ensure that gnus-newsgroup-name is
diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el
index 8076b2e..de2d1ed 100644
--- a/lisp/mm-decode.el
+++ b/lisp/mm-decode.el
@@ -458,6 +458,7 @@ If not set, `default-directory' will be used."
 (defvar mm-last-shell-command "")
 (defvar mm-content-id-alist nil)
 (defvar mm-postponed-undisplay-list nil)
+(defvar mm-inhibit-auto-detect-attachment nil)
 
 ;; According to RFC2046, in particular, in a digest, the default
 ;; Content-Type value for a body part is changed from "text/plain" to
@@ -668,7 +669,8 @@ MIME-Version header before proceeding."
     ;; Guess what the type of application/octet-stream parts should
     ;; really be.
     (let ((filename (cdr (assq 'filename (cdr cdl)))))
-      (when (and (equal (car ctl) "application/octet-stream")
+      (when (and (not mm-inhibit-auto-detect-attachment)
+		 (equal (car ctl) "application/octet-stream")
 		 filename
 		 (string-match "\\.\\([^.]+\\)$" filename))
 	(let ((new-type (mailcap-extension-to-mime (match-string 1 filename))))
@@ -694,7 +696,9 @@ MIME-Version header before proceeding."
 		(goto-char (point-max))
 		(if (re-search-backward close-delimiter nil t)
 		    (match-beginning 0)
-		  (point-max)))))
+		  (point-max))))
+	 (mm-inhibit-auto-detect-attachment
+	  (equal (car ctl) "multipart/encrypted")))
     (setq boundary (concat (regexp-quote boundary) "[ \t]*$"))
     (while (and (< (point) end) (re-search-forward boundary end t))
       (goto-char (match-beginning 0))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog    |    9 +++++++++
 lisp/mm-decode.el |    8 ++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.