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://[email protected]':
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?
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.
To fix this, I had to turn on access for less secure apps.
Using curl to send email
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With