summaryrefslogtreecommitdiff
path: root/t/t9001-send-email.sh
diff options
context:
space:
mode:
authorJay Soffian <jaysoffian@gmail.com>2009-03-31 16:22:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-04-02 17:46:21 (GMT)
commita61c0ffa4474ad6dcec18a5454630371106710f4 (patch)
tree13050336905d92f95adaaff77bc7629c8d053d7a /t/t9001-send-email.sh
parent3b3637c3f1d752e6e6d559f30cc53bbec18537ef (diff)
downloadgit-a61c0ffa4474ad6dcec18a5454630371106710f4.zip
git-a61c0ffa4474ad6dcec18a5454630371106710f4.tar.gz
git-a61c0ffa4474ad6dcec18a5454630371106710f4.tar.bz2
send-email: ensure quoted addresses are rfc2047 encoded
sanitize_address assumes that quoted addresses (e.g., "first last" <first.last@example.com) do not need rfc2047 encoding, but this is not always the case. For example, various places in send-email extract addresses using parse_address_line. parse_address_line returns the addresses already quoted (e.g., "first last" <first.last@example.com), but not rfc2047 encoded. This patch makes sanitize_address stricter about what needs rfc2047 encoding and adds a test demonstrating where I noticed the problem. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-xt/t9001-send-email.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 84238f7..192b97b 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -505,6 +505,19 @@ test_expect_success 'confirm doesnt loop forever' '
test $ret = "0"
'
+test_expect_success 'utf8 Cc is rfc2047 encoded' '
+ clean_fake_sendmail &&
+ rm -fr outdir &&
+ git format-patch -1 -o outdir --cc="àéìöú <utf8@example.com>" &&
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ outdir/*.patch &&
+ grep "^Cc:" msgtxt1 |
+ grep "=?utf-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <utf8@example.com>"
+'
+
test_expect_success '--compose adds MIME for utf8 body' '
clean_fake_sendmail &&
(echo "#!$SHELL_PATH" &&