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

[Bug] New messages sometimes not retrieved while idle #112

Closed
krackout opened this issue Oct 7, 2022 · 9 comments
Closed

[Bug] New messages sometimes not retrieved while idle #112

krackout opened this issue Oct 7, 2022 · 9 comments
Assignees

Comments

@krackout
Copy link

krackout commented Oct 7, 2022

Sometimes e-mail delivery is not happening until I manually refresh (pressing L); it happens in idle state only. Yet mails are mostly received in a timely fashion, I cannot make a correlation when nmail doesn't get the signal (of some kind, don't know the details) that new mail has arrived.

Yet I cannot speak of a bug, haven't got any hard evidence. I have this setting on, idle_fetch_flags=1 in case it's related. I'm thinking of changing server_timestamps=0 to 1 to see if it makes any difference.

It seems to happen mostly on my work (Microsoft 365) account. But since I constantly use it, it's not easy to be certain about it; I'll try to leave it idling in the weekend and send test e-mails to check.

@Kabouik
Copy link
Contributor

Kabouik commented Oct 7, 2022 via email

@d99kris d99kris self-assigned this Oct 8, 2022
@d99kris
Copy link
Owner

d99kris commented Oct 8, 2022

Yes, nmail supports IMAP IDLE. After no IMAP activity for 15 seconds, nmail fetches message uids and then enters idle. Upon idle notification, nmail fetches message uids and exits idle. After 29 mins in idle state, nmail stops and restarts idle.

I have not encountered any issues relating to this myself, but reviewing the implementation I believe I've found some possible improvements. For example we could fetch message uids at every 29 min idle timeout.

However, I'll need to do some more checking and testing on this before I can prepare a fix.

@krackout
Copy link
Author

krackout commented Oct 8, 2022 via email

@d99kris
Copy link
Owner

d99kris commented Oct 8, 2022

Yep, we can certainly make the timeout configurable.

@d99kris d99kris changed the title [Question] Does nmail support IMAP IDLE? [Bug] New messages sometimes not received while idle Oct 8, 2022
@d99kris d99kris changed the title [Bug] New messages sometimes not received while idle [Bug] New messages sometimes not retrieved while idle Oct 8, 2022
@d99kris
Copy link
Owner

d99kris commented Nov 13, 2022

The above commit adds support for configuring idle timeout with idle_timeout in ~/.nmail/main.conf.

Will keep this issue open until other fixes have been committed.

@d99kris d99kris reopened this Nov 13, 2022
@d99kris d99kris reopened this Nov 13, 2022
@d99kris
Copy link
Owner

d99kris commented Nov 13, 2022

The above commit implementes more robust detection of new emails while in idle.

Will keep this issue open until a few more related fixes have been committed.

@d99kris
Copy link
Owner

d99kris commented Nov 13, 2022

The above commit adds better status reporting during idle.

Will keep this issue open until one more related fix has been committed.

@d99kris d99kris reopened this Nov 13, 2022
@d99kris
Copy link
Owner

d99kris commented Nov 13, 2022

The above fix detects when device is returning from sleep mode, and if in idle mode, ensures we exit idle mode (and indirectly try fetch messages again before re-entering idle).

This is the last idle-related fix for this Github issue.

@d99kris
Copy link
Owner

d99kris commented Nov 13, 2022

Just like to add on - while the latest nmail idle functionality has been tested OK with several email service providers, there is one with problems: outlook.com

However, it seems to be a server-side problem according to
https://techcommunity.microsoft.com/t5/outlook/outlook-office-365-imap-idle-is-broken/m-p/3616242

Hopefully Microsoft fixes this soon. As a temporary workaround one can now set idle timeout to some lower value, effectively polling the server for new messages.

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

3 participants