- (when (string= (car (split-string type "/")) "message")
- ;; message/rfc822 parts have to have their heads encoded.
- (save-restriction
- (message-narrow-to-head)
- (let ((rfc2047-header-encoding-alist nil))
- (mail-encode-encoded-word-buffer))))
- (setq charset (mm-encode-body))
- (setq encoding (mm-body-encoding
- charset
- (if (string= (car (split-string type "/"))
- "message")
- '8bit
- (cdr (assq 'encoding cont)))))
+ (cond
+ ((eq (car cont) 'mml)
+ (let ((mml-boundary (funcall mml-boundary-function
+ (incf mml-multipart-number))))
+ (mml-to-mime))
+ (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b")))
+ ;; ignore 0x1b, it is part of iso-2022-jp
+ (setq encoding (mm-body-7-or-8))))
+ ((string= (car (split-string type "/")) "message")
+ (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b")))
+ ;; ignore 0x1b, it is part of iso-2022-jp
+ (setq encoding (mm-body-7-or-8))))
+ (t
+ (setq charset (mm-encode-body))
+ (setq encoding (mm-body-encoding
+ charset (cdr (assq 'encoding cont))))))