jonhoo / rust-imap

IMAP client library for Rust
Apache License 2.0
477 stars 80 forks source link

Program hanging when trying to connect to gmail. #219

Open Yamboy1 opened 2 years ago

Yamboy1 commented 2 years ago

My program will often hang at client.login when connecting to gmail. I have tested this with multiple gmail accounts. I haven't had a chance to test this with any other imap servers to see if there's a difference. This doesn't happen all the time, but it does happen more often than not.

How could i help to address or work out where the issue is coming from? Btw, I'm new to rust, but not to open source or programming haha.

jonhoo commented 2 years ago

Huh, that's very weird indeed! I would recommend enabling the debug boolean flag so that the library will print all of the interactions with the server, which should hopefully give some indication of where the hang occurs!

Yamboy1 commented 2 years ago

I enabled the debug flag for the session (i think thats where you meant), and when it hangs, it still doesn't output anything, but when it does succeed, it prints out the debug of any commands that are sent once the connection is made. I can also confirm that the error occurs in the imap_login function.

Yamboy1 commented 2 years ago

Whoops, imap_login was my code, imap::connect was where it appears to be hanging

jonhoo commented 2 years ago

That's very suspicious. I think you might have to open up Wireshark or something like it to see what packets are being sent and where the delay actually comes from. We don't really do anything very magical in connect — it just connects to the server and sends the login command.

641i130 commented 1 year ago

How do we enable the debug boolean flag? I can't seem to find it in the documentation. Found it: https://github.com/jonhoo/rust-imap/issues/220#issuecomment-1028612003