threads / discuss / 46910

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

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

## tl;dr

9 messages between Oct 5, 2017 and Nov 17, 2017.

replies: 8people: 7as markdown or json

Lars Schneider· Oct 5, 2017, 10:52 UTC · lore
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@gmail.com
        smtpserverport = 587
        from = larsxschneider@gmail.com
        chainreplyto = false
        suppresscc = self
Apparently that stopped working today. I get this error:
    (mbox) Adding cc: Lars Schneider <larsxschneider@gmail.com> from line 'From: Lars Schneider <larsxschneider@gmail.com>'
    Password for 'smtp://larsxschneider@gmail.com@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?

Thanks, Lars

Paolo Bonzini· Oct 5, 2017, 13:43 UTC · re: Lars Schneider · lore

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

On 05/10/2017 12:52, Lars Schneider wrote:
Show 26 quoted lines
> 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@gmail.com
>         smtpserverport = 587
>         from = larsxschneider@gmail.com
>         chainreplyto = false
>         suppresscc = self
> 
> Apparently that stopped working today. I get this error:
> 
>     (mbox) Adding cc: Lars Schneider <larsxschneider@gmail.com> from line 'From: Lars Schneider <larsxschneider@gmail.com>'
>     Password for 'smtp://larsxschneider@gmail.com@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@gmail.com password mypassword
Then do
    git config --global credential.helper netrc
and you're all set. :)
Paolo
ankostis· Oct 5, 2017, 14:21 UTC · re: Paolo Bonzini · lore

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

On 5 October 2017 at 15:43, Paolo Bonzini <bonzini@gnu.org> wrote:
Show 28 quoted lines
>
> 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@gmail.com
> >         smtpserverport = 587
> >         from = larsxschneider@gmail.com
> >         chainreplyto = false
> >         suppresscc = self
> >
> > Apparently that stopped working today. I get this error:
> >
> >     (mbox) Adding cc: Lars Schneider <larsxschneider@gmail.com> from line 'From: Lars Schneider <larsxschneider@gmail.com>'
> >     Password for 'smtp://larsxschneider@gmail.com@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?

I have been using SMTP+GMail rather a lot, recently. The situation is a mess, and it becomes worse by the month!

Till recently, you had to perform various steps to achieve this:
1. Got to your web-gmail, Settings | Forwarding and POP/IMAP | Enable
IMAP Access
2. Enable access for "Less secure apps":
   https://support.google.com/accounts/answer/6010255?hl=en
3. Try to SMTP-login.
   BUT if the IP had not access web-GMail recently,
   you got the message you report.
   So you had to:
   - reconstruct the URL+token intermingled in the SMTP-error message,
   - paste it in your browser, and
   - do a web-login to prove you are a human.
You had to perform step 3 regularly.

Now, if you had 2-factor-auth enabled, you could use "app-passwords" to log into your gmail account: https://support.google.com/accounts/answer/185833?hl=en

But this seems to have stopped working; I clicked the link in the page below
  https://support.google.com/accounts/answer/6010255?hl=en
and for my account it tells me "less secure apps" access is unavailable :-(
Show 16 quoted lines
>
> 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@gmail.com password mypassword
>
> Then do
>
>     git config --global credential.helper netrc
>
> and you're all set. :)
I believe the best way forward is to use OAuth.
Ciao,
  Kostis
Paolo Bonzini· Oct 5, 2017, 15:47 UTC · re: ankostis · lore

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

On 05/10/2017 16:21, ankostis wrote:
> 
> But this seems to have stopped working; I clicked the link in the page below
>   https://support.google.com/accounts/answer/6010255?hl=en
> and for my account it tells me "less secure apps" access is unavailable :-(

It says for me "This setting is not available for accounts with 2-Step Verification enabled. Such accounts require an application-specific password for less secure apps access", which is the right thing to do.

I used an app-specific password ten minutes before answering OP...
Paolo
Kaartic Sivaraam· Oct 6, 2017, 14:43 UTC · re: Lars Schneider · lore

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

On Thu, 2017-10-05 at 12:52 +0200, Lars Schneider wrote:
Show 13 quoted lines
> Apparently that stopped working today. I get this error:
> 
>     (mbox) Adding cc: Lars Schneider <larsxschneider@gmail.com> from line 'From: Lars Schneider <larsxschneider@gmail.com>'
>     Password for 'smtp://larsxschneider@gmail.com@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?
> 

I thought I was the only one having this problem. Seems, I'm not alone ;-) Until recently I was using the email address,

kaarticsivaraam91196@gmail.com

to send patches. Last week, I got the same error message you did and tried to fix it in various ways but failed in my attempt; got fed up and switched to another mail address I owned (the current one) using which I'm able to send patches (surprise !). Fortune for me as, it wasn't a big deal. I think this is an issue with Google.

(I still don't know when I'm going to get the error for this one. I don't have ideas to change this one.)

-- 
Kaartic
Christian Couder· Oct 6, 2017, 15:02 UTC · re: Lars Schneider · lore

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

Hi,

On Thu, Oct 5, 2017 at 12:52 PM, Lars Schneider <larsxschneider@gmail.com> wrote:

> 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?
As I wrote at the top of:
https://public-inbox.org/git/CAP8UFD2j-UFh+9awz91gtZ-jusq7EUOExMgURO59vpf29jXS4A@mail.gmail.com/
I also got the same problem.
Ævar Arnfjörð Bjarmason· Oct 6, 2017, 16:13 UTC · re: Lars Schneider · lore

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

On Thu, Oct 05 2017, Lars Schneider jotted:
Show 26 quoted lines
> 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@gmail.com
>         smtpserverport = 587
>         from = larsxschneider@gmail.com
>         chainreplyto = false
>         suppresscc = self
>
> Apparently that stopped working today. I get this error:
>
>     (mbox) Adding cc: Lars Schneider <larsxschneider@gmail.com> from line 'From: Lars Schneider <larsxschneider@gmail.com>'
>     Password for 'smtp://larsxschneider@gmail.com@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 still works for me. Just sent myself an E-Mail now via git-send-email.

    Password for 'smtp://avarab@gmail.com@smtp.gmail.com:465':
    OK. Log says:
    Server: smtp.gmail.com
    [...]
    Result: 250
My settings are:
    [sendemail]
            smtpserver = smtp.gmail.com
            smtpEncryption = ssl
            smtpuser = avarab@gmail.com
            confirm = always

And my https://myaccount.google.com/apppasswords lists an app password.

If you see this E-Mail from me that means my local Exim instance (which also has an app password) is able to send E-Mail as well.

I have 2fa turned on on my Google account, I just have these app passwords for GMail.

Dennis Kaarsemaker· Oct 23, 2017, 16:27 UTC · re: Lars Schneider · lore

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

On Thu, 2017-10-05 at 12:52 +0200, Lars Schneider wrote:
> Hi,
> 
> I used to use the Google SMTP server to send my patches to the list with 
> the following config:
>8 ---
Show 12 quoted lines
> Apparently that stopped working today. I get this error:
> 
>     (mbox) Adding cc: Lars Schneider <larsxschneider@gmail.com> from line 'From: Lars Schneider <larsxschneider@gmail.com>'
>     Password for 'smtp://larsxschneider@gmail.com@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?

For 2fa-protected accounts, this seems to break quite often. I ended up setting up a mail relay on my vps for this. If you want, you can use git.seveas.net to send patches to the git mailing lists (doesn't work for other recipients, I'm not quite stupid enough to run an open mail relay...)

D.
Lars Schneider· Nov 17, 2017, 13:50 UTC · re: Dennis Kaarsemaker · lore

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

Show 28 quoted lines
> On 23 Oct 2017, at 18:27, Dennis Kaarsemaker <dennis@kaarsemaker.net> wrote:
> 
> On Thu, 2017-10-05 at 12:52 +0200, Lars Schneider wrote:
>> Hi,
>> 
>> I used to use the Google SMTP server to send my patches to the list with 
>> the following config:
> 
>> 8 ---
> 
>> Apparently that stopped working today. I get this error:
>> 
>>    (mbox) Adding cc: Lars Schneider <larsxschneider@gmail.com> from line 'From: Lars Schneider <larsxschneider@gmail.com>'
>>    Password for 'smtp://larsxschneider@gmail.com@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?
> 
> For 2fa-protected accounts, this seems to break quite often. I ended up
> setting up a mail relay on my vps for this. If you want, you can use
> git.seveas.net to send patches to the git mailing lists (doesn't work
> for other recipients, I'm not quite stupid enough to run an open mail
> relay...)

:-) ... unfortunately that also means one can not CC people using your server. Looks like I need to setup my own solution after all :-(

Cheers, Lars

← back to recent threads