+(defun mml-insert-mime-headers (cont type charset encoding)
+ (let (parameters disposition description)
+ (when (or charset
+ (setq parameters
+ (mml-parameter-string
+ cont '(name access-type expiration size permission)))
+ (not (equal type "text/plain")))
+ (insert "Content-Type: " type)
+ (when charset
+ (insert (format "; charset=\"%s\"" charset)))
+ (when parameters
+ (insert parameters))
+ (insert "\n"))
+ (when (or (setq disposition (cdr (assq 'disposition cont)))
+ (setq parameters
+ (mml-parameter-string
+ cont '(filename creation-date modification-date
+ read-date))))
+ (insert "Content-Disposition: " (or disposition "inline"))
+ (when parameters
+ (insert parameters))
+ (insert "\n"))
+ (unless (eq encoding '7bit)
+ (insert (format "Content-Transfer-Encoding: %s\n" encoding)))
+ (when (setq description (cdr (assq 'description cont)))
+ (insert "Content-Description: " description "\n"))
+ ))
+
+(defun mml-parameter-string (cont types)
+ (let ((string "")
+ value type)
+ (while (setq type (pop types))
+ (when (setq value (cdr (assq type cont)))
+ (setq string (concat string ";\n " (symbol-name type) "="
+ (if (string-match "[^_0-9A-Za-z]" value)
+ (prin1-to-string value)
+ value)))))
+ (when (not (zerop (length string)))
+ string)))
+
+(defvar ange-ftp-path-format)
+(defvar efs-path-regexp)
+(defun mml-parse-file-name (path)
+ (if (if (boundp 'efs-path-regexp)
+ (string-match efs-path-regexp path)
+ (if (boundp 'ange-ftp-path-format)
+ (string-match (car ange-ftp-path-format))))
+ (list (match-string 1 path) (match-string 2 path)
+ (substring path (1+ (match-end 2))))
+ path))
+