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

[PATCH] Don't print an empty Cc header in SMTP mode when there's no cc recipient defined

From
Ask Bjørn Hansen <ask@develooper.com>
Date
Nov 19, 2007, 10:48 UTC
Message-ID
<1195469295-5774-1-git-send-email-ask@develooper.com>
In-Reply-To
<7voddqodhs.fsf@gitster.siamese.dyndns.org>
Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
---

There's some duplicate code between "what we do for sendmail" and "what we do for SMTP" paths that should be fixed - this doesn't do that, it only makes the SMTP path skip empty Cc lines...

 git-send-email.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index fd0a4ad..65620ab 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -651,7 +651,11 @@ X-Mailer: git-send-email $gitversion
 		} else {
 			print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
 		}
-		print "From: $sanitized_sender\nSubject: $subject\nCc: $cc\nTo: $to\n\n";
+		print "From: $sanitized_sender\n"
+		     . "Subject: $subject\n"
+		     . ($cc ? "Cc: $cc\n" : "")
+		     . "To: $to\n"
+		     . "\n";
 		if ($smtp) {
 			print "Result: ", $smtp->code, ' ',
 				($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
-- 
1.5.3.5.561.g140d
Previous: Junio C HamanoNext: David D. Kilzer
Message 5 of 7 in “git-send-email: show all headers when sending mail”
  1. git-send-email: show all headers when sending mailDavid D. Kilzer, Nov 12, 2007
  2. Junio C HamanoNov 13, 2007
  3. git-send-email: show all headers when sending mailDavid D. Kilzer, Nov 19, 2007
  4. Junio C HamanoNov 19, 2007
  5. Don't print an empty Cc header in SMTP mode when there's no cc recipient definedAsk Bjørn Hansen, Nov 19, 2007
  6. David D. KilzerNov 19, 2007
  7. Ask Bjørn HansenNov 20, 2007

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.