X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/0f0af4e32a4d734209c16282b63f7cb1094e2699..05dba91fcb152e1941e7f7f145b1d830c5e8f6d0:/test/dist/test-dist diff --git a/test/dist/test-dist b/test/dist/test-dist index 769406cb..c082b5e3 100755 --- a/test/dist/test-dist +++ b/test/dist/test-dist @@ -20,7 +20,7 @@ expected=$MH_TEST_DIR/$$.expected expected_err=$MH_TEST_DIR/$$.expected_err actual=$MH_TEST_DIR/$$.actual actual_err=$MH_TEST_DIR/$$.actual_err -localmbox=`${MH_LIB_DIR}/ap -format "%(localmbox)" 0` +localmbox=`${MH_LIB_DIR}/ap -format "%(localmbox)" 0 | sed 's/^<\(.*\)>$/\1/'` #### Use sendmail/pipe below to override default mts. mts_fakesendmail="${MHMTSCONF}-fakesendmail" @@ -31,7 +31,7 @@ MHMTSCONF="$mts_fakesendmail" # 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 @@ -95,6 +95,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -112,6 +113,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -132,6 +134,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 Resent-From: me@example.com Resent-To: you@example.com @@ -149,6 +152,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 2@test.nmh Subject: Testing message 2 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -165,6 +169,7 @@ Resent: somebody@example.com From: Test2 To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 2@test.nmh Subject: Testing message 2 This is message number 2 @@ -194,6 +199,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -208,6 +214,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 This is message number 1 @@ -225,6 +232,7 @@ if [ $hard_links_supported -eq 1 ]; then From: Test8 To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 8@test.nmh Subject: Testing message 8 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -239,20 +247,21 @@ EOF # 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" < +From: Test9 To: Some User Date: Fri, 29 Sep 2006 00:00:00 -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 @@ -260,6 +269,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 3@test.nmh Subject: Testing message 3 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -275,6 +285,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 3@test.nmh Subject: Testing message 3 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -291,6 +302,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 3@test.nmh Subject: Testing message 3 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -311,6 +323,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 Resent-From: me@example.com Resent-To: somebody@example.com @@ -326,6 +339,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -342,6 +356,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -357,6 +372,7 @@ cat >"$expected" < To: Some User Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 1@test.nmh Subject: Testing message 1 Resent-From: ${localmbox} Resent-To: somebody@example.com @@ -368,5 +384,26 @@ EOF 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" < +To: Some User +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?= +Resent-To: =?UTF-8?Q?Mr_Nobod=C3=BF?= +Resent-Date: + +This is message number 1 +EOF + +test_dist +inbox 1 -noedit -from 'Mr Føo Bar ' \ + -to 'Mr Nobodÿ ' -fcc +outbox exit ${failed:-0}