az writes:
> apart from the small ugliness of having the string "bcc:"
> hardcoded twice i prefer that 'if' block doing its thing (and all of
> its thing!) over strings conditionally accumulating across a
> pageful of code or more.
I agree with your coding decisions, but don't feel strongly if Ralph does.
One warning with the flags I use:
uip/post.c:874:14: warning: increment of a boolean expression
[-Wbool-operation]
badmsg++;
^~
And of course we need tests :-) Attached is a first pass. With Bcc, the test
passed before your fix because fakesendmail, used by the tests, was too lenient.
David
Description: Added test of Dcc: with sendmail/pipe.
Also, fixed test/fakesendmail to break with Bcc: using sendmail/pipe
before Alexander Zangerl's fix.
Author: David Levine <[email protected]>
--- a/test/fakesendmail
+++ b/test/fakesendmail
@@ -46,3 +46 @@ else
-
- #### This will delete any lines in the message body that start with Bcc:!
- sed -e '/^[Bb][Cc][Cc]:/d' | $deliver
+ $deliver
--- a/test/post/test-mts
+++ b/test/post/test-mts
@@ -42,0 +43 @@ EOF
+start_test 'invalid -mts selection'
@@ -59,0 +61 @@ test_sendmail ()
+ send_status=$?
@@ -63,3 +65,5 @@ test_sendmail ()
- mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
- inc -silent -file "$mbox"
- rm -f "$mbox"
+ if [ $send_status -eq 0 ]; then
+ mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
+ inc -silent -file "$mbox"
+ rm -f "$mbox"
+ fi
@@ -85,0 +90 @@ test_sendmail ()
+start_test '-mts sendmail/smtp'
@@ -111,0 +117 @@ test_sendmail sendmail/smtp "${testname}.expected"
+start_test '-mts sendmail/pipe'
@@ -135 +141,2 @@ test_sendmail sendmail/pipe "${testname}.expected"
-# check Bcc
+# check Bcc with sendmail/pipe
+start_test 'Bcc with sendmail/pipe'
@@ -161,0 +169 @@ Subject: Test
+BCC: [email protected]
@@ -180,0 +189,18 @@ test_sendmail sendmail/pipe "${testname}.expected1" "${testname}.expected2"
+# check Dcc with sendmail/pipe: it is unsupported
+start_test 'Dcc with sendmail/pipe'
+cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
+From: [email protected]
+Dcc: [email protected]
+
+.
+EOF
+
+cat > "${testname}.expected1" <<EOF
+post: Dcc header is not supported with sendmail/pipe
+post: re-format message and try again
+send: message not delivered to anyone
+EOF
+
+test_sendmail sendmail/pipe 2>"${testname}.actual1" || true
+check "${testname}.actual1" "${testname}.expected1"
+
@@ -182,0 +209 @@ rm -f ${MHMTSCONF}
+finish_test
-- --
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers