git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] send-email: don't duplicate Reply-to:
@ 2025-09-15  4:12 NeilBrown
  2025-09-16  1:14 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2025-09-15  4:12 UTC (permalink / raw)
  To: git


If I run
  git send-email --compose --reply-to 'ME <my@address.net>' .....

and edit the intro message, then the message will get two copies of the
Reply-To field.  gmail.com rejects such messages.

This happens because a Reply-To is inserted into the intro message
template, and then the intro message headers are copied and another
Reply-to is added.

This patch fixes the problem by noticing the Reply-To: header when the
intro is parsed, and using it to assign $reply_to rather than blindly
coping it into the new headers.

Signed-off-by: NeilBrown <neil@brown.name>
---
 git-send-email.perl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/git-send-email.perl b/git-send-email.perl
index 437f8ac46a85..e2248c223119 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1931,6 +1931,9 @@ sub pre_process_file {
 					$in_reply_to = $1;
 				}
 			}
+			elsif (/^Reply-To: (.*)/i) {
+				$reply_to = $1;
+			}
 			elsif (/^References: (.*)/i) {
 				if (!$initial_in_reply_to || $thread) {
 					$references = $1;
-- 
2.50.0.107.gf914562f5916.dirty


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-17  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-15  4:12 [PATCH] send-email: don't duplicate Reply-to: NeilBrown
2025-09-16  1:14 ` Junio C Hamano
2025-09-17  6:21   ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).