]> diplodocus.org Git - nmh/blobdiff - test/post/test-post-basic
Added NMH_ADDL_CPPFLAGS macro in new m4/cppflags.m4, to remove
[nmh] / test / post / test-post-basic
index a2e4fac0a3c16dcb6f868731a74fa1cc4ce625a0..c198007b780c754bfb6fc864a05f9c36ca12da91 100755 (executable)
@@ -34,6 +34,8 @@ DATA
 From: Mr Nobody <nobody@example.com>
 To: Somebody Else <somebody@example.com>
 Subject: Test
 From: Mr Nobody <nobody@example.com>
 To: Somebody Else <somebody@example.com>
 Subject: Test
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
 Date:
 
 This is a test
 Date:
 
 This is a test
@@ -56,9 +58,52 @@ This is a blank test
 EOF
 
 run_test "send -draft -server 127.0.0.1 -port $localport" \
 EOF
 
 run_test "send -draft -server 127.0.0.1 -port $localport" \
-       "post: message has no From: header
+         "post: message has no From: header
 post: See default components files for examples
 post: re-format message and try again
 send: message not delivered to anyone"
 
 post: See default components files for examples
 post: re-format message and try again
 send: message not delivered to anyone"
 
+#
+# Make sure that empty Nmh-* header lines are ignored, and that post
+# warns about non-empty ones.
+#
+cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
+From: Mr Nobody <nobody@example.com>
+To: Somebody Else <somebody@example.com>
+Nmh-Attachment:
+Nmh-Unused: suppress this line
+Subject: Test
+
+This is a test
+.
+EOF
+
+cat > "${testname}.expected" <<EOF
+EHLO nosuchhost.example.com
+MAIL FROM:<nobody@example.com>
+RCPT TO:<somebody@example.com>
+DATA
+From: Mr Nobody <nobody@example.com>
+To: Somebody Else <somebody@example.com>
+Subject: Test
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Date:
+
+This is a test
+..
+.
+QUIT
+EOF
+
+cat > "${testname}.expected_send_output" <<EOF
+post: ignoring header line -- Nmh-Unused: suppress this line
+EOF
+
+test_post "${testname}.actual" "${testname}.expected" \
+          >${testname}.send_output 2>&1
+
+check "${testname}.send_output" "${testname}.expected_send_output"
+
+
 exit ${failed:-0}
 exit ${failed:-0}