# arguments: dist switches
test_dist ()
{
- printf 'send\n' | dist "$@" >/dev/null
+ printf 'send\n' | run_prog dist "$@" >/dev/null
# fakesendmail drops the message and any cc's into this mbox.
mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
# check -inplace
# Hard link the message and verify that the new one does get annotated.
- ln "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
+ ln "${MH_TEST_DIR}/Mail/inbox/9" "${MH_TEST_DIR}/Mail/inbox/9.link"
cat >"$expected" <<EOF
-From: Test8 <test8@example.com>
+From: Test9 <test9@example.com>
To: Some User <user@example.com>
Date: Fri, 29 Sep 2006 00:00:00
-Message-Id: 8@test.nmh
-Subject: Testing message 8
+Message-Id: 9@test.nmh
+Subject: Testing message 9
Resent-From: ${localmbox}
Resent-To: somebody@example.com
Resent-Date:
-This is message number 8
+This is message number 9
EOF
- test_dist 8 -noedit -to somebody@example.com -annotate -noinplace -inplace
- check "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
+ test_dist 9 -noedit -to somebody@example.com -annotate -noinplace -inplace
+ check "${MH_TEST_DIR}/Mail/inbox/9" "${MH_TEST_DIR}/Mail/inbox/9.link"
fi
# check -draftfolder
test_dist +inbox 1 -noedit -to somebody@example.com -fcc +outbox
run_test 'scan +outbox -width 6 2' ' 2 '
+#
+# Check that dist encodes headers using RFC-2047 properly
+#
+
+LC_ALL=en_US.UTF-8; export LC_ALL
+
+cat >"$expected" <<EOF
+From: Test1 <test1@example.com>
+To: Some User <user@example.com>
+Date: Fri, 29 Sep 2006 00:00:00
+Message-Id: 1@test.nmh
+Subject: Testing message 1
+Resent-From: =?UTF-8?Q?Mr_F=C3=B8o_Bar?= <foo@bar.com>
+Resent-To: =?UTF-8?Q?Mr_Nobod=C3=BF?= <nobody@nowhere.com>
+Resent-Date:
+
+This is message number 1
+EOF
+
+test_dist +inbox 1 -noedit -from 'Mr Føo Bar <foo@bar.com>' \
+ -to 'Mr Nobodÿ <nobody@nowhere.com>' -fcc +outbox
exit ${failed:-0}