- (let* ((content-type (or (mime-read-Content-Type) default-ctl))
- (encoding (mime-read-Content-Transfer-Encoding default-encoding))
- (boundary (assoc "boundary"
- (mime-content-type-parameters content-type))))
- (cond (boundary
- (setq boundary (std11-strip-quoted-string (cdr boundary)))
- (mime-parse-multipart boundary content-type encoding node-id)
+ (let ((header-start (point-min))
+ header-end
+ body-start
+ (body-end (point-max))
+ content-type content-disposition encoding
+ primary-type)
+ (goto-char header-start)
+ (if (re-search-forward "^$" nil t)
+ (setq header-end (match-end 0)
+ body-start (1+ header-end))
+ (setq header-end (point-min)
+ body-start (point-min))
+ )
+ (save-restriction
+ (narrow-to-region header-start header-end)
+ (setq content-type (or (let ((str (std11-fetch-field "Content-Type")))
+ (if str
+ (mime-parse-Content-Type str)
+ ))
+ default-ctl)
+ content-disposition (let ((str (std11-fetch-field
+ "Content-Disposition")))
+ (if str
+ (mime-parse-Content-Disposition str)
+ ))
+ encoding (let ((str (std11-fetch-field
+ "Content-Transfer-Encoding")))
+ (if str
+ (mime-parse-Content-Transfer-Encoding str)
+ default-encoding))
+ primary-type (mime-content-type-primary-type content-type))
+ )
+ (cond ((eq primary-type 'multipart)
+ (mime-parse-multipart header-start header-end
+ body-start body-end
+ content-type content-disposition encoding
+ node-id)