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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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







[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux