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

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 22, 2017, 02:14 UTC
Message-ID
<xmqqlgpppri7.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170521125950.5524-1-zxq_yx_007@163.com>
I think this is almost perfect.
I'd propose squashing the patch below to
 - Add cross reference between config and option
 - Spell configuration variables in camelCase to mimic other
   sendemail.* variables
 - Spell SMTP in all caps to mimic other parts of the manual
 - Suggest use of credential helper in the document to help the end
   users, not in the proposed log message.

If you are fine with all of these changes, there is no need to resend (you can say so and I can locally squash these in). Of course, anyone is very welcome to point out documentation bugs I may be introducing with this patch.

Thanks.
-- >8 --
Subject: fixup! send-email: --batch-size to work around some SMTP server limit

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=<num> option), wait for a few seconds (configurable via the --relogin-delay=<seconds> option) and reconnect, to work around such a limit.

Also add two configuration variables to give these options the default.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/config.txt         |  8 +++++---
 Documentation/git-send-email.txt | 12 ++++++++----
 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index a13315ed69..ee4a111878 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -2914,13 +2914,15 @@ sendemail.xmailer::
 sendemail.signedoffcc (deprecated)::
 	Deprecated alias for `sendemail.signedoffbycc`.
 
-sendemail.smtpbatchsize::
+sendemail.smtpBatchSize::
 	Number of messages to be sent per connection, after that a relogin
-	will happen. if the value is 0 or undefined, send all messages in
+	will happen.  If the value is 0 or undefined, send all messages in
 	one connection.
+	See also the `--batch-size` option of linkgit:git-send-email[1].
 
-sendemail.smtprelogindelay::
+sendemail.smtpReloginDelay::
 	Seconds wait before reconnecting to smtp server.
+	See also the `--relogin-delay` option of linkgit:git-send-email[1].
 
 showbranch.default::
 	The default set of branches for linkgit:git-show-branch[1].
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 5380d8c956..79b418bfa5 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -250,14 +250,18 @@ must be used for each option.
 
 --batch-size=<num>::
 	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
+	sent per session (connection) and this will lead to a faliure when
 	sending many messages.  With this option, send-email will disconnect after
 	sending $<num> messages and wait for a few seconds (see --relogin-delay)
-	and reconnect, to work around such a limit.
+	and reconnect, to work around such a limit.  You may want to
+	use some form of credential helper to avoid having to retype
+	your password every time this happens.  Defaults to the
+	`sendemail.smtpBatchSize` configuration variable.
 
 --relogin-delay=<int>::
-	Waiting $<int> seconds before reconnecting to smtp server. Used together
-	with --batch-size option.
+	Waiting $<int> seconds before reconnecting to SMTP server. Used together
+	with --batch-size option.  Defaults to the `sendemail.smtpReloginDelay`
+	configuration variable.
 
 Automating
 ~~~~~~~~~~
-- 
2.13.0-440-g3ce6d2d5b8
Previous: xiaoqiang zhaoNext: Zhaoxiangqiang
Message 2 of 15 in “send-email: --batch-size to work around some SMTP server limit”
  1. send-email: --batch-size to work around some SMTP server limitxiaoqiang zhao, May 21, 2017
  2. Junio C HamanoMay 22, 2017
  3. ZhaoxiangqiangMay 22, 2017
  4. send-email: have default batch size when relogin delay is givenStefan Beller, Feb 7, 2018
  5. Eric SunshineFeb 7, 2018
  6. send-email: error out when relogin delay is missingStefan Beller, Feb 7, 2018
  7. xiaoqiang zhaoFeb 8, 2018
  8. Eric SunshineFeb 8, 2018
  9. Stefan BellerFeb 8, 2018
  10. Eric SunshineFeb 8, 2018
  11. send-email: error out when relogin delay is missingStefan Beller, Feb 12, 2018
  12. Ævar Arnfjörð BjarmasonMay 22, 2017
  13. Junio C HamanoMay 23, 2017
  14. Jan ViktorinMay 23, 2017
  15. 赵小强May 23, 2017

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.