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

[PATCH v2] git-send-email.perl: fold multiple entry "Cc:" and multiple single line "RCPT TO:"s

From
Joe Perches <joe@perches.com>
Date
Oct 8, 2009, 17:03 UTC
Message-ID
<1255021406.2056.122.camel@Joe-Laptop.home>
In-Reply-To
<7vy6nlhmw7.fsf@alter.siamese.dyndns.org>

Some MTAs reject Cc: lines longer than 78 chars. Avoid this by using the same join as "To:" ",\n\t" so each subsequent Cc entry is on a new line.

RCPT TO: should have a single entry per line. see: http://www.ietf.org/rfc/rfc2821.txt

Signed-off-by: Joe Perches <joe@perches.com>
diff --git a/git-send-email.perl b/git-send-email.perl
index dd821f7..ce81425 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -835,7 +835,7 @@ sub send_message
 	    $gitversion = Git::version();
 	}
 
-	my $cc = join(", ", unique_email_list(@cc));
+	my $cc = join(",\n\t", unique_email_list(@cc));
 	my $ccline = "";
 	if ($cc ne '') {
 		$ccline = "\nCc: $cc";
@@ -976,7 +976,9 @@ X-Mailer: git-send-email $gitversion
 		if ($smtp_server !~ m#^/#) {
 			print "Server: $smtp_server\n";
 			print "MAIL FROM:<$raw_from>\n";
-			print "RCPT TO:".join(',',(map { "<$_>" } @recipients))."\n";
+			foreach my $entry (@recipients) {
+			    print "RCPT TO:<$entry>\n";
+			}
 		} else {
 			print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
 		}
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “git-send-email.perl: Fold long header lines to 78 chars”
  1. git-send-email.perl: Fold long header lines to 78 charsJoe Perches, Oct 5, 2009
  2. Junio C HamanoOct 8, 2009
  3. Joe PerchesOct 8, 2009
  4. Junio C HamanoOct 8, 2009
  5. git-send-email.perl: fold multiple entry "Cc:" and multiple single line "RCPT TO:"sJoe Perches, Oct 8, 2009
  6. Junio C HamanoOct 9, 2009
  7. Junio C HamanoOct 10, 2009

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.