Re: [Hastymail-devel] Timeout on imap
Brought to you by:
sailfrog,
slushpupie
From: Thierry de M. <th...@if...> - 2012-11-27 16:53:17
|
Hi Jason, With this code, it does leave the loop, but it must be trying to read again as the page is still timing out, and I get the following error: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/hastymail2/lib/imap_class.php on line 181 It looks like the is_resource($this->handle) test doesn't detect when the socket is closed, which is normal, as a handle to a closed socket is still a resource. I tried to replace it with the following with success: if(feof($this->handle)) break; I presume the test should be replace all around: "if(!is_resource())" => "if(feof())" Regards, Thierry ________________________________ Thierry de Montaudry Interface Holding (Pty) Ltd +27 (0)79 980 0752 +27 (0)11 628 9800 +33 (0)6 72 12 80 53 On 26 Nov 2012, at 17:10, ja...@ha... wrote: > A test fix for this is in SVN rev 2120 and the simple diff below. If you can > test this out and see if it helps with the situation that would be great. > Otherwise I will try to force an untagged BYE response in Dovecot somehow :) > > Index: lib/imap_class.php > =================================================================== > --- lib/imap_class.php (revision 2119) > +++ lib/imap_class.php (working copy) > @@ -228,6 +228,9 @@ > $chunked_result[$c] = $chunks; > } > } > + if (substr(strtoupper($result[$n]), 0, 6) == '* BYE ') { > + break; > + } > } while (substr($result[$n], 0, strlen('A'.$this->command_count)) != > 'A'.$this->command_count); > $this->responses[] = $result; > if ($chunked) { > > > Jason Munro > ja...@ha... > > On Mon, 26 Nov 2012 15:06:14 +0100 Thierry de Montaudry <th...@if...> > wrote > >> Hi there, >> >> After getting a timeout on one mailbox, I did run some manual connection to >> the account and found out that Hastymail is always timing out when there is a >> server error. It looks to me like it doesn't handle the "* BYE" reply and >> still tries to get more data. Please see below the transaction. >> >> Regards, >> >> Thierry >> >> >> A003 FETCH 1:* FULL >> * 1 FETCH (FLAGS (\Seen) INTERNALDATE "24-Nov-2012 08:53:35 +0200" >> RFC822.SIZE 10060984) * BYE Internal error occurred. Refer to server log for >> more information. [2012-11-26 15:00:37] Connection closed by foreign host. >> >> _______________________________ >> Thierry de Montaudry >> Interface Holding (Pty) Ltd >> +27 (0)79 980 0752 >> +27 (0)11 628 9800 >> +33 (0)6 72 12 80 53 >> >> >> >> ----------------------------------------------------------------------------- >> - Monitor your physical, virtual and cloud infrastructure from a single >> web console. Get in-depth insight into apps, servers, databases, vmware, >> SAP, cloud infrastructure, etc. Download 30-day Free Trial. >> Pricing starts from $795 for 25 servers or applications! >> http://p.sf.net/sfu/zoho_dev2dev_nov >> _______________________________________________ >> Hastymail-devel mailing list >> Has...@li... >> https://lists.sourceforge.net/lists/listinfo/hastymail-devel > > |