[RCD] Tiny patch for LDAP filter

2008-02-22 Thread Roy McMorran

Hello,

When compose calls the LDAP search function (to build the auto-complete 
list) it passes an empty '$value' parameter.  In this case, when all the 
bits of the filter get concatenated you end up with something like this:


(|(mail=**)(cn=**))

which isn't valid syntax (at least it's not on my LDAP server).

Here's a tiny patch to rcube_ldap.inc that eliminates the double 
wildcards.  There may be a better way to do it, but this was simple.


Cheers,
Roy

--

Roy McMorran
Systems Administrator
MDI Biological Laboratory
[EMAIL PROTECTED]




--- 8 --- detachments --- 8 ---
The following attachments have been detached and are available for viewing.
 http://detached.gigo.com/rc/ls/uvbblwG2/rcube_ldap.inc.patch
Only click these links if you trust the sender, as well as this message.
--- 8 --- detachments --- 8 ---

___
List info: http://lists.roundcube.net/dev/


[RCD] httpd using 100% cpu, imap socket stuck in CLOSE_WAIT

2008-04-03 Thread Roy McMorran
Hello all,

Often throughout the day I see instances where an httpd process will 
spike up to 100% cpu utilization and stay there for an extended period 
of time.  eg:

19068 apache 1   00   71M   49M cpu/19:05 48.11% httpd
(that's a 2-cpu machine)

This is a Roundcube process.  If I run a truss on that pid I can see 
that it is doing absolutely nothing. 

Also lsof tells me:
COMMAND PID USER   FD   TYPEDEVICE SIZE/OFF  
NODE NAME
httpd 19068   apache   39u  IPv4 0x30012fd2380  0t0   
TCP mail.example.org:63204-mail.example.org:imap (CLOSE_WAIT)

This connection will stay in the CLOSE_WAIT state (and the CPU pegged) 
indefinitely, or at least until...

...eventually it times out and I may see this in the Apache error log:
[Thu Apr 03 11:46:44 2008] [error] [client 209.222.195.177] PHP Fatal 
error:  Maximum execution time of 300 seconds exceeded in 
/group/www/mail.example.org/htdocs/program/lib/imap.inc on line 169, 
referer: 
https://mail.example.org/?_task=mail_action=show_uid=114766_mbox=INBOX

Any ideas what is causing this?  It's bringing the server to it's knees 
fairly often, and contributing to a perception among my users that 
Roundcube is slow.

This is Roundcube 0.1 stable running under PHP 5.2.5 / Apache 2.2.8 on 
Solaris 10.  Our IMAP server is UW and lives on the same box.

I'd appreciate any troubleshooting advice.
Cheers,
Roy

-- 

Roy McMorran
Systems Administrator
MDI Biological Laboratory
[EMAIL PROTECTED]

___
List info: http://lists.roundcube.net/dev/


[RCD] More info: httpd using 100% cpu...

2008-04-03 Thread Roy McMorran
Roy McMorran wrote:
 Often throughout the day I see instances where an httpd process will 
 spike up to 100% cpu utilization and stay there for an extended period 
 of time.  
After correlating information from a bunch of log files, I think I've 
found the circumstances that precipitate this problem.  It seems to be a 
case of one or more users running Roundcube *and* another email program 
at the same time. 

UW-IMAP doesn't want to serve the same inbox to both imap clients.  One 
of them gets cut off at the knees.  Eg:
Apr  3 14:51:10 mail imapd[12962]: [ID 289526 mail.info] Killed (lost 
mailbox lock) user=redacted host=mail.example.org [xxx.xxx.xxx.xxx]

When the loser is Roundcube we get into the 100% CPU / CLOSE_WAIT 
scenario I described earlier.

Is there any way we can make Roundcube more resilient in this 
situation?  Or is there an IMAP server that isn't quite so brutal?

Thanks,
Roy
-- 

Roy McMorran
Systems Administrator
MDI Biological Laboratory
[EMAIL PROTECTED]

___
List info: http://lists.roundcube.net/dev/


Re: [RCD] More info: httpd using 100% cpu...

2008-04-03 Thread Roy McMorran
till wrote:
 Wow, thanks for tracking this down!
 I have never seen this with courier-imap. I often have it open on my
 Mac, the notebook and in RoundCube. But I could also be lucky.

   
Hi till, thanks for the reply.

Does your courier-imap use mbox format, or something else?

This:
http://mailman1.u.washington.edu/pipermail/imap-uw/2007-December/001809.html
suggests the behavior is more due to the limitations of mbox rather than 
a particular imap server.

Nevertheless, mbox is still pretty popular and I don't think I can get 
away from it in my environment because I have many Unix command-line 
users (with pine, mutt, etc).

Looking through my apache logs, all the hangs have occurred inside 
imap.inc, in various functions.  Usually iil_Readline or iil_C_Select 
though.

Best wishes,
-r
-- 

Roy McMorran
Systems Administrator
MDI Biological Laboratory
[EMAIL PROTECTED]

___
List info: http://lists.roundcube.net/dev/


Re: [RCD] More info: httpd using 100% cpu...

2008-04-03 Thread Roy McMorran
[EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED] [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
X-Sender: [EMAIL PROTECTED]
Received: from cpe-72-224-141-4.maine.res.rr.com [72.224.141.4] with HTTP/1.1
(POST); Thu, 03 Apr 2008 19:19:11 -0400
User-Agent: RoundCube Webmail/0.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On Thu, 3 Apr 2008 23:01:25 +0200, till [EMAIL PROTECTED] wrote:
 
 There are some loops in those functions which expect
 sequences/characters and if those don't come around we have potential
 leaks and breaks. I see what you mean, but don't hold your breath for
 a fix soon.  We are looking for a replacement of our IMAP backend lib

For now I'm looking at a workaround using stream_set_timeout on the imap 
socket.  I'll let you know how that goes.
 
 and will work on this as soon as we released the 0.1.1 (this weekend).

Another new release?  Awesome!

-- 
Roy McMorran
Systems Administrator
MDI Biological Laboratory

___
List info: http://lists.roundcube.net/dev/


Re: [RCD] More info: httpd using 100% cpu...

2008-04-03 Thread Roy McMorran
[EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED] [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
X-Sender: [EMAIL PROTECTED]
Received: from cpe-72-224-141-4.maine.res.rr.com [72.224.141.4] with HTTP/1.1
(POST); Thu, 03 Apr 2008 19:25:59 -0400
User-Agent: RoundCube Webmail/0.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Charles  Rainer,

Thanks for the info about your configurations.  Here, pine and mutt
use mbox, but I will look into the possibilities you suggest.  I think
maildir would definitely clear up this issue.

Cheers,

-- 
Roy McMorran
Systems Administrator
MDI Biological Laboratory

___
List info: http://lists.roundcube.net/dev/


Re: [RCD] More info: httpd using 100% cpu...

2008-04-04 Thread Roy McMorran
Roy McMorran wrote:
 For now I'm looking at a workaround using stream_set_timeout on the imap 
 socket.  I'll let you know how that goes.
   
I'm using the following as a workaround and it seems to help prevent the 
deadlock.  This isn't tested thoroughly at all, and there are probably 
unintended consequences that I have not observed yet.  Use at your own risk.

--- imap.inc.dist   2008-04-03 17:59:33.10802 -0400
+++ imap.inc2008-04-03 18:42:08.009825000 -0400
@@ -467,6 +467,9 @@
 $iil_errornum = -1;
return false;
}
+   //set socket timeout 10 secs
+   stream_set_blocking($conn-fp,FALSE);
+   stream_set_timeout($conn-fp,10);
 
$iil_error .= Socket connection established\r\n;
$line   = iil_ReadLine($conn-fp, 300);


Looking forward to that new imap lib ;-)
Cheers,
-r


-- 

Roy McMorran
Systems Administrator
MDI Biological Laboratory
[EMAIL PROTECTED]

___
List info: http://lists.roundcube.net/dev/