6.0.0-beta1
8/9/25

[#6827] Creation of IMAP subfolder fails
Summary Creation of IMAP subfolder fails
Queue IMP
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester thomas.jarosch (at) intra2net (dot) com
Created 06/03/2008 (6276 days ago)
Due
Updated 06/06/2008 (6273 days ago)
Assigned 06/06/2008 (6273 days ago)
Resolved 06/06/2008 (6273 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/06/2008 06:01:11 PM Michael Slusarz Comment #5
State ⇒ Resolved
Priority ⇒ 2. Medium
Reply to this comment
Our code: right idea, wrong execution.  We just needed to do the rtrim 
on the whole string, not just the part we were adding.  So slightly 
modified your patch to do this and committed to IMP 4.2.1.
06/06/2008 12:35:19 PM Jan Schneider Assigned to Michael Slusarz
State ⇒ Assigned
 
06/06/2008 12:20:08 PM Thomas Jarosch Comment #2
New Attachment: horde-imp-createMailbox-delimiter.patch Download
Reply to this comment
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.


06/03/2008 04:30:43 PM Thomas Jarosch Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ Creation of IMAP subfolder fails
Type ⇒ Bug
Reply to this comment
Hello together,



I'm currently seeing a strange issue when I try to create an IMAP 
subfolder in IMP. When I check the "INBOX" and select "Create folder", 
the popup appears. I enter "subfolder" as folder name. The creation of 
the new folder fails as it tries to create the folder "/subfolder".



When I do the same thing without checking "INBOX", so it defaults to 
INBOX, my subfolder INBOX/subfolder gets created fine.



Anyone else seeing this?



Thomas


Saved Queries