[Tickets #6827] Re: Creation of IMAP subfolder fails

bugs at horde.org bugs at horde.org
Fri Jun 6 12:20:09 UTC 2008


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/6827
-----------------------------------------------------------------------
 Ticket             | 6827
 Updated By         | Thomas Jarosch <thomas.jarosch at intra2net.com>
 Summary            | Creation of IMAP subfolder fails
 Queue              | IMP
 Version            | FRAMEWORK_3
 Type               | Bug
 State              | Unconfirmed
 Priority           | 1. Low
 Milestone          |
 Patch              |
 Owners             |
+New Attachment     | horde-imp-createMailbox-delimiter.patch
-----------------------------------------------------------------------


Thomas Jarosch <thomas.jarosch at intra2net.com> (2008-06-06 08:20) wrote:

I found the source of the issue. IMP tried to create folders
below "INBOX" like this: "INBOX//new_folder".

The error occurs in imp/lib/IMAP/Tree.php::createMailboxName($parent,
$new).
Here's a dump of the $ns_info structure:

Array
(
    [name] => INBOX/
    [delimiter] => /
    [type] => personal
    [hidden] =>
)

$parent is set to "INBOX", $new is "new_folder".

Here's the code that computes the folder "base":

    $mbox = $ns_info['name']; --> mbox is "INBOX/"
    $mbox .= rtrim(substr_replace($parent, '', 0,
strlen($ns_info['name'])), $ns_info['delimiter']) . $ns_info['delimiter'];

substr_replace($parent, '', 0, strlen($ns_info['name'])) will lead to an
empty string.
rtim() is a noop in this case.

Then we append the delimiter, so this results in "INBOX//".

I've developed a fix, though I don't know
if "name -> INBOX/" is right in the first place.





More information about the bugs mailing list