X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/880f5c3a2c6315b73ecb54f2ec4c1a71bb9d6741..9c8f0ed7894b42fea0c8b429eba36684b0a405de:/test/post/test-mhmail diff --git a/test/post/test-mhmail b/test/post/test-mhmail index 08df5577..0d0943e1 100755 --- a/test/post/test-mhmail +++ b/test/post/test-mhmail @@ -56,6 +56,7 @@ test_mhmail () # sed -e 's/^Date:.*/Date:/' \ + -e 's/^Resent-Date:.*/Resent-Date:/' \ -e 's/^Message-ID:.*/Message-ID:/' "$actual" > "$actual".nodate rm -f "$actual" @@ -76,11 +77,13 @@ Usage: mhmail [addrs ... [switches]] -b(ody) text -c(c) addrs ... -f(rom) addr - -s(ubject) text + -su(bject) text + -r(esent) -pr(ofile) + -se(nd) + -nose(nd) -v(ersion) -h(elp) - -d(ebug) and all post(8)/send(1) switches EOF @@ -109,20 +112,18 @@ case `mhmail` in esac -# check -debug +# check -nosend # Not supported by compiled mhmail. -mhmail -debug recipient@example.com -from sender@localhost \ +mhmail -nosend recipient@example.com -from sender@localhost \ -server 127.0.0.1 -port $localport -body '' >"$actual" 2>"$actual_err" tmpfil=`head -1 $actual | sed -e 's/://'` cat > "$expected" < "$expected_err" < "$expected" < +RCPT TO: +DATA +To: recipient@example.com +From: sender@localhost +Date: + +message +. +QUIT +EOF + +test_mhmail "$expected" "-from sender@localhost -nosend -send" '|' message +[ ${failed:-0} -eq 0 ] || exit ${failed:-0} + + # check -from # Verified same behavior as compiled mhmail. cat > "$expected" < "$expected" < +RCPT TO: +DATA +Resent-To: recipient@example.com +Resent-From: recipient@example.com +To: recipient@example.com +From: sender@localhost +Date: +Resent-Date: + +please resend this message, #1 +. +QUIT +EOF + +test_mhmail "$expected" '-from recipient@example.com -resent' \ + -b 'To: recipient@example.com +From: sender@localhost +Date: Sat Jun 16 18:35:15 -0500 + +please resend this message, #1' + +[ ${failed:-0} -eq 0 ] || exit ${failed:-0} + +# check -resent -profile, using stdin +# Not supported by compiled mhmail. +cat > "$expected" < +RCPT TO: +DATA +To: recipient@example.com +From: sender@localhost +Date: +Resent-To: recipient@example.com +Resent-From: recipient@example.com +Resent-Date: + +please resend this message, #2 +. +QUIT +EOF + +test_mhmail "$expected" \ + '-from recipient@example.com -resent -profile -nomsgid' \ + '|' 'To: recipient@example.com +From: sender@localhost +Date: Sat Jun 16 18:35:15 -0500 + +please resend this message, #2' + +[ ${failed:-0} -eq 0 ] || exit ${failed:-0} + + +# check -resent -profile, using -b +# Not supported by compiled mhmail. +cat > "$expected" < +RCPT TO: +DATA +To: recipient@example.com +From: sender@localhost +Date: +Resent-To: recipient@example.com +Resent-From: recipient@example.com +Resent-Date: + +please resend this message, #3 +. +QUIT +EOF + +test_mhmail "$expected" \ + '-from recipient@example.com -resent -profile -nomsgid' \ + -b 'To: recipient@example.com +From: sender@localhost +Date: Sat Jun 16 18:35:15 -0500 + +please resend this message, #3' + +[ ${failed:-0} -eq 0 ] || exit ${failed:-0} + + exit ${failed:-0}