6.0.0-alpha12
6/12/25

[#9213] Left pane menu crash when no folder on imap server
Summary Left pane menu crash when no folder on imap server
Queue IMP
Queue Version 4.3.8
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester luc.germain (at) usherbrooke (dot) ca
Created 09/01/2010 (5398 days ago)
Due
Updated 10/21/2010 (5348 days ago)
Assigned 10/01/2010 (5368 days ago)
Resolved 10/21/2010 (5348 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/21/2010 06:10:13 AM Michael Slusarz State ⇒ Resolved
 
10/01/2010 07:14:39 AM Michael Slusarz Comment #8
State ⇒ Feedback
Version ⇒ 4.3.8
Reply to this comment
How about this?  I still can't reproduce an infinite loop, but I was 
able to reproduce a bunch of error messages (but only if all virtual 
folders were turned off).
10/01/2010 07:13:03 AM CVS Commit Comment #7 Reply to this comment
Changes have been made in CVS for this ticket:

Bug: 9213
Make there is always namespace info for INBOX.
http://cvs.horde.org/diff.php/imp/lib/IMP.php?rt=horder1=1.449.4.129r2=1.449.4.130ty=u
09/30/2010 06:22:16 PM luc (dot) germain (at) usherbrooke (dot) ca Comment #6 Reply to this comment
Try this.
It did not solve the problem. Although the Inbox is now in the folder 
tree, the first element of the namespaces array (for the type 
"personal") is still missing, and this is what seems to be causing the 
infinite loop.


09/22/2010 06:35:20 AM Michael Slusarz State ⇒ Resolved
 
09/11/2010 04:59:29 PM Michael Slusarz Comment #5
Assigned to Michael Slusarz
Reply to this comment
Try this.
09/11/2010 04:59:14 PM CVS Commit Comment #4 Reply to this comment
Changes have been made in CVS for this ticket:

Bug: 9213
It is possible that the INBOX value may be removed if the server does not
return INBOX in its folder listing.
http://cvs.horde.org/diff.php/imp/lib/IMAP/Tree.php?rt=horder1=1.25.2.71r2=1.25.2.72ty=u
09/09/2010 06:52:18 PM luc (dot) germain (at) usherbrooke (dot) ca Comment #3 Reply to this comment
I can't reproduce this.
Here are "print_r" of some arrays that might help you. These are 
obtained when I have no folders (other than INBOX).

- print_r of the result of "$this->_runCommand('NAMESPACE');" from 
imp/lib/IMAP/Client.php

IMAP_CLIENT readNamespaces: stdClass Object
(
     [response] => OK
     [message] => NAMESPACE NIL NIL (("Shared/" "/"))
     [type] => 1
)

- print_r of "$this->_namespaces" in function init() from 
imp/lib/IMAP/Tree.php

(
     [Shared/] => Array
         (
             [name] => Shared/
             [delimiter] => /
             [type] => shared
             [hidden] =>
         )
)

=> note that there is no "[type] => personal" section in the array

- print_r of "$this->_tree" just before leaving init() in 
imp/lib/IMAP/Tree.php

(
     [%] => Array
         (
             [a] => 64
             [v] => %
         )
)

=> note: there is no [INBOX] element...

- print_r of $tree_ob just before   foreach($tree_ob[0], ...

(
     [0] => Array
         (
             [0] => Array
                 (
                     [display] =>
                     [peek] =>
                 )

         )

     [1] => Array
         (
         )

     [2] => Array
         (
             [0] =>
         )

)

=> no [value]...


Hope this help.
09/07/2010 09:19:52 PM Michael Slusarz Comment #2
State ⇒ Feedback
Priority ⇒ 1. Low
Reply to this comment
I can't reproduce this.  And can't figure out how you would see this, 
because this would require inserting a mailbox with a blank value.   
See imp/lib/Block/tree_folders.php:86:
$tree->addNode($parent . $val['value'], ...);

$parent should be 'imp' here, $val['value'] is the mailbox name being added.

What entry for you has an empty $val['value'] value?
09/01/2010 07:22:54 PM luc (dot) germain (at) usherbrooke (dot) ca Comment #1
Patch ⇒ No
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ Left pane menu crash when no folder on imap server
Type ⇒ Bug
Priority ⇒ 2. Medium
Reply to this comment
When a user has no folder in his account on our IMAP server (cyrus 
2.2), the menu in the left frame does not show up; in fact, the 
request in this frame is crashing.

Digging down the code, I found out the cause is how IMP treat the 
answer to the NAMESPACE imap command. When the user has at least on 
folder, the NAMESPACE command return the following:

NAMESPACE (("" "/")) NIL (("[Shared]/" "/"))

But when there is no folder (other than INBOX), the NAMESPACE command return:

NAMESPACE NIL NIL (("[Shared]/" "/"))

The way this is treated in IMP cause an entry "imp" to be inserted as 
a child in the "imp" section of the menu tree, and later cause an 
infinite loop when walking the menu tree, and PHP crash due to memory 
exhaustion.

I temporarily patched the horde/imp/lib/IMAP/Client.php file at line 
603 to replace
'NAMESPACE NIL '
by
'NAMESPACE (("" "/")) '
when found in the result of the NAMESPACE command, but IMP should be 
able to manage the returned value

NAMESPACE NIL NIL (("[Shared]/" "/"))

correctly (as it IS a valid answer!)

I tried to make a better fix, but the code that builds the menu tree 
is a bit too complex for me...

Saved Queries