[imapfilter-devel] IDLE and 'connection reset by peer'

Lefteris Chatzimparmpas lefcha at hellug.gr
Wed Jan 20 01:57:52 EET 2010


On Wed, Jan 20, 2010 at 10:22:57AM +1100, david mirabito wrote:
> I did some digging and found where the read on the socket after IDLE
> is sent has a hardcoded timeout on the select of 29 minutes,
> independent of the global timeout setting (as I believe it should be).
> The attached patch adds an optional argument to the enter_idle() lua
> function (which defaults to 29*60 if not presented, or 0 is passed)
> and uses that as the timeout instead. With a value of 300, it seems
> the timeout and re-sending the IDLE is enough to act as a keepalive by
> iteself. I have successfully been using this for a little over 12
> hours now, with no disconnect.

That's interesting.  The 29 minutes select() timeout is there (and
hard-coded) because the IMAP RFC specifies that servers MUST have an
idle timeout of at least 30 minutes, and thus 29 minutes between
refreshing IDLE is enough.  Apparently this server doesn't respect that.

Also, the global timeout option is there for general timeouts, ie. when
there is a network problem and some socket function "hangs".

What we can do is add an IDLE-specific global timeout option, so it will
configurable the current 29 minutes timeout, to work around
non-compliant servers.

But still, please, try the patch, without your changes, I'd like to see
what's the outcome.



More information about the Imapfilter-devel mailing list