Skip to content

Commit 53a7296

Browse files
g-papegitster
authored andcommitted
hooks/post-receive-email: set declared encoding to utf-8
Some email clients (e.g., claws-mail) display the message body incorrectly when the charset is not defined explicitly in a Content-Type header. "git log" generates logs in UTF-8 encoding by default, so add a Content-Type header declaring that encoding to the emails the post-receive-email example hook sends. [jn: also setting the Content-Transfer-Encoding so MTAs know what kind of mangling might be needed when sending to a non 8-bit clean SMTP host] Requested-by: Alexander Gerasiov <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3109bdb commit 53a7296

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/hooks/post-receive-email

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ generate_email_header()
242242
cat <<-EOF
243243
To: $recipients
244244
Subject: ${emailprefix}$projectdesc $refname_type $short_refname ${change_type}d. $describe
245+
MIME-Version: 1.0
246+
Content-Type: text/plain; charset=utf-8
247+
Content-Transfer-Encoding: 8bit
245248
X-Git-Refname: $refname
246249
X-Git-Reftype: $refname_type
247250
X-Git-Oldrev: $oldrev

0 commit comments

Comments
 (0)