Skip to content

Commit 9e68aab

Browse files
AdityaGarg8gitster
authored andcommitted
docs: make the purpose of using app password for Gmail more clear in send-email
The current example for Gmail suggests using app passwords for send-email if user has multi-factor authentication set up for their account. However, it does not clarify that the user cannot use their normal password in case they do not have multi-factor authentication enabled. Most likely the example was written in the days when Google allowed using normal passwords without multi-factor authentication. Clarify that regular passwords do not work for Gmail and app-passwords are the only way for basic authentication. Also encourage users to use OAuth2.0 as a more secure alternative. While at it, also prefer using the word "mechanism" over "method" for `OAUTHBEARER` and `XOAUTH2` since that is what official docs use. Signed-off-by: Aditya Garg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6cae42c commit 9e68aab

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Documentation/git-send-email.adoc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,18 @@ edit `~/.gitconfig` to specify your account settings:
525525
smtpServerPort = 587
526526
----
527527

528+
Gmail does not allow using your regular password for `git send-email`.
528529
If you have multi-factor authentication set up on your Gmail account, you can
529530
generate an app-specific password for use with `git send-email`. Visit
530531
https://security.google.com/settings/security/apppasswords to create it.
531532

532-
You can also use OAuth2.0 authentication with Gmail. `OAUTHBEARER` and
533-
`XOAUTH2` are common methods used for this type of authentication. Gmail
534-
supports both of them. As an example, if you want to use `OAUTHBEARER`, edit
535-
your `~/.gitconfig` file and add `smtpAuth = OAUTHBEARER` to your account
536-
settings:
533+
Alternatively, instead of using an app-specific password, you can use
534+
OAuth2.0 authentication with Gmail. OAuth2.0 is more secure than
535+
app-specific passwords, and works regardless of whether you have multi-factor
536+
authentication set up. `OAUTHBEARER` and `XOAUTH2` are common mechanisms used
537+
for this type of authentication. Gmail supports both of them. As an example,
538+
if you want to use `OAUTHBEARER`, edit your `~/.gitconfig` file and add
539+
`smtpAuth = OAUTHBEARER` to your account settings:
537540

538541
----
539542
[sendemail]
@@ -544,15 +547,15 @@ settings:
544547
smtpAuth = OAUTHBEARER
545548
----
546549

547-
Alternatively, you can use a tool developed by Google known as
550+
Another alternative is using a tool developed by Google known as
548551
https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail[sendgmail]
549552
to send emails using `git send-email`.
550553

551554
Use Microsoft Outlook as the SMTP Server
552555
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
553556
Unlike Gmail, Microsoft Outlook no longer supports app-specific passwords.
554557
Therefore, OAuth2.0 authentication must be used for Outlook. Also, it only
555-
supports `XOAUTH2` authentication method.
558+
supports `XOAUTH2` authentication mechanism.
556559

557560
Edit `~/.gitconfig` to specify your account settings for Outlook and use its
558561
SMTP server with `git send-email`:

0 commit comments

Comments
 (0)