]>
diplodocus.org Git - nmh/blob - test/post/test-pipe
3 # Test the basic behavior of post when configured with pipe delivery method.
8 if test -z "${MH_OBJ_DIR}"; then
9 srcdir
=`dirname "$0"`/..
/..
10 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
13 .
"${MH_OBJ_DIR}/test/common.sh"
16 testname
="${MH_TEST_DIR}/$$"
18 #### Force test of pipe regardless of configuration.
19 mts_pipe
="${MHMTSCONF}-pipe"
20 sed -e 's/mts: *.*/mts: pipe/' "${MHMTSCONF}" >"$mts_pipe"
21 printf "%s\n" "sendmail: ${srcdir}/test/fakesendmail" >>"$mts_pipe"
28 # fakesendmail drops the message and any cc's into this mbox.
29 mbox
="${MH_TEST_DIR}"/Mail
/fakesendmail.mbox
30 inc
-silent -file "$mbox"
31 rm -f "$mbox" "$mbox.map"
34 for expected
in "$@"; do
36 # It's hard to calculate the exact Date: header post is going to
37 # use, so we'll just use sed to remove the actual date so we can easily
38 # compare it against our "correct" output.
40 sed -e 's/^Date:.*/Date:/' "`mhpath cur`" > "${testname}.actual$n"
42 check
"${testname}.actual$n" "$expected"
44 if [ "`mhpath cur`" != "`mhpath last`" ]; then
45 folder next
>/dev
/null
46 arith_eval
$n + 1; n
=$arith_val
52 # Basic test - Simple message, single user, single recipient.
53 # Dots are not stuffed because pipe invokes sendmail with -i.
55 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
56 From: Mr Nobody <nobody@example.com>
57 To: Somebody Else <somebody@example.com>
64 cat > "${testname}.expected" <<EOF
65 From: Mr Nobody <nobody@example.com>
66 To: Somebody Else <somebody@example.com>
74 test_pipe
"${testname}.expected"
78 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
79 From: Mr Nobody <nobody@example.com>
80 To: Somebody Else <somebody@example.com>
81 Bcc: Silent Partner <bcc@example.com>
88 cat > "${testname}.expected1" <<EOF
89 From: Mr Nobody <nobody@example.com>
90 To: Somebody Else <somebody@example.com>
98 cat > "${testname}.expected2" <<EOF
102 ------- Blind-Carbon-Copy
104 From: Mr Nobody <nobody@example.com>
105 To: Somebody Else <somebody@example.com>
112 ------- End of Blind-Carbon-Copy
115 test_pipe
"${testname}.expected1" "${testname}.expected2"