Whenever an email is sent, send-email shows a log at last, which contains all the headers of the email that was send successfully. In case outlook changes the Message-ID, a log for the same is shown to the user, but that change is not reflected when the log containing all the headers is displayed. This patch fixes this by modifying the $header variable, which is responsible for showing the logs at the end. Also, the log which states that the Message-ID has been changed will now be shown only when smtp-debug is enabled, since the main log having all of the headers is anyways displaying the new Message-ID. Signed-off-by: Aditya Garg <gargaditya08@xxxxxxxx> --- git-send-email.perl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-send-email.perl b/git-send-email.perl index b09251c4fc..e8019c40ba 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1776,7 +1776,9 @@ sub send_message { if (is_outlook($smtp_server)) { if ($smtp->message =~ /<([^>]+)>/) { $message_id = "<$1>"; - printf __("Outlook reassigned Message-ID to: %s\n"), $message_id; + # Replace the original Message-ID in $header with the new one + $header =~ s/^(Message-ID:\s*).*\n/${1}$message_id\n/m; + printf __("Outlook reassigned Message-ID to: %s\n"), $message_id if $smtp->debug; } else { warn __("Warning: Could not retrieve Message-ID from server response.\n"); } -- 2.43.0