]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix viewing encrypted+signed messages from Outlook
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 4 Aug 2020 16:08:47 +0000 (18:08 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 4 Aug 2020 16:08:47 +0000 (18:08 +0200)
* lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): Fix
problem with CRLF-encoded encrypted+signed parts (bug#42637).

lisp/gnus/mm-decode.el

index 587c4e01b92760b1a89dd59024d7c5eb6e1ed1d6..7f8ab5f9ef5f36f32aa58f7a9969644d9255e71a 100644 (file)
@@ -1680,6 +1680,12 @@ If RECURSIVE, search recursively."
                    (t (y-or-n-p
                        (format "Decrypt (S/MIME) part? "))))
                   (mm-view-pkcs7 parts from))
+         (goto-char (point-min))
+         ;; The encrypted document is a MIME part, and may use either
+         ;; CRLF (Outlook and the like) or newlines for end-of-line
+         ;; markers.  Translate from CRLF.
+         (while (search-forward "\r\n" nil t)
+           (replace-match "\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.