3 # Test the basic behavior of post when configured with sendmail/pipe
9 if test -z "${MH_OBJ_DIR}"; then
10 srcdir=`dirname "$0"`/../..
11 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
14 . "${MH_OBJ_DIR}/test/common.sh"
17 testname="${MH_TEST_DIR}/$$"
19 #### Force test of sendmail/pipe regardless of configuration.
20 mts_pipe="${MHMTSCONF}-pipe"
21 sed -e 's/mts: *.*/mts: sendmail\/pipe/' "${MHMTSCONF}" >"$mts_pipe"
22 printf "%s\n" "sendmail: ${srcdir}/test/fakesendmail" >>"$mts_pipe"
29 # fakesendmail drops the message and any cc's into this mbox.
30 mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
31 inc -silent -file "$mbox"
32 rm -f "$mbox" "$mbox.map"
35 for expected in "$@"; do
37 # It's hard to calculate the exact Date: header post is going to
38 # use, so we'll just use sed to remove the actual date so we can easily
39 # compare it against our "correct" output.
41 sed -e 's/^Date:.*/Date:/' "`mhpath cur`" > "${testname}.actual$n"
43 check "${testname}.actual$n" "$expected"
45 if [ "`mhpath cur`" != "`mhpath last`" ]; then
46 folder next >/dev/null
47 arith_eval $n + 1; n=$arith_val
53 # Basic test - Simple message, single user, single recipient. Dots
54 # are not stuffed because sendmail/pipe causes sendmail to be invoked
57 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
58 From: Mr Nobody <nobody@example.com>
59 To: Somebody Else <somebody@example.com>
66 cat > "${testname}.expected" <<EOF
67 From: Mr Nobody <nobody@example.com>
68 To: Somebody Else <somebody@example.com>
76 test_sendmail_pipe "${testname}.expected"
80 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
81 From: Mr Nobody <nobody@example.com>
82 To: Somebody Else <somebody@example.com>
83 Bcc: Silent Partner <bcc@example.com>
90 cat > "${testname}.expected1" <<EOF
91 From: Mr Nobody <nobody@example.com>
92 To: Somebody Else <somebody@example.com>
100 cat > "${testname}.expected2" <<EOF
104 ------- Blind-Carbon-Copy
106 From: Mr Nobody <nobody@example.com>
107 To: Somebody Else <somebody@example.com>
114 ------- End of Blind-Carbon-Copy
117 test_sendmail_pipe "${testname}.expected1" "${testname}.expected2"