X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/98df2244c328b45c72cdb750f3e38889699fe020..a376784b51d76aee169b9f358bc7ccef9d70a04a:/test/mhmail/test-mhmail diff --git a/test/mhmail/test-mhmail b/test/mhmail/test-mhmail index 1caf0399..27188c77 100755 --- a/test/mhmail/test-mhmail +++ b/test/mhmail/test-mhmail @@ -14,6 +14,19 @@ fi . "${srcdir}/test/post/test-post-common.sh" +# Find MIME type string, using mimetypeproc if configured with it. +MIMETYPEPROC=`mhparam mimetypeproc` +content_type_string() { + if test -z "$MIMETYPEPROC"; then + 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" \ + `$MIMETYPEPROC $1` "; name=\"`basename $1`\"; charset=\"us-ascii\"" + fi +} + # Customize test_post () for use with mhmail. # $1 is expected output file, provided by caller # $2 is mhmail switches, except for -body @@ -114,10 +127,6 @@ esac # check -nosend # Not supported by compiled mhmail. -#### TEMPORARY hack to diagnose failure on Solaris. -echo before -sh -x mhmail -nosend recipient@example.com -from sender1@localhost -body '' 2>&1 -echo after mhmail -nosend recipient@example.com -from sender1@localhost \ -server 127.0.0.1 -port $localport -body '' >"$actual" 2>"$actual_err" @@ -795,7 +804,7 @@ Content-Type: text/plain; charset="us-ascii" See how easy it is to add an attachment! ------- =_aaaaaaaaaa0 -Content-Type: text/plain; name="attachment.txt"; charset="us-ascii" +Content-Type: `content_type_string ${srcdir}/test/mhmail/attachment.txt` Content-Description: attachment.txt Content-Disposition: attachment; filename="attachment.txt"