-mhmail -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+mhmail -help 2>&1 | sed '/^$/,$d' >"$actual"
+check "$expected" "$actual"
for switch in attach body cc from headerfield subject to; do
run_test "mhmail recipient -$switch" \
"mhmail: missing argument to -$switch"
for switch in attach body cc from headerfield subject to; do
run_test "mhmail recipient -$switch" \
"mhmail: missing argument to -$switch"
# 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.
# 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.
# 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"
# 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"
# 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.
# 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.
# Shows different behavior than compiled mhmail, which suppressed the newline.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
# Shows different behavior than compiled mhmail, which suppressed the newline.
cat > "$expected" <<EOF
EHLO nosuchhost.example.com
[ ${failed:-0} -eq 0 ] || exit ${failed:-0}
# check -resent -profile, using stdin
[ ${failed:-0} -eq 0 ] || exit ${failed:-0}
# check -resent -profile, using stdin
test_mhmail "$expected" \
"-from sender27@example.com -headerfield MIME-Version:1.0 \
-headerfield Content-Type:text/plain;charset=utf-8 \
test_mhmail "$expected" \
"-from sender27@example.com -headerfield MIME-Version:1.0 \
-headerfield Content-Type:text/plain;charset=utf-8 \