summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-07-23 17:12:33 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-07-24 16:37:28 +0200
commit96a3b473fa5e152bf2f069f9eca10c370b311c25 (patch)
tree2835d24d24bee178d7cbe1c596e72b7902bba994
parent8bc8565721739510b3286838f1534f29b8869fc4 (diff)
downloademacs-96a3b473fa5e152bf2f069f9eca10c370b311c25.tar.gz
Fix viewing of encrypted S/MIME messages
* lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): Don't add a content-type header if there already is one (bug#41659).
-rw-r--r--lisp/gnus/mm-decode.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index d33bb56dc9e..a340418507f 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1680,8 +1680,14 @@ If RECURSIVE, search recursively."
(t (y-or-n-p
(format "Decrypt (S/MIME) part? "))))
(mm-view-pkcs7 parts from))
- (goto-char (point-min))
- (insert "Content-type: text/plain\n\n")
+ ;; Normally there will be a Content-type header here, but
+ ;; some mailers don't add that to the encrypted part, which
+ ;; makes the subsequent re-dissection fail here.
+ (save-restriction
+ (mail-narrow-to-head)
+ (unless (mail-fetch-field "content-type")
+ (goto-char (point-max))
+ (insert "Content-type: text/plain\n\n")))
(setq parts (mm-dissect-buffer t)))))
((equal subtype "signed")
(unless (and (setq protocol