summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2007-04-03 11:11:27 +0000
committerEli Zaretskii <eliz@gnu.org>2007-04-03 11:11:27 +0000
commitdb0821c894a2fccef7a679e2ebb5e80f41b6dfba (patch)
treeb5309f6d1fca03e2850b66ee66a8a27eb5d8ec74 /lisp/mail
parent6cbb0bb0764d5f3c0c023d501f700eb26d9e10dc (diff)
downloademacs-db0821c894a2fccef7a679e2ebb5e80f41b6dfba.tar.gz
(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/*.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/rmail.el24
1 files changed, 17 insertions, 7 deletions
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