Web lists-archives.com

Re: git send-email does not work with Google anymore?!

On 05/10/2017 12:52, Lars Schneider wrote:
> Hi,
> I used to use the Google SMTP server to send my patches to the list with 
> the following config:
>     [sendemail]
>         smtpencryption = tls
>         smtpserver = smtp.gmail.com
>         smtpuser = larsxschneider@xxxxxxxxx
>         smtpserverport = 587
>         from = larsxschneider@xxxxxxxxx
>         chainreplyto = false
>         suppresscc = self
> Apparently that stopped working today. I get this error:
>     (mbox) Adding cc: Lars Schneider <larsxschneider@xxxxxxxxx> from line 'From: Lars Schneider <larsxschneider@xxxxxxxxx>'
>     Password for 'smtp://larsxschneider@xxxxxxxxx@smtp.gmail.com:587':
>     5.7.14 <https://accounts.google.com/signin/continue?...token...
>     5.7.14 ...> Please log in via your web browser and
>     5.7.14 then try again.
>     5.7.14  Learn more at
>     5.7.14  https://support.google.com/mail/answer/78754 ... - gsmtp
> Of couse I tried to log in via web browser etc. Does anyone else use 
> Google as SMTP server? If yes, does it work for you?

It's probably a good idea to set up two-factor authentication and add an 
app-specific password for "git send-email" (at least that's what I do).

The password can be stored encrypted using the OS keychain, or if you
don't want/have one (e.g. you are running headless) you could check if
your distro installs git-credential-netrc.  Create a ~/.netrc.gpg file,
where the decrypted content should look like

    machine smtp.gmail.com login larsxschneider@xxxxxxxxx password mypassword

Then do

    git config --global credential.helper netrc

and you're all set. :)