@@ -1299,6 +1299,49 @@ test_expect_success $PREREQ 'utf8 sender is not duplicated' '
12991299 test_line_count = 1 msgfrom
13001300'
13011301
1302+ test_expect_success $PREREQ ' setup expect for cc list' "
1303+ cat >expected-cc <<\EOF
1304+ !recipient@example.com!
1305+ !author@example.com!
1306+ !one@example.com!
1307+ !os@example.com!
1308+ !odd_?=mail@example.com!
1309+ !doug@example.com!
1310+ !codev@example.com!
1311+ !thor.au@example.com!
1312+ EOF
1313+ "
1314+
1315+ test_expect_success $PREREQ ' cc list is sanitized' '
1316+ clean_fake_sendmail &&
1317+ test_commit weird_cc_body &&
1318+ test_when_finished "git reset --hard HEAD^" &&
1319+ git commit --amend -F - <<-EOF &&
1320+ Test Cc: sanitization.
1321+
1322+ Cc: Person, One <one@example.com>
1323+ Cc: Ronnie O${SQ}Sullivan <os@example.com>
1324+ Reviewed-by: Füñný Nâmé <odd_?=mail@example.com>
1325+ Reported-by: bugger on Jira
1326+ Reported-by: Douglas Reporter <doug@example.com> [from Jira profile]
1327+ BugID: 12345
1328+ Co-developed-by: "C. O. Developer" <codev@example.com>
1329+ Signed-off-by: A. U. Thor <thor.au@example.com>
1330+ EOF
1331+ git send-email -1 --to=recipient@example.com \
1332+ --smtp-server="$(pwd)/fake.sendmail" >actual-show-all-headers &&
1333+ test_cmp expected-cc commandline1 &&
1334+ test_grep "^(body) Adding cc: \"Person, One\" <one@example.com>" actual-show-all-headers &&
1335+ test_grep "^(body) Adding cc: Ronnie O${SQ}Sullivan <os@example.com>" actual-show-all-headers &&
1336+ test_grep "^(body) Adding cc: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?="\
1337+ " <odd_?=mail@example.com>" actual-show-all-headers &&
1338+ test_grep "^(body) Ignoring Reported-by .* bugger on Jira" actual-show-all-headers &&
1339+ test_grep "^(body) Adding cc: Douglas Reporter <doug@example.com>" actual-show-all-headers &&
1340+ test_grep ! "12345" actual-show-all-headers &&
1341+ test_grep "^(body) Adding cc: \"C. O. Developer\" <codev@example.com>" actual-show-all-headers &&
1342+ test_grep "^(body) Adding cc: \"A. U. Thor\" <thor.au@example.com>" actual-show-all-headers
1343+ '
1344+
13021345test_expect_success $PREREQ ' sendemail.composeencoding works' '
13031346 clean_fake_sendmail &&
13041347 git config sendemail.composeencoding iso-8859-1 &&
0 commit comments