Skip to content

Commit 8e29b97

Browse files
AdityaGarg8gitster
authored andcommitted
docs: improve send-email documentation
OAuth2.0 is a new authentication method that is being used by many email providers, including Outlook and Gmail. Recently, the Authen::SASL perl module has been updated to support OAuth2.0 authentication, thus making the git-send-email script be able to use this authentication method as well. So lets improve the documentation to reflect this change. I also had a hard time finding a reliable OAuth2.0 access token generator for Outlook and Gmail. So I added a link to the such generators which I developed myself after seaching through lots of code and API documentation to make things easier for others. Signed-off-by: Aditya Garg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d8b7e6 commit 8e29b97

File tree

1 file changed

+53
-8
lines changed

1 file changed

+53
-8
lines changed

Documentation/git-send-email.adoc

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,12 @@ include::includes/cmd-config-section-all.adoc[]
496496

497497
include::config/sendemail.adoc[]
498498

499-
EXAMPLES
500-
--------
501-
Use gmail as the smtp server
499+
EXAMPLES OF SMTP SERVERS
500+
------------------------
501+
Use Gmail as the SMTP Server
502502
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
503-
To use 'git send-email' to send your patches through the GMail SMTP server,
504-
edit ~/.gitconfig to specify your account settings:
503+
To use 'git send-email' to send your patches through the Gmail SMTP server,
504+
edit '~/.gitconfig' to specify your account settings:
505505

506506
----
507507
[sendemail]
@@ -515,6 +515,37 @@ If you have multi-factor authentication set up on your Gmail account, you can
515515
generate an app-specific password for use with 'git send-email'. Visit
516516
https://security.google.com/settings/security/apppasswords to create it.
517517

518+
You can also use OAuth2.0 authentication with Gmail. To do this, edit your
519+
`~/.gitconfig` file and add `smtpAuth = OAUTHBEARER` to your account settings:
520+
521+
----
522+
[sendemail]
523+
smtpEncryption = tls
524+
smtpServer = smtp.gmail.com
525+
smtpUser = [email protected]
526+
smtpServerPort = 587
527+
smtpAuth = OAUTHBEARER
528+
----
529+
530+
Use Microsoft Outlook as the SMTP Server
531+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
532+
Unlike Gmail, Microsoft Outlook no longer supports app-specific passwords.
533+
Therefore, OAuth2.0 authentication must be used for Outlook.
534+
535+
Edit '~/.gitconfig' to specify your account settings for Outlook and use its
536+
SMTP server with 'git send-email':
537+
538+
----
539+
[sendemail]
540+
smtpEncryption = tls
541+
smtpServer = smtp.office365.com
542+
smtpUser = [email protected]
543+
smtpServerPort = 587
544+
smtpAuth = XOAUTH2
545+
----
546+
547+
SENDING PATCHES
548+
---------------
518549
Once your commits are ready to be sent to the mailing list, run the
519550
following commands:
520551

@@ -523,9 +554,23 @@ following commands:
523554
$ git send-email outgoing/*
524555

525556
The first time you run it, you will be prompted for your credentials. Enter the
526-
app-specific or your regular password as appropriate. If you have credential
527-
helper configured (see linkgit:git-credential[1]), the password will be saved in
528-
the credential store so you won't have to type it the next time.
557+
app-specific or your regular password as appropriate.
558+
559+
If you have a credential helper configured (see linkgit:git-credential[1]), the
560+
password will be saved in the credential store so you won't have to type it the
561+
next time.
562+
563+
If you are using OAuth2.0 authentication, you need to use an access token in
564+
place of a password when prompted. Various OAuth2.0 token generators are
565+
available online. Community maintained credential helpers for Gmail and Outlook
566+
are also available:
567+
568+
- https://github.com/AdityaGarg8/git-credential-email[git-credential-gmail] (cross platform, dedicated helper for authenticating Gmail accounts)
569+
570+
- https://github.com/AdityaGarg8/git-credential-email[git-credential-outlook] (cross platform, dedicated helper for authenticating Microsoft Outlook accounts)
571+
572+
You can also see linkgit:gitcredentials[7] for more OAuth based authentication
573+
helpers.
529574

530575
Note: the following core Perl modules that may be installed with your
531576
distribution of Perl are required:

0 commit comments

Comments
 (0)