X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/eba408368603a3afe170ef61a334c3a479ea5a29..bea5b7b5b611f456f18c77e5e6d56bb65f9b0ef7:/test/slocal/test-slocal?ds=inline diff --git a/test/slocal/test-slocal b/test/slocal/test-slocal index eafe3139..db6c945b 100755 --- a/test/slocal/test-slocal +++ b/test/slocal/test-slocal @@ -58,67 +58,87 @@ run_test "$slocal -nonexistent" 'slocal: -nonexistent unknown' # check non-switch argument run_test "$slocal nonexistent" 'slocal: only switch arguments are supported' +# If no mail spool, explicitly specify the mailbox. +if grep 'mmdfldir:.*/dev/null' ${MHMTSCONF}.old >/dev/null; then + mbox="-mailbox ${MH_TEST_DIR}/Mail/mbox" +else + mbox= +fi + +#### Need to specify full path to tee on Cygwin. +[ -x /usr/bin/tee ] && tee=/usr/bin/tee || tee=tee + # check basic operation # Can't use rcvstore because slocal wipes out the environment. # So, it would put the message in the user's inbox, not the # test inbox. slocal also freopens stdout and stderr to # /dev/null, so we can't view them to verify simulated delivery. -cat >$md <"$md" <"$actual2" 2>&1 +$slocal -debug -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/1 \ + >"$actual2" 2>&1 run_test "grep ^retrieving $actual2" 'retrieving message from stdin' # check -verbose -$slocal -verbose -maildelivery $md <"$MH_TEST_DIR"/Mail/inbox/1 >"$actual2" 2>&1 -run_test "grep ^delivering $actual2" 'delivering to pipe "tee", success.' +$slocal -verbose -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/1 \ + >"$actual2" 2>&1 +run_test "grep ^delivering $actual2" "delivering to pipe \"$tee\", success." # check -noverbose -$slocal -verbose -noverbose -maildelivery $md <"$MH_TEST_DIR"/Mail/inbox/1 \ - >"$actual2" 2>&1 +$slocal -verbose -noverbose -maildelivery "$md" $mbox \ + <"$MH_TEST_DIR"/Mail/inbox/1 >"$actual2" 2>&1 run_test "grep ^delivering $actual2" '' rm -f "$actual2" # check match of From -cat >$md <"$md" <$md <"$md" <$md <"$md" <$md <"$md" <$md <"$md" <$md <"$md" <$md <"$md" <$md <"$md" <$md <"$md" <$md <"$md" <