From: Eli Zaretskii Date: Tue, 3 Apr 2007 11:11:27 +0000 (+0000) Subject: (rmail-convert-to-babyl-format): Don't try to decode base-64 encoded body X-Git-Tag: emacs-pretest-22.0.97~14 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=db0821c894a2fccef7a679e2ebb5e80f41b6dfba;p=emacs.git (rmail-convert-to-babyl-format): Don't try to decode base-64 encoded body if its content-type is something other than text/* or message/*. --- diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 5e534b2d47d..bfdd5048877 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -1959,9 +1959,13 @@ is non-nil if the user has supplied the password interactively. (base64-header-field-end (save-excursion (goto-char start) - (re-search-forward - "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*" - header-end t)))) + (and (re-search-forward + "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*" + header-end t) + ;; Don't try to decode non-text data. + (re-search-forward + "^content-type:\\(\n?[\t ]\\)\\(text\\|message\\)/" + header-end t))))) (if quoted-printable-header-field-end (save-excursion (unless @@ -2061,10 +2065,16 @@ is non-nil if the user has supplied the password interactively. "^content-transfer-encoding:\\(\n?[\t ]\\)*quoted-printable\\(\n?[\t ]\\)*" header-end t))) (base64-header-field-end - (save-excursion - (re-search-forward - "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*" - header-end t))) + (and + (save-excursion + (re-search-forward + "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*" + header-end t)) + ;; Don't decode non-text data. + (save-excursion + (re-search-forward + "^content-type:\\(\n?[\t ]\\)\\(text\\|message\\)/" + header-end t)))) (size ;; Get the numeric value from the Content-Length field. (save-excursion