From 24d084465f4b469b96556727481811c054f57b32 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 6 Nov 2000 03:52:47 +0000 Subject: [PATCH] Synch with Gnus. --- lisp/ChangeLog | 5 +++++ lisp/mm-decode.el | 26 +++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 64e96e0..0ae7df3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2000-11-05 22:34:07 ShengHuo ZHU + + * mm-decode.el (mm-verify-option): Default value. + (mm-possibly-verify-or-decrypt): Dealing with broken messages. + 2000-11-05 15:06:05 ShengHuo ZHU * nnvirtual.el (nnvirtual-request-expire-articles): Uncompress range. diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index bc7069e..17e63aa 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -237,7 +237,7 @@ to: ("application/pkcs7-signature" mml-smime-verify "S/MIME") ("application/x-pkcs7-signature" mml-smime-verify "S/MIME"))) -(defcustom mm-verify-option nil +(defcustom mm-verify-option 'known "Option of verifying signed parts. `never', not verify; `always', always verify; `known', only verify known protocols. Otherwise, ask user." @@ -252,7 +252,7 @@ to: (defvar mm-decrypt-function-alist '(("application/pgp-encrypted" mml2015-decrypt "PGP"))) -(defcustom mm-decrypt-option nil +(defcustom mm-decrypt-option 'known "Option of decrypting signed parts. `never', not decrypt; `always', always decrypt; `known', only decrypt known protocols. Otherwise, ask user." @@ -262,7 +262,7 @@ to: (item :tag "ask" nil)) :group 'gnus-article) -(defcustom mm-snarf-option nil +(defcustom mm-snarf-option 'known "Option of snarfing PGP key. `never', not snarf; `always', always snarf; `known', only snarf known protocols. Otherwise, ask user." @@ -985,7 +985,15 @@ If NOTP, returns first non-matching part." protocol func) (cond ((equal subtype "signed") - (setq protocol (mail-content-type-get ctl 'protocol)) + (unless (setq protocol (mail-content-type-get ctl 'protocol)) + ;; The message is broken. + (let ((parts parts)) + (while parts + (if (assoc (mm-handle-media-type (car parts)) + mm-verify-function-alist) + (setq protocol (mm-handle-media-type (car parts)) + parts nil) + (setq parts (cdr parts)))))) (setq func (nth 1 (assoc protocol mm-verify-function-alist))) (if (cond ((eq mm-verify-option 'never) nil) @@ -1004,7 +1012,15 @@ If NOTP, returns first non-matching part." (unless (y-or-n-p (format "%s, continue? " err)) (error "Verify failure.")))))) ((equal subtype "encrypted") - (setq protocol (mail-content-type-get ctl 'protocol)) + (unless (setq protocol (mail-content-type-get ctl 'protocol)) + ;; The message is broken. + (let ((parts parts)) + (while parts + (if (assoc (mm-handle-media-type (car parts)) + mm-decrypt-function-alist) + (setq protocol (mm-handle-media-type (car parts)) + parts nil) + (setq parts (cdr parts)))))) (setq func (nth 1 (assoc protocol mm-decrypt-function-alist))) (if (cond ((eq mm-decrypt-option 'never) nil) -- 1.7.10.4