2 ######################################################
6 ######################################################
9 # -check, -client, -server, -port, -user, -sasl, -saslmech, -snoop, -tls, -notls
13 if test -z "${MH_OBJ_DIR}"; then
14 srcdir=`dirname $0`/../..
15 MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
18 . "$MH_OBJ_DIR/test/common.sh"
22 expected=$MH_TEST_DIR/$$.expected
23 actual=$MH_TEST_DIR/$$.actual
27 cat >$MH_TEST_DIR/Mail/draft <<'EOF'
28 From: Test1 <test1@example.com>
29 To: Some User <user@example.com>
30 Subject: Testing message 1
32 This is a draft message.
36 # Only look at first 10 lines because the rest depend on
37 # whether sasl support was configured in.
39 Usage: whom [switches] [file]
44 -(draftf)older +folder
51 whom -help | head -10 >$actual 2>&1
52 check $expected $actual
57 * ) echo "$0: whom -v generated unexpected output" 1>&2
58 failed=`expr ${failed:-0} + 1`;;
61 # check with no options
62 run_test 'whom' ' -- Network Recipients --
66 run_test 'whom -check -nocheck' ' -- Network Recipients --
69 # check with file specified
70 run_test "whom $MH_TEST_DIR/Mail/draft" ' -- Network Recipients --
74 run_test "whom -draftm draft" ' -- Network Recipients --
77 # check -draftfolder with -draftmessage
78 folder +drafts -create >/dev/null
79 folder +inbox -fast >/dev/null
80 cp $MH_TEST_DIR/Mail/draft $MH_TEST_DIR/Mail/drafts/1
81 run_test "whom -draftfolder +drafts -draftm 1" \
82 ' -- Network Recipients --
85 # check -draftfolder with current draftmessage
86 folder +drafts 1 >/dev/null
87 run_test "whom -draftfolder +drafts" \
88 ' -- Network Recipients --
91 # check -nodraftfolder
92 run_test 'whom -draftfolder +nonexistent -nodraftfolder' \
93 ' -- Network Recipients --
96 # check -draft, though I'm not sure that it's useful. Note that it
97 # must appear after the file argument when run standalone.
98 run_test "whom $MH_TEST_DIR/Mail/drafts/1 -draft" \
99 ' -- Network Recipients --
103 rm -f $MH_TEST_DIR/Mail/draft
104 cat >$MH_TEST_DIR/Mail/draft <<'EOF'
105 From: Test1 <test1@example.com>
107 Subject: Testing message 1
109 This is a draft message.
112 cat >$MH_TEST_DIR/Mail/nmhaliases <<'EOF'
115 run_test 'whom -alias nmhaliases' ' -- Network Recipients --
116 user1 at example.com'
118 # check -alias with nonexistent aliasfile
119 run_test 'whom -alias nonexistent' \
120 "whom: aliasing error in nonexistent - unable to read 'nonexistent'"