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

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Joe Perches
2009-10-08 10:03:26 -07:00
committed by Junio C Hamano
parent 1cd749cc07
commit 02461e0e28
2 changed files with 78 additions and 22 deletions

View File

@ -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";
}