[Imap-protocol] Avoiding connection-loss

Mark Crispin mrc at CAC.Washington.EDU
Mon Sep 18 08:22:40 PDT 2006

You are lucky if your NAT box waits 15 minutes before closing inactive
connections. I've encountered NAT boxes that do it in less than 5, and
can be made to dump connections even faster than that.

It isn't necessary for the server to send an untagged EXISTS as a NAT
keepalive (although it's certainly permitted); an untagged OK will do just
as well.

Also of concern is that clients from a certain large and very well-known
software house in Redmond, WA will fail to exit out of IDLE before the 30
minute autologout expires. This causes the session to be disconnected in
a non-obvious way to the user, who then complains that he isn't getting
notified about new mail.

The workaround for this problem is, after 29 minutes with no new mail, to
send a fake EXISTS that alleges that there is one new message. Then, when
the client issues a DONE to exit IDLE mode, send a fake EXPUNGE to revoke
that "new message". This will cause that client to issue a new idle.

-- Mark --

Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.

More information about the Imap-protocol mailing list