9

Using this Git:

$ git --version
git version 2.5.1

With this configuration:

$ git config --list | grep imap
imap.folder=[Gmail]/Drafts
imap.host=imaps://imap.gmail.com

If I run this command:

cat 0001-alpha.patch | git imap-send

This is the result:

Resolving imap.gmail.com... ok
Connecting to [2607:f8b0:400e:c03::6d]:993... ok
Logging in...
Username for 'imaps://imap.gmail.com':
Password for 'imaps://svnpenn@imap.gmail.com':
IMAP command 'LOGIN <user> <pass>' returned response (NO) - [ALERT] Please log in via your
  web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
*** IMAP ALERT *** Please log in via your web browser:
  https://support.google.com/mail/accounts/answer/78754 (Failure)
IMAP error: LOGIN failed
failed to open store

Strangely, it still asks for credentials and fails even if I am already logged in via my browser. How can I use git imap-send with Gmail?

Zombo
  • 1
  • 62
  • 391
  • 407

3 Answers3

1

From what "gmail login failure using python and imaplib" describes, you cannot user user/password account to use gmail.com outside the web browser.

You would have to use XOAuth2 (that can be generated through various modules), whose scope is imap and smtp (or enabling access for less secure app).

Considering oauth isn't mentioned in git, lowering the security, as unsafe as it sound, might be the only possibility in this instance.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    `git-send-email` and gmail filters to tag outbounds as needed works, gmail's SMTP is TLS-only so security's not a problem. – jthill Oct 11 '15 at 22:15
1

To fix this, I had to turn on access for less secure apps.

Using curl to send email

Community
  • 1
  • 1
Zombo
  • 1
  • 62
  • 391
  • 407
0

I had similar trouble. I am not sure which was the linchpin but I solved my problem by:

  1. Verify that you are using IPv6 to log into GMail with your web browser. Just because your OS is choosing to use IPv6 by default does not mean that your browser is also using IPv6 to connect to gmail.

  2. Set up an App Specific Password: https://support.google.com/mail/answer/185833?hl=en

dfc
  • 792
  • 5
  • 16