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.
35 # check with no options
36 run_test 'whom' ' -- Network Recipients --
40 run_test 'whom -check -nocheck' ' -- Network Recipients --
43 # check with file specified
44 run_test "whom $MH_TEST_DIR/Mail/draft" ' -- Network Recipients --
48 run_test "whom -draftm draft" ' -- Network Recipients --
51 # check -draftfolder with -draftmessage
52 folder +drafts -create >/dev/null
53 folder +inbox -fast >/dev/null
54 cp $MH_TEST_DIR/Mail/draft $MH_TEST_DIR/Mail/drafts/1
55 run_test "whom -draftfolder +drafts -draftm 1" \
56 ' -- Network Recipients --
59 # check -draftfolder with current draftmessage
60 folder +drafts 1 >/dev/null
61 run_test "whom -draftfolder +drafts" \
62 ' -- Network Recipients --
65 # check -nodraftfolder
66 run_test 'whom -draftfolder +nonexistent -nodraftfolder' \
67 ' -- Network Recipients --
70 # check -draft, though I'm not sure that it's useful. Note that it
71 # must appear after the file argument when run standalone.
72 run_test "whom $MH_TEST_DIR/Mail/drafts/1 -draft" \
73 ' -- Network Recipients --
77 rm -f $MH_TEST_DIR/Mail/draft
78 cat >$MH_TEST_DIR/Mail/draft <<'EOF'
79 From: Test1 <test1@example.com>
81 Subject: Testing message 1
83 This is a draft message.
86 cat >$MH_TEST_DIR/Mail/nmhaliases <<'EOF'
89 run_test 'whom -alias nmhaliases' ' -- Network Recipients --
92 # check -alias with nonexistent aliasfile
93 run_test 'whom -alias nonexistent' \
94 "whom: aliasing error in nonexistent - unable to read 'nonexistent'"