eclipse-ee4j / eclipse-ee4j/angus-mail

IMAP Idle Timeout

Open
#176 19 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
87
Forks
23
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
Some IMAP servers (Exchange Online/Office 365/Microsoft 365 definitely) quit pushing notifications after a period of time. The RFC for IMAP Idle states "clients using IDLE are advised to terminate IDLE and reissue it at least every 29 minutes to avoid being logged off." It has been recommended elsewhere that this should be adjustable down to every 10 minutes if so desired (and O365 seems like it needs it that rapidly).

**Describe the solution you'd like**
Currently, handleIdle ignores a socket receive timeout and simply goes back to listening. Instead, it should abort and reissue the IDLE command. If there are errors, they can be handled by the application.

**Describe alternatives you've considered**
Add mail.imap.idletimeout which will set an underlying timer to interrupt the readResponse to get it to reissue the IDLE command.

**Additional context**
Preference is to simply reissue the IDLE command (after aborting it) upon a socket receive timeout since that does not involve any extra threads.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the IMAP handleIdle path and its readResponse handling, as named in the issue, then inspect how socket receive timeouts are currently treated. Done means a receive timeout aborts and reissues IDLE without adding extra threads; application-visible errors should remain possible.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.