diff options
author | Csókás, Bence <csokas.bence@prolan.hu> | 2024-07-01 11:01:16 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-07-01 20:38:29 +0200 |
commit | c852531f451331eb9d5ba57d154b0e150246a438 (patch) | |
tree | 7f8eef5d6a46f7929ee2f3a8104a74f35d62f033 /git-send-email.perl | |
parent | Git 2.45 (diff) | |
download | git-c852531f451331eb9d5ba57d154b0e150246a438.tar.xz git-c852531f451331eb9d5ba57d154b0e150246a438.zip |
git-send-email: use sanitized address when reading mbox body
Addresses that are mentioned on the trailers in the commit log
messages (e.g., "Reviewed-by") are added to the "Cc:" list by "git
send-email". These hand-written addresses, however, may be
malformed (e.g., having unquoted "." and other punctutation marks in
the display-name part) and can upset MTA.
The code does use the sanitize_address() helper on these
address-looking strings to turn them into valid addresses, but it is
used only to see if the address should be suppressed. The original
string taken from the message is added to the @cc list if the code
decides the address is not suppressed.
Because the addresses on trailer lines are hand-written and more
likely to contain malformed addresses, when adding to the @cc list,
use the result from sanitize_address, not the original. Note that
we do not modify the behaviour for addresses taken from the e-mail
headers, as they are more likely to be machine generated and
well-formed.
Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index 821b2b3a13..c351bb0d98 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1844,9 +1844,9 @@ sub pre_process_file { $what, $_) unless $quiet; next; } - push @cc, $c; + push @cc, $sc; printf(__("(body) Adding cc: %s from line '%s'\n"), - $c, $_) unless $quiet; + $sc, $_) unless $quiet; } } close $fh; |