Comments (8)
offlineimap work very nice without any issues.
from gmail-oauth2-tools.
@marcelolaia Could you please share the offlineimap change details ? I am also stuck in the above issue you have mentioned here.
from gmail-oauth2-tools.
@marcelolaia Could you please share the offlineimap change details ? I am also stuck in the above issue you have mentioned here.
Hi @shiben-lab, I'm so sorry for delay in replay.
I have been set up my .offlineimaprc
like the instructions here.
The relevant part is:
[Repository ExampleCompanyRemote]
type = IMAP
remotehost = imap.gmail.com
remoteuser = myuser
ssl = yes
starttls = no
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
auth_mechanisms = XOAUTH2
oauth2_client_id = YOUR_CLIENT_ID_HERE
oauth2_client_secret = YOUR_CLIENT_SECRET_HERE
oauth2_request_url = https://accounts.google.com/o/oauth2/token
oauth2_refresh_token = YOUR_REFRESH_TOKEN_HERE
Please, tell me if you have solved your issue.
My msmtp issue continue unsolved.
from gmail-oauth2-tools.
I tried it with python 3.8 and it not run:
Traceback (most recent call last):
File "/usr/lib/python3.8/urllib/request.py", line 1350, in do_open h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/lib/python3.8/http/client.py", line 1255, in request self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 950, in send self.connect()
File "/usr/lib/python3.8/http/client.py", line 1417, in connect super().connect()
File "/usr/lib/python3.8/http/client.py", line 921, in connect self.sock = self._create_connection(
File "/usr/lib/python3.8/socket.py", line 787, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./oauth2.py", line 366, in <module> main(sys.argv)
File "./oauth2.py", line 344, in main response = AuthorizeTokens(options.client_id, options.client_secret,
File "./oauth2.py", line 228, in AuthorizeTokens response = urlopen(request_url, data).read()
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 525, in open response = self._open(req, data)
File "/usr/lib/python3.8/urllib/request.py", line 542, in _open result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 1393, in https_open return self.do_open(http.client.HTTPSConnection, req,
File "/usr/lib/python3.8/urllib/request.py", line 1353, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>
from gmail-oauth2-tools.
Hey @marcelolaia,
If you are still stuck, you can try this minimal script I wrote for myself: gmail-oauth2_none_none.sh
It just requires bash
, curl
and jq
on your system.
from gmail-oauth2-tools.
Hi @MunifTanjim, thank you so much! Please, could you share the needed configurations to do? You use it with msmtp?
from gmail-oauth2-tools.
You use it with msmtp?
Yes.
You can put this in your msmtp
config:
auth oauthbearer
passwordeval "gmail-oauth2.sh access_token --client-id CLIENT_ID --client-secret CLIENT_SECRET --refresh_token REFRESH_TOKEN"
You can get the REFRESH_TOKEN
by running this:
gmail-oauth2.sh refresh_token --client-id CLIENT_ID --client-secret CLIENT_SECRET
If you don't want to put these sensitive CLIENT_SECRET
or REFRESH_TOKEN
in your config file you can take a look at another script that I actually use: gmail-oauth2_bitwarden_secret-tool.sh
It needs Bitwarden CLI bw
and secret-tool
. With it, I just put these in my configs:
# msmtp
auth oauthbearer
passwordeval "gmail-oauth2.sh access_token [email protected]"
# mbsync
AuthMechs XOAUTH2
PassCmd "gmail-oauth2.sh access_token [email protected]"
from gmail-oauth2-tools.
Fixed in commit 944cffd.
from gmail-oauth2-tools.
Related Issues (20)
- 401 errors HOT 1
- oauth2.py: Bad Request error, invalid grant HOT 2
- sendgmail: use the GMail API instead of SMTP HOT 22
- API probably doesn't send "refresh_token"s anymore. HOT 1
- .
- B
- Yahoo
- Update sendgmail's instructions HOT 1
- GMail refresh token retrieval no longer working HOT 4
- oauth2.py uses outdated urls HOT 1
- Unclear how to register an application, establish a client-id HOT 1
- Gmail
- Gmail
- Python: SyntaxError: invalid syntax - Generate a Token HOT 1
- Python3 version? HOT 3
- How to Authenticator bypass or disable for google account HOT 1
- sendgmail: refresh token hack no longer works HOT 1
- SMTP with XOAUTH2 HOT 9
- sendgmail: consider using localhost to get the oauth2 token HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmail-oauth2-tools.