3 # Tests to see if the -from, -to, -cc, -fcc, and -subject switches to
4 # "forw" work correctly.
7 if test -z "${MH_OBJ_DIR}"; then
8 srcdir=`dirname "$0"`/../..
9 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
12 . "$MH_OBJ_DIR/test/common.sh"
17 # Create a test template file (we create one here just in case the master
21 form="${MH_TEST_DIR}/$$.forwcomps"
23 %(void{nmh-from})%(void(width))%(putaddr From: )
24 %(void{nmh-to})%(void(width))%(putaddr To: )
25 %(void{nmh-cc})%(void(width))%(putaddr cc: )
27 Subject:%<{nmh-subject} %(trim)%(putlit)%?{subject} %(trim)%(putlit) (fwd)%>
31 expected="${MH_TEST_DIR}/$$.expected"
32 actual="${MH_TEST_DIR}/Mail/draft"
33 from="Mr Test User <test@example.com>"
34 to1="User One <userone@example.com>"
35 to2="User Two <usertwo@example.com>"
36 cc1="CC User One <ccuserone@example.com>"
37 cc2="CC User Two <ccusertwo@example.com>"
38 cc3="CC User Three <ccuserthree@example.com>"
39 cc4="CC User Four <ccuserfour@example.com>"
41 fcc2="+nosuchmailbox2"
42 subject="Totally bogus subject"
44 cat > "$expected" <<EOF
56 ------- Forwarded Message
60 cat `mhpath +inbox 1` >> "$expected"
62 cat >> "$expected" <<EOF
64 ------- End of Forwarded Message
67 forw -editor true -form "${form}" -from "${from}" -to "${to1}" -to "${to2}" \
68 -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
69 -fcc "${fcc2}" -subject "${subject}" -width 60 -nowhatnowproc 1 || exit 1
71 check "${expected}" "${actual}"
73 test "${failed:-0}" -eq 0 && rm "${form}"