diff options
author | xiaoqiang zhao <zxq_yx_007@163.com> | 2017-05-21 20:59:50 +0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-05 09:09:45 -0700 |
commit | 5453b83bdf92efbfe9e9aaa54d4c62ce48ced2f5 (patch) | |
tree | deb99db272d4e17527dce0f7a9b92dc29264bf8c /Documentation | |
parent | b06d3643105c8758ed019125a4399cb7efdcce2c (diff) | |
download | git-5453b83bdf92efbfe9e9aaa54d4c62ce48ced2f5.tar.gz |
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.
Note:
We will use this as a band-aid for now, but in the longer term, we
should look at and react to the SMTP error code from the server;
Xianqiang reports that 450 and 451 are returned by problematic
servers.
cf. https://public-inbox.org/git/7993e188.d18d.15c3560bcaf.Coremail.zxq_yx_007@163.com/
Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config.txt | 10 | ||||
-rw-r--r-- | Documentation/git-send-email.txt | 15 |
2 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 475e874d51..ee4a111878 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -2914,6 +2914,16 @@ sendemail.xmailer:: sendemail.signedoffcc (deprecated):: Deprecated alias for `sendemail.signedoffbycc`. +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 + one connection. + See also the `--batch-size` option of linkgit:git-send-email[1]. + +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]. See linkgit:git-show-branch[1]. diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 9d66166f69..79b418bfa5 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -248,6 +248,21 @@ must be used for each option. commands and replies will be printed. Useful to debug TLS connection and authentication problems. +--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 + 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. 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. Defaults to the `sendemail.smtpReloginDelay` + configuration variable. + Automating ~~~~~~~~~~ |