]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-send-email.perl
Merge branch 'ag/rebase-i-in-c'
[thirdparty/git.git] / git-send-email.perl
index 58c6aa9d0eca3e692e5c8c5df538afdb8f8fe63d..4b9d3ad1bdc56881add391def6ed52645ddb89a7 100755 (executable)
@@ -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;
        }
 
@@ -1844,7 +1848,7 @@ sub apply_transfer_encoding {
        my $from = shift;
        my $to = shift;
 
-       return $message if ($from eq $to and $from ne '7bit');
+       return ($message, $to) if ($from eq $to and $from ne '7bit');
 
        require MIME::QuotedPrint;
        require MIME::Base64;