summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-06 06:50:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-06 06:50:20 (GMT)
commit8ac6990b8712cb7c44dfc4ff8d9e99b5ec55b01d (patch)
treea8e00092967a8457f23e9773caf81500d397f458 /git-send-email.perl
parent1443ca9a7243d65d6b7d47ae5089cacbf0869ac4 (diff)
parent8dd9b3f85a1806ab2aaf0fc4bf20fa17d499a0b0 (diff)
downloadgit-8ac6990b8712cb7c44dfc4ff8d9e99b5ec55b01d.zip
git-8ac6990b8712cb7c44dfc4ff8d9e99b5ec55b01d.tar.gz
git-8ac6990b8712cb7c44dfc4ff8d9e99b5ec55b01d.tar.bz2
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
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 58c6aa9..dc7e738 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;
}