Skip to content

Commit 53be145

Browse files
committed
Merge branch 'sa/send-email-smtp-batch-data-limit' into maint
When "git send-email" wanted to talk over Net::SMTP::SSL, Net::Cmd::datasend() did not like to be fed too many bytes at the same time and failed to send messages. Send the payload one line at a time to work around the problem. * sa/send-email-smtp-batch-data-limit: git-send-email.perl: Fixed sending of many/huge changes/patches
2 parents 684fea3 + f60c483 commit 53be145

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git-send-email.perl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,11 @@ sub send_message {
13651365
$smtp->mail( $raw_from ) or die $smtp->message;
13661366
$smtp->to( @recipients ) or die $smtp->message;
13671367
$smtp->data or die $smtp->message;
1368-
$smtp->datasend("$header\n$message") or die $smtp->message;
1368+
$smtp->datasend("$header\n") or die $smtp->message;
1369+
my @lines = split /^/, $message;
1370+
foreach my $line (@lines) {
1371+
$smtp->datasend("$line") or die $smtp->message;
1372+
}
13691373
$smtp->dataend() or die $smtp->message;
13701374
$smtp->code =~ /250|200/ or die "Failed to send $subject\n".$smtp->message;
13711375
}

0 commit comments

Comments
 (0)