# check -help
+start_test "-help"
# Verified behavior consistent with compiled sendmail.
cat >$expected <<EOF
Usage: mhmail [-t(o)] addrs ... [switches]
# check -version
+start_test "-version"
# Verified same behavior as compiled mhmail.
case `mhmail -v` in
mhmail\ --*) ;;
esac
# check for missing argument to switches that require them
+start_test "for missing argument to switches that require them"
for switch in attach body cc from headerfield subject to; do
run_test "mhmail recipient -$switch" \
"mhmail: missing argument to -$switch"
# check with no switches
+start_test "with no switches"
# That will just run inc, which we don't want to do anything,
# so tell inc to just display its version.
# Verified same behavior as compiled mhmail.
# check -nosend
+start_test "-nosend"
# Not supported by compiled mhmail.
mhmail -nosend recipient@example.com -from sender1@localhost \
-server 127.0.0.1 -port $localport -body '' >"$actual" 2>"$actual_err"
# check -send
+start_test "-send"
# Not supported by compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -from
+start_test "-from"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -from and -body
+start_test "-from and -body"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -from and -cc
+start_test "-from and -cc"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -from and multiple -cc addresses
+start_test "-from and multiple -cc addresses"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -from and -subject
+start_test "-from and -subject"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -from and -profile
+start_test "-from and -profile"
# Show that -profile causes mhmail to 1) read the profile and
# 2) use send(1) by added a send switch to the profile and
# verifying that it gets used.
# check repeated -from and -subject switches
+start_test "repeated -from and -subject switches"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
[ ${failed:-0} -eq 0 ] || exit ${failed:-0}
# check repeated -body switches
+start_test "repeated -body switches"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check multiple -cc switches
+start_test "multiple -cc switches"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check separated -cc arguments
+start_test "separated -cc arguments"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -cc switch followed by -to switch
+start_test "-cc switch followed by -to switch"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check with no newline on stdin
+start_test "with no newline on stdin"
# Shows different behavior than compiled mhmail, which was silent in this case.
cat > "$expected" <<EOF
EOF
# check with one newline on stdin
+start_test "with one newline on stdin"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check with multiple newlines on stdin
+start_test "with multiple newlines on stdin"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check with text and no trailing newline on stdin
+start_test "with text and no trailing newline on stdin"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check with text and multiple trailing blank lines on stdin
+start_test "with text and multiple trailing blank lines on stdin"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check with no newline to -body
+start_test "with no newline to -body"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check with one newline to -body
+start_test "with one newline to -body"
# Shows different behavior than compiled mhmail, which suppressed the newline.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check with multiple newlines to -body
+start_test "with multiple newlines to -body"
# Shows different behavior than compiled mhmail, which suppressed one
# of the newlines.
cat > "$expected" <<EOF
# check with text and no trailing newline to -body
+start_test "with text and no trailing newline to -body"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check with text and multiple trailing blank lines to -body
+start_test "with text and multiple trailing blank lines to -body"
# Shows different behavior than compiled mhmail, which suppressed one
# of the newlines.
cat > "$expected" <<EOF
# check -resent
+start_test "-resent"
# Verified same behavior as compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
[ ${failed:-0} -eq 0 ] || exit ${failed:-0}
# check -resent -profile, using stdin
+start_test "-resent -profile, using stdin"
# Not supported by compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -resent -profile, using -b
+start_test "-resent -profile, using -b"
# Not supported by compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -headerfield.
+start_test "-headerfield."
# Not supported by compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check multiple -headerfields.
+start_test "multiple -headerfields."
# Not supported by compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# check -attach
+start_test "-attach"
# Not supported by compiled mhmail.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
[ ${failed:-0} -eq 0 ] || exit ${failed:-0}
+finish_test
exit ${failed:-0}