-#### Put the message (on stdin) in a drop that the test knows about.
-#### This will delete any lines in the message body that start with Bcc:,
-#### so avoid those.
-sed -e '/^[Bb][Cc][Cc]:/d' | \
-"${MH_LIB_DIR}"/rcvpack "${MH_TEST_DIR}"/Mail/fakesendmail.mbox
+ printf "220 If it can't be done in Bourne shell it's not worth doing\n"
+ while read line; do
+ #### Strip off carriage returns, they confuse the pattern matching.
+ line=`printf "$line" | tr -d '\r'`
+
+ case "$line" in
+ DATA) printf "354 do tell\n"; datamode=1 ;;
+ .) printf "250 done\n"; datamode=0; printf "$msg" | $deliver; msg= ;;
+ QUIT) printf "221 byenow\n"; break ;;
+ *) [ $datamode -eq 1 ] && msg="${msg}${line}
+" || printf "250 OK\n"
+ esac
+ done
+else
+ # sendmail/pipe
+
+ #### This will delete any lines in the message body that start with Bcc:!
+ sed -e '/^[Bb][Cc][Cc]:/d' | $deliver
+fi