Hanging folder list w/cyrus mini-patch

David Kerry imp@snti.com
Sun, 10 Mar 2002 14:41:21 -0500


Hi Folks,

	I've been using imp 3.0 with cyrus here for a little bit and banging
my head on the problem of the folder list just plain hanging indefinitely (
and running cpu > 90% and killing cyrus at the same time).  The problem was
that the mailbox list was getting two 'INBOX'es in it and the tree iteration
code was tripping over the second one and looping.

	I saw other people with the same problem, but I saw no replies with
patches or workarounds.  So... I finally tracked down the problem and came
up with a little patch (see below).  This works for me, but may break other
imap servers or configurations.

-- 
DK


*** lib/Tree.php	Sun Dec 23 08:32:03 2001
--- /var/www/horde/imp/lib/Tree.php	Sun Mar 10 14:03:44 2002
***************
*** 254,262 ****
              // make sure that the name does NOT have a trailing
              // delimiter; otherwise we won't be able to find it when
              // we need to use it as a parent object.
!             $tmp = $this->getMailbox($this->prefix);
              $tmp->name = $this->noTrailingDelimiter($tmp->name);
!             
              // don't re-insert the INBOX element for Cyrus,
              // Courier-imapd, etc.
              if (!isset($boxes[$tmp->name])) {
--- 254,262 ----
              // make sure that the name does NOT have a trailing
              // delimiter; otherwise we won't be able to find it when
              // we need to use it as a parent object.
!             $tmp = $this->getMailbox($this->noTrailingDelimiter($this->prefix));
              $tmp->name = $this->noTrailingDelimiter($tmp->name);
! 
              // don't re-insert the INBOX element for Cyrus,
              // Courier-imapd, etc.
              if (!isset($boxes[$tmp->name])) {