From 7dd370701c62030b900c9bf52b0abc3b23e89235 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 11 Mar 2025 13:40:54 +0100 Subject: git-notify: MIME-encode committer name MIME-encode the committer name before using it in the From header, so that non-ASCII characters in the name are displayed correctly. --- libexec/git-notify | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libexec') diff --git a/libexec/git-notify b/libexec/git-notify index 0e50229..228c7d6 100755 --- a/libexec/git-notify +++ b/libexec/git-notify @@ -4,6 +4,7 @@ # # Copyright 2005 Alexandre Julliard # Copyright 2009, 2013 Nagios Plugins Development Team +# Copyright 2024, 2025 Monitoring Plugins Development Team # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -452,7 +453,7 @@ sub send_commit_notice($$) my ($ref,$obj) = @_; my %info = get_object_info($obj); my @notice = (); - my ($url,$subject,$obj_string); + my ($url,$from,$subject,$obj_string); if ($gitweb_url) { @@ -518,8 +519,8 @@ sub send_commit_notice($$) } $subject .= truncate_str(${$info{"log"}}[0],50); - mail_notification("$info{'committer_name'} <$from_address>", $commitlist_address, $subject, - "text/plain; charset=UTF-8", @notice); + $from = encode("MIME-Q",$info{'committer_name'}) . " <$from_address>"; + mail_notification($from, $commitlist_address, $subject, "text/plain; charset=UTF-8", @notice); } # send a commit notice to the CIA server -- cgit v1.2.3-74-g34f1