Re: [PATCH v3] send-email: --batch-size to work around some SMTP server limit

2017-05-08 Thread 赵小强
> 在 2017年5月8日,12:11,Junio C Hamano 写道: > > Two suggestions. > > (1) I do not think $smtp is always valid when we come here; it is > unsafe to unconditionally say $smtp->quit like this patch does. > >$smtp->quit if defined $smtp; > > may help codepaths like $dry_run and also the c

Re: [PATCH v3] send-email: --batch-size to work around some SMTP server limit

2017-05-07 Thread Junio C Hamano
xiaoqiang zhao writes: > @@ -1664,6 +1674,14 @@ foreach my $t (@files) { > } > } > $message_id = undef; > + $num_sent++; > + if ($num_sent == $batch_size) { > + $num_sent = 0; > + $smtp->quit; > + $smtp = undef; > +

[PATCH v3] send-email: --batch-size to work around some SMTP server limit

2017-05-07 Thread xiaoqiang zhao
Some email servers (e.g. smtp.163.com) limit the number emails to be sent per session(connection) and this will lead to a faliure when sending many messages. Teach send-email to disconnect after sending a number of messages (configurable via the --batch-size= option), wait for a few seconds (confi