git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 2/2] send-email: show the new message id assigned by outlook in the logs

From
Aditya Garg <gargaditya08@live.com>
Date
May 25, 2025, 17:12 UTC
Message-ID
<65619ac4d7e4891a6f0ea157c7d30b0d2072d3fa.1748192784.git.gargaditya08@live.com>
In-Reply-To
<cover.1748192784.git.gargaditya08@live.com>

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@live.com>
---
 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
Previous: Aditya Garg
Message 10 of 10 in “send-email: fix bug breaking shallow threading if the first patch is edited”
  1. send-email: fix bug breaking shallow threading if the first patch is editedAditya Garg, May 23, 2025
  2. Aditya GargMay 23, 2025
  3. Junio C HamanoMay 23, 2025
  4. Jacob KellerMay 23, 2025
  5. send-email: fix bug resulting in increased message number if a message is editedAditya Garg, May 24, 2025
  6. 0/2 send-email: fix threads breaking in case user edits emails and improvements to outlook ID fix.Aditya Garg, May 25, 2025
  7. 1/2 send-email: fix bug resulting in increased message number if a message is editedAditya Garg, May 25, 2025
  8. Kristoffer HaugsbakkMay 25, 2025
  9. Aditya GargMay 26, 2025
  10. 2/2 send-email: show the new message id assigned by outlook in the logsAditya Garg, May 25, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.