+2 votes

Using IMAP idle in a .Net application with a timeout parameter.

The idle does not return after the timeout period. Does not matter whether I specify timeout of 10 seconds or 10 minutes.

The server does support IDLE, as reported by SupportedExtensions Method.

IMAP mail retrieval otherwise works fine. I do receive email, I just cannot control and monitor for timeout

by

1 Answer

0 votes

Imap.Idle() method doesn't exit after the timeout period - the IDLE command is reissued after this timeout.

This prevents routers to drop the connection when there is no traffic.

Imap.Idle() exits in two situations:
- server returns a response (there is a change in the folder on the server)
- you invoke Imap.StopIdle() on some other thread.

by (301k points)
...