emacs-diffs
[Top][All Lists]
Advanced

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

master 84ec57f: Fix viewing of encrypted S/MIME messages


From: Lars Ingebrigtsen
Subject: master 84ec57f: Fix viewing of encrypted S/MIME messages
Date: Thu, 23 Jul 2020 11:12:47 -0400 (EDT)

branch: master
commit 84ec57fe06e187f41a3546131d5dae3b185c3511
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/gnus/mm-decode.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 96695aa..587c4e0 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]