]> diplodocus.org Git - nmh/blobdiff - test/mhmail/test-mhmail
Okay, fixed a few more things. Almost there?
[nmh] / test / mhmail / test-mhmail
index bd03c780df1d4581d6436e77e830c8cb17db4286..ff9fd40b50dec345e24faa5a15bfeb3637d92abd 100755 (executable)
@@ -14,20 +14,18 @@ fi
 
 . "${srcdir}/test/post/test-post-common.sh"
 
-# Find MIME type string, using mimetypeproc if configured with it.
+# Find MIME type string, using configured procs if available.
 MIMETYPEPROC=`mhparam mimetypeproc`
+MIMEENCODINGPROC=`mhparam mimeencodingproc`
 content_type_string() {
-echo $MIMETYPEPROC; $MIMETYPEPROC $1 # temporary, for debugging on OpenBSD
-ls -l dead.letter; /bin/rm -f dead.letter # temporary, for debugging on OpenBSD
-
-  if test -z "$MIMETYPEPROC"; then
+  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
-    # 1) Excise leading filename followed by : and any whitespace.
-    # 2) Wrap charset value in double quotes.  Assume that it isn't already.
-    printf "%s %s%s" \
-      `$MIMETYPEPROC $1 | sed -e 's/.*: *//' -e 's/\(charset=\)\(.*\)/\1"\2"/'`\
-      "; name=\"`basename $1`\""
+    #### 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
 }
 
@@ -294,6 +292,8 @@ RCPT TO:<recipient@example.com>
 DATA
 To: recipient@example.com
 From: sender8@localhost
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
 Date:
 Message-ID: