Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gmail oauth2 got stuck #84

Open
szguoxz opened this issue May 22, 2023 · 4 comments
Open

gmail oauth2 got stuck #84

szguoxz opened this issue May 22, 2023 · 4 comments

Comments

@szguoxz
Copy link

szguoxz commented May 22, 2023

Anyone tried to connect to gmail imap using email and access-token?
It simply go dead on me. Tried a couple days, nothing worked.
I simply use the example code.
It dies on client.Authenticate("XOAUTH2", @Gmailauth)

Who had any success? by the way, I use runtime-tokio feature.

@adlrwbr
Copy link

adlrwbr commented Dec 24, 2023

I'm experiencing the same issue with runtime-tokio. The future never resolves, and my program hangs indefinitely.

@baztar
Copy link

baztar commented Jan 15, 2024

Faced the same issue.
This happens because the Gmail IMAP server sends a greeting message. To fix it, add this before the authentication

let _greeting = client.read_response().await?.expect("unexpected end of stream, expected greeting");

@szguoxz
Copy link
Author

szguoxz commented Jan 20, 2024

Is this part of the normtal protocol? Should the lib take care of this? Or is this just something google play dirty?

@link2xt
Copy link
Contributor

link2xt commented Jan 20, 2024

Yes, greeting is part of the protocol.
We at least need to fix examples/src/bin/gmail_oauth2.rs to read the greeting.
Better API would be nice as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants