MBOX-Line: From mrc at CAC.Washington.EDU  Mon Sep 18 08:22:40 2006
To: imap-protocol@u.washington.edu
From: Mark Crispin <mrc@CAC.Washington.EDU>
Date: Fri Jun  8 12:34:38 2018
Subject: [Imap-protocol] Avoiding connection-loss
In-Reply-To: <009901c6daf1$1026f580$2d65a8c0@ProImage.local>
References: <009901c6daf1$1026f580$2d65a8c0@ProImage.local>
Message-ID: <Pine.OSX.4.64.0609180815470.368@pangtzu.panda.com>

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 --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.

