summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2011-02-23 11:32:35 +0900
committerKenichi Handa <handa@m17n.org>2011-02-23 11:32:35 +0900
commitc1449bffe23febaed03c89eaffce7f3ec5d88cce (patch)
tree0d59aa4cf8f35d917ab855dc721784bbc32f3852
parent9c02aefc951cca753d1548de717d3b5017e96187 (diff)
downloademacs-c1449bffe23febaed03c89eaffce7f3ec5d88cce.tar.gz
mail/rmailmm.el (rmail-mime-process-multipart): Do not signal an error when a multipart boundary in the nested multipart is found.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mail/rmailmm.el45
2 files changed, 30 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a70330d1022..75010513c12 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-23 Kenichi Handa <handa@m17n.org>
+
+ * mail/rmailmm.el (rmail-mime-process-multipart): Do not signal an
+ error when a multipart boundary in the nested multipart is found.
+
2011-02-22 Kenichi Handa <handa@m17n.org>
* mail/rmail.el (rmail-start-mail): Decode "encoded-words" of
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index e44dd877e4f..4aa3e81132f 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -852,28 +852,33 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
((looking-at "[ \t]*\n")
(setq next (copy-marker (match-end 0) t)))
(t
- (rmail-mm-get-boundary-error-message
- "Malformed boundary" content-type content-disposition
- content-transfer-encoding)))
-
- (setq index (1+ index))
- ;; Handle the part.
- (if parse-tag
+ ;; The original code signalled an error as below, but
+ ;; this line may be a boundary of nested multipart. So,
+ ;; we just set `next' to nil to skip this line
+ ;; (rmail-mm-get-boundary-error-message
+ ;; "Malformed boundary" content-type content-disposition
+ ;; content-transfer-encoding)
+ (setq next nil)))
+
+ (when next
+ (setq index (1+ index))
+ ;; Handle the part.
+ (if parse-tag
+ (save-restriction
+ (narrow-to-region beg end)
+ (let ((child (rmail-mime-process
+ nil (format "%s/%d" parse-tag index)
+ content-type content-disposition)))
+ ;; Display a tagline.
+ (aset (aref (rmail-mime-entity-display child) 1) 1
+ (aset (rmail-mime-entity-tagline child) 2 t))
+ (push child entities)))
+
+ (delete-region end next)
(save-restriction
(narrow-to-region beg end)
- (let ((child (rmail-mime-process
- nil (format "%s/%d" parse-tag index)
- content-type content-disposition)))
- ;; Display a tagline.
- (aset (aref (rmail-mime-entity-display child) 1) 1
- (aset (rmail-mime-entity-tagline child) 2 t))
- (push child entities)))
-
- (delete-region end next)
- (save-restriction
- (narrow-to-region beg end)
- (rmail-mime-show)))
- (goto-char (setq beg next)))
+ (rmail-mime-show)))
+ (goto-char (setq beg next))))
(when parse-tag
(setq entities (nreverse entities))