{"thread":{"id":"49612","subject":"[PATCH] send-email: explicitly disable authentication","startedAt":"2018-10-18T21:15:57Z","lastAt":"2018-10-25T09:43:44Z","messageCount":10,"participants":["Joshua Watt","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"360878","messageId":"20181018211527.25597-1-JPEWhacker@gmail.com","threadId":"49612","inReplyTo":null,"subject":"[PATCH] send-email: explicitly disable authentication","fromName":"Joshua Watt","fromEmail":"jpewhacker@gmail.com","sentAt":"2018-10-18T21:15:27Z","receivedAt":"2018-10-18T21:15:57Z","isPatch":true,"sender":{"key":"jpewhacker@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6453652?v=4"},"body":"It can be necessary to disable SMTP authentication by a mechanism other\nthan sendemail.smtpuser being undefined. For example, if the user has\nsendemail.smtpuser set globally but wants to disable authentication\nlocally in one repository.\n\n--smtp-auth and sendemail.smtpauth now understand the value 'none' which\nmeans to disable authentication completely, even if an authentication\nuser is specified.\n\nThe value 'none' is lower case to avoid conflicts with any RFC 4422\nauthentication mechanisms.\n\nSigned-off-by: Joshua Watt <JPEWhacker@gmail.com>\n---\n Documentation/git-send-email.txt | 4 +++-\n git-send-email.perl              | 5 +++--\n 2 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 465a4ecbe..751a4851e 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -190,7 +190,9 @@ $ git send-email --smtp-auth=\"PLAIN LOGIN GSSAPI\" ...\n If at least one of the specified mechanisms matches the ones advertised by the\n SMTP server and if it is supported by the utilized SASL library, the mechanism\n is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth`\n-is specified, all mechanisms supported by the SASL library can be used.\n+is specified, all mechanisms supported by the SASL library can be used. The\n+special value 'none' maybe specified to completely disable authentication\n+independently of `--smtp-user`\n \n --smtp-pass[=<password>]::\n \tPassword for SMTP-AUTH. The argument is optional: If no\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 2be5dac33..4a74cd350 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -82,7 +82,8 @@ sub usage {\n                                      Pass an empty string to disable certificate\n                                      verification.\n     --smtp-domain           <str>  * The domain name sent to HELO/EHLO handshake\n-    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms.\n+    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms, or\n+                                     \"none\" to disable authentication.\n                                      This setting forces to use one of the listed mechanisms.\n     --smtp-debug            <0|1>  * Disable, enable Net::SMTP debug.\n \n@@ -1241,7 +1242,7 @@ sub smtp_host_string {\n # (smtp_user was not specified), and 0 otherwise.\n \n sub smtp_auth_maybe {\n-\tif (!defined $smtp_authuser || $auth) {\n+\tif (!defined $smtp_authuser || $auth || $smtp_auth eq \"none\") {\n \t\treturn 1;\n \t}\n \n-- \n2.17.1\n\n"},{"id":"360879","messageId":"CAPig+cR27mPmH+0oeT+2T878K-cBNqBnxPUumETnVK1cvz2qnA@mail.gmail.com","threadId":"49612","inReplyTo":"20181018211527.25597-1-JPEWhacker@gmail.com","subject":"Re: [PATCH] send-email: explicitly disable authentication","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-10-18T21:53:51Z","receivedAt":"2018-10-18T21:54:04Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Oct 18, 2018 at 5:16 PM Joshua Watt <jpewhacker@gmail.com> wrote:\n> It can be necessary to disable SMTP authentication by a mechanism other\n> than sendemail.smtpuser being undefined. For example, if the user has\n> sendemail.smtpuser set globally but wants to disable authentication\n> locally in one repository.\n>\n> --smtp-auth and sendemail.smtpauth now understand the value 'none' which\n> means to disable authentication completely, even if an authentication\n> user is specified.\n\nImplementation complexity aside, spelling the option --no-smtp-auth\nmight be more intuitive and consistent than --smtp-auth=none.\n\n> The value 'none' is lower case to avoid conflicts with any RFC 4422\n> authentication mechanisms.\n>\n> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>\n"},{"id":"360881","messageId":"9dc2995ff84158450255478c7411339a81f63aba.camel@gmail.com","threadId":"49612","inReplyTo":"CAPig+cR27mPmH+0oeT+2T878K-cBNqBnxPUumETnVK1cvz2qnA@mail.gmail.com","subject":"Re: [PATCH] send-email: explicitly disable authentication","fromName":"Joshua Watt","fromEmail":"jpewhacker@gmail.com","sentAt":"2018-10-18T22:01:53Z","receivedAt":"2018-10-18T22:01:57Z","isPatch":true,"sender":{"key":"jpewhacker@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6453652?v=4"},"body":"On Thu, 2018-10-18 at 17:53 -0400, Eric Sunshine wrote:\n> On Thu, Oct 18, 2018 at 5:16 PM Joshua Watt <jpewhacker@gmail.com>\n> wrote:\n> > It can be necessary to disable SMTP authentication by a mechanism\n> > other\n> > than sendemail.smtpuser being undefined. For example, if the user\n> > has\n> > sendemail.smtpuser set globally but wants to disable authentication\n> > locally in one repository.\n> > \n> > --smtp-auth and sendemail.smtpauth now understand the value 'none'\n> > which\n> > means to disable authentication completely, even if an\n> > authentication\n> > user is specified.\n> \n> Implementation complexity aside, spelling the option --no-smtp-auth\n> might be more intuitive and consistent than --smtp-auth=none.\n\nOne advantage of --smtp-auth=none is that it can also be done with a\nconfig variable sendemail.smtpauth=\"none\". Would be also add a config\nvariable like sendemail.nosmtpauth (the negative seems strange to me)? \n\nOr maybe --no-smtp-auth is just a shorthand alias for --smtp-auth=none?\n\n> \n> > The value 'none' is lower case to avoid conflicts with any RFC 4422\n> > authentication mechanisms.\n> > \n> > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>\n-- \nJoshua Watt <JPEWhacker@gmail.com>\n"},{"id":"360916","messageId":"CAPig+cRFZ3kvbrUJpQheSFTvdah0Pds8boF0vf-p94SeWoUE+g@mail.gmail.com","threadId":"49612","inReplyTo":"9dc2995ff84158450255478c7411339a81f63aba.camel@gmail.com","subject":"Re: [PATCH] send-email: explicitly disable authentication","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-10-19T14:10:36Z","receivedAt":"2018-10-19T14:10:50Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Oct 18, 2018 at 6:02 PM Joshua Watt <jpewhacker@gmail.com> wrote:\n> On Thu, 2018-10-18 at 17:53 -0400, Eric Sunshine wrote:\n> > On Thu, Oct 18, 2018 at 5:16 PM Joshua Watt <jpewhacker@gmail.com>\n> > wrote:\n> > Implementation complexity aside, spelling the option --no-smtp-auth\n> > might be more intuitive and consistent than --smtp-auth=none.\n>\n> One advantage of --smtp-auth=none is that it can also be done with a\n> config variable sendemail.smtpauth=\"none\". Would be also add a config\n> variable like sendemail.nosmtpauth (the negative seems strange to me)?\n\nI would not expect to see a \"negating\" config variable like that. I\nwas just suggesting that a \"--no-*\" command-line option might be more\nintuitive.\n\n> Or maybe --no-smtp-auth is just a shorthand alias for --smtp-auth=none?\n\nThat's one possibility.\n"},{"id":"361174","messageId":"20181022175248.3940-1-JPEWhacker@gmail.com","threadId":"49612","inReplyTo":"20181018211527.25597-1-JPEWhacker@gmail.com","subject":"[PATCH v2] send-email: explicitly disable authentication","fromName":"Joshua Watt","fromEmail":"jpewhacker@gmail.com","sentAt":"2018-10-22T17:52:48Z","receivedAt":"2018-10-22T17:53:03Z","isPatch":true,"sender":{"key":"jpewhacker@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6453652?v=4"},"body":"It can be necessary to disable SMTP authentication by a mechanism other\nthan sendemail.smtpuser being undefined. For example, if the user has\nsendemail.smtpuser set globally but wants to disable authentication\nlocally in one repository.\n\n--smtp-auth and sendemail.smtpauth now understand the value 'none' which\nmeans to disable authentication completely, even if an authentication\nuser is specified.\n\nThe value 'none' is lower case to avoid conflicts with any RFC 4422\nauthentication mechanisms.\n\nThe user may also specify the command line argument --no-smtp-auth as a\nshorthand for --smtp-auth=none\n\nSigned-off-by: Joshua Watt <JPEWhacker@gmail.com>\n---\n Documentation/git-send-email.txt | 7 ++++++-\n git-send-email.perl              | 8 ++++++--\n 2 files changed, 12 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 465a4ecbe..17993e3c9 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -190,7 +190,9 @@ $ git send-email --smtp-auth=\"PLAIN LOGIN GSSAPI\" ...\n If at least one of the specified mechanisms matches the ones advertised by the\n SMTP server and if it is supported by the utilized SASL library, the mechanism\n is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth`\n-is specified, all mechanisms supported by the SASL library can be used.\n+is specified, all mechanisms supported by the SASL library can be used. The\n+special value 'none' maybe specified to completely disable authentication\n+independently of `--smtp-user`\n \n --smtp-pass[=<password>]::\n \tPassword for SMTP-AUTH. The argument is optional: If no\n@@ -204,6 +206,9 @@ or on the command line. If a username has been specified (with\n specified (with `--smtp-pass` or `sendemail.smtpPass`), then\n a password is obtained using 'git-credential'.\n \n+--no-smtp-auth::\n+\tDisable SMTP authentication. Short hand for `--smtp-auth=none`\n+\n --smtp-server=<host>::\n \tIf set, specifies the outgoing SMTP server to use (e.g.\n \t`smtp.example.com` or a raw IP address).  Alternatively it can\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 2be5dac33..7d7e69581 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -82,8 +82,11 @@ sub usage {\n                                      Pass an empty string to disable certificate\n                                      verification.\n     --smtp-domain           <str>  * The domain name sent to HELO/EHLO handshake\n-    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms.\n+    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms, or\n+                                     \"none\" to disable authentication.\n                                      This setting forces to use one of the listed mechanisms.\n+    --no-smtp-auth                   Disable SMTP authentication. Shorthand for\n+                                     `--smtp-auth=none`\n     --smtp-debug            <0|1>  * Disable, enable Net::SMTP debug.\n \n     --batch-size            <int>  * send max <int> message per connection.\n@@ -341,6 +344,7 @@ sub signal_handler {\n \t\t    \"smtp-debug:i\" => \\$debug_net_smtp,\n \t\t    \"smtp-domain:s\" => \\$smtp_domain,\n \t\t    \"smtp-auth=s\" => \\$smtp_auth,\n+\t\t    \"no-smtp-auth\" => sub {$smtp_auth = 'none'},\n \t\t    \"identity=s\" => \\$identity,\n \t\t    \"annotate!\" => \\$annotate,\n \t\t    \"no-annotate\" => sub {$annotate = 0},\n@@ -1241,7 +1245,7 @@ sub smtp_host_string {\n # (smtp_user was not specified), and 0 otherwise.\n \n sub smtp_auth_maybe {\n-\tif (!defined $smtp_authuser || $auth) {\n+\tif (!defined $smtp_authuser || $auth || $smtp_auth eq \"none\") {\n \t\treturn 1;\n \t}\n \n-- \n2.19.1.543.g99a77c85e.dirty\n\n"},{"id":"361175","messageId":"CAJdd5Gaq+YaMZiE3MF0XzeB62w-qD4d8KOyBkPJxOfuFxqXukg@mail.gmail.com","threadId":"49612","inReplyTo":"20181022175248.3940-1-JPEWhacker@gmail.com","subject":"Re: [PATCH v2] send-email: explicitly disable authentication","fromName":"Joshua Watt","fromEmail":"jpewhacker@gmail.com","sentAt":"2018-10-22T18:03:20Z","receivedAt":"2018-10-22T18:03:34Z","isPatch":true,"sender":{"key":"jpewhacker@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6453652?v=4"},"body":"On Mon, Oct 22, 2018 at 12:52 PM Joshua Watt <jpewhacker@gmail.com> wrote:\n>\n> It can be necessary to disable SMTP authentication by a mechanism other\n> than sendemail.smtpuser being undefined. For example, if the user has\n> sendemail.smtpuser set globally but wants to disable authentication\n> locally in one repository.\n>\n> --smtp-auth and sendemail.smtpauth now understand the value 'none' which\n> means to disable authentication completely, even if an authentication\n> user is specified.\n>\n> The value 'none' is lower case to avoid conflicts with any RFC 4422\n> authentication mechanisms.\n>\n> The user may also specify the command line argument --no-smtp-auth as a\n> shorthand for --smtp-auth=none\n>\n> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>\n> ---\n>  Documentation/git-send-email.txt | 7 ++++++-\n>  git-send-email.perl              | 8 ++++++--\n>  2 files changed, 12 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index 465a4ecbe..17993e3c9 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -190,7 +190,9 @@ $ git send-email --smtp-auth=\"PLAIN LOGIN GSSAPI\" ...\n>  If at least one of the specified mechanisms matches the ones advertised by the\n>  SMTP server and if it is supported by the utilized SASL library, the mechanism\n>  is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth`\n> -is specified, all mechanisms supported by the SASL library can be used.\n> +is specified, all mechanisms supported by the SASL library can be used. The\n> +special value 'none' maybe specified to completely disable authentication\n> +independently of `--smtp-user`\n>\n>  --smtp-pass[=<password>]::\n>         Password for SMTP-AUTH. The argument is optional: If no\n> @@ -204,6 +206,9 @@ or on the command line. If a username has been specified (with\n>  specified (with `--smtp-pass` or `sendemail.smtpPass`), then\n>  a password is obtained using 'git-credential'.\n>\n> +--no-smtp-auth::\n> +       Disable SMTP authentication. Short hand for `--smtp-auth=none`\n> +\n>  --smtp-server=<host>::\n>         If set, specifies the outgoing SMTP server to use (e.g.\n>         `smtp.example.com` or a raw IP address).  Alternatively it can\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 2be5dac33..7d7e69581 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -82,8 +82,11 @@ sub usage {\n>                                       Pass an empty string to disable certificate\n>                                       verification.\n>      --smtp-domain           <str>  * The domain name sent to HELO/EHLO handshake\n> -    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms.\n> +    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms, or\n> +                                     \"none\" to disable authentication.\n>                                       This setting forces to use one of the listed mechanisms.\n> +    --no-smtp-auth                   Disable SMTP authentication. Shorthand for\n> +                                     `--smtp-auth=none`\n>      --smtp-debug            <0|1>  * Disable, enable Net::SMTP debug.\n>\n>      --batch-size            <int>  * send max <int> message per connection.\n> @@ -341,6 +344,7 @@ sub signal_handler {\n>                     \"smtp-debug:i\" => \\$debug_net_smtp,\n>                     \"smtp-domain:s\" => \\$smtp_domain,\n>                     \"smtp-auth=s\" => \\$smtp_auth,\n> +                   \"no-smtp-auth\" => sub {$smtp_auth = 'none'},\n>                     \"identity=s\" => \\$identity,\n>                     \"annotate!\" => \\$annotate,\n>                     \"no-annotate\" => sub {$annotate = 0},\n> @@ -1241,7 +1245,7 @@ sub smtp_host_string {\n>  # (smtp_user was not specified), and 0 otherwise.\n>\n>  sub smtp_auth_maybe {\n> -       if (!defined $smtp_authuser || $auth) {\n> +       if (!defined $smtp_authuser || $auth || $smtp_auth eq \"none\") {\n\nOops, this generates a warning when no smtp auth argument is supplied\n(comparison to undefined value). Version 3 will be along shortly.\n\n>                 return 1;\n>         }\n>\n> --\n> 2.19.1.543.g99a77c85e.dirty\n>\n"},{"id":"361236","messageId":"xmqqd0s1tsdd.fsf@gitster-ct.c.googlers.com","threadId":"49612","inReplyTo":"20181022175248.3940-1-JPEWhacker@gmail.com","subject":"Re: [PATCH v2] send-email: explicitly disable authentication","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-23T00:32:30Z","receivedAt":"2018-10-23T00:32:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joshua Watt <jpewhacker@gmail.com> writes:\n\n> It can be necessary to disable SMTP authentication by a mechanism other\n> than sendemail.smtpuser being undefined. For example, if the user has\n> sendemail.smtpuser set globally but wants to disable authentication\n> locally in one repository.\n\nI wonder if it would be more productive to introduce a mechanism\nthat can be used to address that use case more directly.  For\nexample, would it help to teach \"git send-email\" that\nsendemail.smtpuser set to a particular value (say '!', or empty\nstring if you prefer) is equivalent to the variable unset at all?\n\n"},{"id":"361244","messageId":"CAJdd5GaQtHVX_wCF8D3y4qJ-a6RdMHpv=BGQVM=xfBEe8xEyOw@mail.gmail.com","threadId":"49612","inReplyTo":"xmqqd0s1tsdd.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2] send-email: explicitly disable authentication","fromName":"Joshua Watt","fromEmail":"jpewhacker@gmail.com","sentAt":"2018-10-23T02:40:36Z","receivedAt":"2018-10-23T02:40:49Z","isPatch":true,"sender":{"key":"jpewhacker@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6453652?v=4"},"body":"On Mon, Oct 22, 2018 at 7:32 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Joshua Watt <jpewhacker@gmail.com> writes:\n>\n> > It can be necessary to disable SMTP authentication by a mechanism other\n> > than sendemail.smtpuser being undefined. For example, if the user has\n> > sendemail.smtpuser set globally but wants to disable authentication\n> > locally in one repository.\n>\n> I wonder if it would be more productive to introduce a mechanism\n> that can be used to address that use case more directly.  For\n> example, would it help to teach \"git send-email\" that\n> sendemail.smtpuser set to a particular value (say '!', or empty\n> string if you prefer) is equivalent to the variable unset at all?\n>\n\nI'm a little worried that is more likely to break someone's workflow\n(although, I'm not sure why someone would have such simple username).\nUsing sendemail.smtpauth = \"none\" is pretty much guaranteed to not\nbreak an existing setup because git send-email would previously reject\nany value that wasn't upper case. I suppose the one disadvantage is\nthat it isn't backward compatible, since setting sendemail.smtpauth to\n\"none\" wouldn't work with older versions of git (due to it not being\nupper case), but I'm not sure how much of a concern that is.\n\nIMHO, setting \"\"  or \"!\" for sendemail.smtpuser probably isn't any\nmore clear or direct for the end user than my solution.\n"},{"id":"361245","messageId":"20181023032425.9608-1-JPEWhacker@gmail.com","threadId":"49612","inReplyTo":"20181022175248.3940-1-JPEWhacker@gmail.com","subject":"[PATCH v3] send-email: explicitly disable authentication","fromName":"Joshua Watt","fromEmail":"jpewhacker@gmail.com","sentAt":"2018-10-23T03:24:25Z","receivedAt":"2018-10-23T03:24:31Z","isPatch":true,"sender":{"key":"jpewhacker@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6453652?v=4"},"body":"It can be necessary to disable SMTP authentication by a mechanism other\nthan sendemail.smtpuser being undefined. For example, if the user has\nsendemail.smtpuser set globally but wants to disable authentication\nlocally in one repository.\n\n--smtp-auth and sendemail.smtpauth now understand the value 'none' which\nmeans to disable authentication completely, even if an authentication\nuser is specified.\n\nThe value 'none' is lower case to avoid conflicts with any RFC 4422\nauthentication mechanisms.\n\nThe user may also specify the command line argument --no-smtp-auth as a\nshorthand for --smtp-auth=none\n\nSigned-off-by: Joshua Watt <JPEWhacker@gmail.com>\n---\n Documentation/git-send-email.txt | 7 ++++++-\n git-send-email.perl              | 8 ++++++--\n 2 files changed, 12 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 465a4ecbe..17993e3c9 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -190,7 +190,9 @@ $ git send-email --smtp-auth=\"PLAIN LOGIN GSSAPI\" ...\n If at least one of the specified mechanisms matches the ones advertised by the\n SMTP server and if it is supported by the utilized SASL library, the mechanism\n is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth`\n-is specified, all mechanisms supported by the SASL library can be used.\n+is specified, all mechanisms supported by the SASL library can be used. The\n+special value 'none' maybe specified to completely disable authentication\n+independently of `--smtp-user`\n \n --smtp-pass[=<password>]::\n \tPassword for SMTP-AUTH. The argument is optional: If no\n@@ -204,6 +206,9 @@ or on the command line. If a username has been specified (with\n specified (with `--smtp-pass` or `sendemail.smtpPass`), then\n a password is obtained using 'git-credential'.\n \n+--no-smtp-auth::\n+\tDisable SMTP authentication. Short hand for `--smtp-auth=none`\n+\n --smtp-server=<host>::\n \tIf set, specifies the outgoing SMTP server to use (e.g.\n \t`smtp.example.com` or a raw IP address).  Alternatively it can\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 2be5dac33..a70679484 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -82,8 +82,11 @@ sub usage {\n                                      Pass an empty string to disable certificate\n                                      verification.\n     --smtp-domain           <str>  * The domain name sent to HELO/EHLO handshake\n-    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms.\n+    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms, or\n+                                     \"none\" to disable authentication.\n                                      This setting forces to use one of the listed mechanisms.\n+    --no-smtp-auth                   Disable SMTP authentication. Shorthand for\n+                                     `--smtp-auth=none`\n     --smtp-debug            <0|1>  * Disable, enable Net::SMTP debug.\n \n     --batch-size            <int>  * send max <int> message per connection.\n@@ -341,6 +344,7 @@ sub signal_handler {\n \t\t    \"smtp-debug:i\" => \\$debug_net_smtp,\n \t\t    \"smtp-domain:s\" => \\$smtp_domain,\n \t\t    \"smtp-auth=s\" => \\$smtp_auth,\n+\t\t    \"no-smtp-auth\" => sub {$smtp_auth = 'none'},\n \t\t    \"identity=s\" => \\$identity,\n \t\t    \"annotate!\" => \\$annotate,\n \t\t    \"no-annotate\" => sub {$annotate = 0},\n@@ -1241,7 +1245,7 @@ sub smtp_host_string {\n # (smtp_user was not specified), and 0 otherwise.\n \n sub smtp_auth_maybe {\n-\tif (!defined $smtp_authuser || $auth) {\n+\tif (!defined $smtp_authuser || $auth || (defined $smtp_auth && $smtp_auth eq \"none\")) {\n \t\treturn 1;\n \t}\n \n-- \n2.19.1.543.g838de3e23.dirty\n\n"},{"id":"361500","messageId":"xmqq36sugy45.fsf@gitster-ct.c.googlers.com","threadId":"49612","inReplyTo":"20181023032425.9608-1-JPEWhacker@gmail.com","subject":"Re: [PATCH v3] send-email: explicitly disable authentication","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-25T09:43:38Z","receivedAt":"2018-10-25T09:43:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joshua Watt <jpewhacker@gmail.com> writes:\n\n> It can be necessary to disable SMTP authentication by a mechanism other\n> than sendemail.smtpuser being undefined. For example, if the user has\n> sendemail.smtpuser set globally but wants to disable authentication\n> locally in one repository.\n>\n> --smtp-auth and sendemail.smtpauth now understand the value 'none' which\n> means to disable authentication completely, even if an authentication\n> user is specified.\n>\n> The value 'none' is lower case to avoid conflicts with any RFC 4422\n> authentication mechanisms.\n>\n> The user may also specify the command line argument --no-smtp-auth as a\n> shorthand for --smtp-auth=none\n>\n> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>\n> ---\n\nThanks.  Let's queue this and merge it to 'next' soonish.\n\n\n\n\n>  Documentation/git-send-email.txt | 7 ++++++-\n>  git-send-email.perl              | 8 ++++++--\n>  2 files changed, 12 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index 465a4ecbe..17993e3c9 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -190,7 +190,9 @@ $ git send-email --smtp-auth=\"PLAIN LOGIN GSSAPI\" ...\n>  If at least one of the specified mechanisms matches the ones advertised by the\n>  SMTP server and if it is supported by the utilized SASL library, the mechanism\n>  is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth`\n> -is specified, all mechanisms supported by the SASL library can be used.\n> +is specified, all mechanisms supported by the SASL library can be used. The\n> +special value 'none' maybe specified to completely disable authentication\n> +independently of `--smtp-user`\n>  \n>  --smtp-pass[=<password>]::\n>  \tPassword for SMTP-AUTH. The argument is optional: If no\n> @@ -204,6 +206,9 @@ or on the command line. If a username has been specified (with\n>  specified (with `--smtp-pass` or `sendemail.smtpPass`), then\n>  a password is obtained using 'git-credential'.\n>  \n> +--no-smtp-auth::\n> +\tDisable SMTP authentication. Short hand for `--smtp-auth=none`\n> +\n>  --smtp-server=<host>::\n>  \tIf set, specifies the outgoing SMTP server to use (e.g.\n>  \t`smtp.example.com` or a raw IP address).  Alternatively it can\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 2be5dac33..a70679484 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -82,8 +82,11 @@ sub usage {\n>                                       Pass an empty string to disable certificate\n>                                       verification.\n>      --smtp-domain           <str>  * The domain name sent to HELO/EHLO handshake\n> -    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms.\n> +    --smtp-auth             <str>  * Space-separated list of allowed AUTH mechanisms, or\n> +                                     \"none\" to disable authentication.\n>                                       This setting forces to use one of the listed mechanisms.\n> +    --no-smtp-auth                   Disable SMTP authentication. Shorthand for\n> +                                     `--smtp-auth=none`\n>      --smtp-debug            <0|1>  * Disable, enable Net::SMTP debug.\n>  \n>      --batch-size            <int>  * send max <int> message per connection.\n> @@ -341,6 +344,7 @@ sub signal_handler {\n>  \t\t    \"smtp-debug:i\" => \\$debug_net_smtp,\n>  \t\t    \"smtp-domain:s\" => \\$smtp_domain,\n>  \t\t    \"smtp-auth=s\" => \\$smtp_auth,\n> +\t\t    \"no-smtp-auth\" => sub {$smtp_auth = 'none'},\n>  \t\t    \"identity=s\" => \\$identity,\n>  \t\t    \"annotate!\" => \\$annotate,\n>  \t\t    \"no-annotate\" => sub {$annotate = 0},\n> @@ -1241,7 +1245,7 @@ sub smtp_host_string {\n>  # (smtp_user was not specified), and 0 otherwise.\n>  \n>  sub smtp_auth_maybe {\n> -\tif (!defined $smtp_authuser || $auth) {\n> +\tif (!defined $smtp_authuser || $auth || (defined $smtp_auth && $smtp_auth eq \"none\")) {\n>  \t\treturn 1;\n>  \t}\n"}]}