Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-06 09:50:20 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-06 09:50:20 +0300
commit8ac6990b8712cb7c44dfc4ff8d9e99b5ec55b01d (patch)
treea8e00092967a8457f23e9773caf81500d397f458
parent1443ca9a7243d65d6b7d47ae5089cacbf0869ac4 (diff)
parent8dd9b3f85a1806ab2aaf0fc4bf20fa17d499a0b0 (diff)
Merge branch 'jw/send-email-no-auth'
"git send-email" learned to disable SMTP authentication via the "--smtp-auth=none" option, even when the smtp username is given (which turns the authentication on by default). * jw/send-email-no-auth: send-email: explicitly disable authentication
-rw-r--r--Documentation/git-send-email.txt7
-rwxr-xr-xgit-send-email.perl8
2 files changed, 12 insertions, 3 deletions
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index f6010ac68b..62c6c76f27 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -190,7 +190,9 @@ $ git send-email --smtp-auth="PLAIN LOGIN GSSAPI" ...
If at least one of the specified mechanisms matches the ones advertised by the
SMTP server and if it is supported by the utilized SASL library, the mechanism
is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth`
-is specified, all mechanisms supported by the SASL library can be used.
+is specified, all mechanisms supported by the SASL library can be used. The
+special value 'none' maybe specified to completely disable authentication
+independently of `--smtp-user`
--smtp-pass[=<password>]::
Password for SMTP-AUTH. The argument is optional: If no
@@ -204,6 +206,9 @@ or on the command line. If a username has been specified (with
specified (with `--smtp-pass` or `sendemail.smtpPass`), then
a password is obtained using 'git-credential'.
+--no-smtp-auth::
+ Disable SMTP authentication. Short hand for `--smtp-auth=none`
+
--smtp-server=<host>::
If set, specifies the outgoing SMTP server to use (e.g.
`smtp.example.com` or a raw IP address). Alternatively it can
diff --git a/git-send-email.perl b/git-send-email.perl
index 58c6aa9d0e..dc7e738e9c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -82,8 +82,11 @@ git send-email --dump-aliases
Pass an empty string to disable certificate
verification.
--smtp-domain <str> * The domain name sent to HELO/EHLO handshake
- --smtp-auth <str> * Space-separated list of allowed AUTH mechanisms.
+ --smtp-auth <str> * Space-separated list of allowed AUTH mechanisms, or
+ "none" to disable authentication.
This setting forces to use one of the listed mechanisms.
+ --no-smtp-auth Disable SMTP authentication. Shorthand for
+ `--smtp-auth=none`
--smtp-debug <0|1> * Disable, enable Net::SMTP debug.
--batch-size <int> * send max <int> message per connection.
@@ -341,6 +344,7 @@ $rc = GetOptions(
"smtp-debug:i" => \$debug_net_smtp,
"smtp-domain:s" => \$smtp_domain,
"smtp-auth=s" => \$smtp_auth,
+ "no-smtp-auth" => sub {$smtp_auth = 'none'},
"identity=s" => \$identity,
"annotate!" => \$annotate,
"no-annotate" => sub {$annotate = 0},
@@ -1241,7 +1245,7 @@ sub smtp_host_string {
# (smtp_user was not specified), and 0 otherwise.
sub smtp_auth_maybe {
- if (!defined $smtp_authuser || $auth) {
+ if (!defined $smtp_authuser || $auth || (defined $smtp_auth && $smtp_auth eq "none")) {
return 1;
}