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

Delay in receiving emails with IDLE in Rust compared to Node.js #307

Open
mikap0703 opened this issue Feb 26, 2025 · 1 comment
Open

Delay in receiving emails with IDLE in Rust compared to Node.js #307

mikap0703 opened this issue Feb 26, 2025 · 1 comment

Comments

@mikap0703
Copy link

I’m rewriting a Node.js program in Rust that listens for new emails using the IMAP IDLE command and reacts to incoming messages. However, after implementing the same behavior in Rust, I noticed a significant delay in email reception compared to the Node.js version.

The Node.js application receives emails almost instantly, while the Rust implementation lags behind by 20-30 seconds. Both applications:

  • Use the same email account for sending and receiving
  • Utilize the IDLE mechanism to wait for new emails
  • Are tested under the same conditions (same mail server, same network)

I'm using rust-imap 3.0.0-alpha.15

Any insights or similar experiences would be appreciated!

@mikap0703 mikap0703 changed the title Delay in Receiving Emails with IDLE in Rust Compared to Node.js Delay in receiving emails with IDLE in Rust compared to Node.js Feb 26, 2025
@jonhoo
Copy link
Owner

jonhoo commented Mar 8, 2025

Hmm, I don't have an immediate answer to why that might be. There isn't really any delays in the library itself. Best suggestion I can give is to try and add some prints/breakpoints in imap and see where the program is spending its time after Node has been notified but before Rust has.

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

2 participants