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

david mirabito david.mirabito at gmail.com
Wed Jan 20 01:22:57 EET 2010


Whoops, I forgot to reply to the list previously, sorry. Thanks for the patch, I will take a look soon and see if it helps robustness.

<snip>
Just after I sent the mail yesterday, I was discussing with some people here and the consensus seems to be that its either the email provider (postoffice.net) or indeed some device between our office in Sydney and the exchange server (postoffice.net) timing out.

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.

Feel free to do with this what you want, if it might be useful.
</snip>

(that 12 hours now should read as 36+)

Thanks,
  -DavidM

-------------- next part --------------
A non-text attachment was scrubbed...
Name: idle_timeout.diff
Type: application/octet-stream
Size: 4696 bytes
Desc: not available
URL: <http://lists.hellug.gr/pipermail/imapfilter-devel/attachments/20100120/37374780/attachment.obj>
-------------- next part --------------


On 20/01/2010, at 10:13 AM, Lefteris Chatzimparmpas wrote:

> On Mon, Jan 18, 2010 at 01:01:38PM +1100, david mirabito wrote:
>> It seems to work fine, with updates coming in and emails instantly being moved to their proper home.
>> 
>> Only, after 5-10 minutes it seems to reliably crash out with:
>> 
>> imapfilter: reading data; error:00000000:lib(0):func(0):reason(0)
> 
> Hello,
> 
> I prepared a patch to make the SSL reporting during errors more
> detailed, and try to recover from some errors.
> 
> Can you apply this patch against version 2.2 and recompile and try to
> reproduce the problem.  It would be interesting to see what we get.  You
> can apply and try it without install, like this:
> 
> 	$ tar zxf imapfilter-2.2.tar.gz
> 	$ cd imapfilter-2.2
> 	$ patch < ~/patch-2.2-1.diff
> 	$ make SHAREDIR=.
> 	$ ./imapfilter
> 
> Then if this doesn't help, I will have a look at what can we do to work
> around this server's behaviour...
> 
> Thanks
> 
> <patch-2.2-1.diff>



More information about the Imapfilter-devel mailing list