+# Find MIME type string, using configured procs if available.
+MIMETYPEPROC=`mhparam mimetypeproc`
+MIMEENCODINGPROC=`mhparam mimeencodingproc`
+content_type_string() {
+ if test -z "$MIMETYPEPROC" -o -z "$MIMEENCODINGPROC"; then
+ #### This should be the order of name and charset.
+ echo "text/plain; name=\"`basename $1`\"; charset=\"us-ascii\""
+ else
+ #### Excise any leading filename followed by : and whitespace.
+ printf '%s; charset="%s"; name="%s"' \
+ `$MIMETYPEPROC $1 | sed -e 's/.*: *//'` \
+ `$MIMEENCODINGPROC $1 | sed -e 's/.*: *//'` `basename $1`
+ fi
+}
+