6.0.0-beta1
7/4/25

[#8468] Renaming public folder is wrong
Summary Renaming public folder is wrong
Queue IMP
Queue Version 4.3.4
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester frank.richter (at) hrz (dot) tu-chemnitz (dot) de
Created 07/31/2009 (5817 days ago)
Due
Updated 01/13/2010 (5651 days ago)
Assigned 08/05/2009 (5812 days ago)
Resolved 08/06/2009 (5811 days ago)
Github Issue Link
Github Pull Request
Milestone 4.3.5
Patch No

History
01/13/2010 12:10:01 AM CVS Commit Comment #18 Reply to this comment
Changes have been made in Git for this ticket:

Bug #8468: Doing too much magic on rename folder name - we have to 
trust the user at some point.

http://git.horde.org/diff.php/imp/folders.php?rt=horde-git&r1=df8c626194789a61214771c8b5ac07fa870bdc8b&r2=8b659fe604f4a3a6af9ea1509029198bdaafa4e3
01/13/2010 12:09:59 AM CVS Commit Comment #17 Reply to this comment
Changes have been made in Git for this ticket:

Bug #8468: When appending namespaces, search for empty namespace.

http://git.horde.org/diff.php/imp/lib/Imap.php?rt=horde-git&r1=df8c626194789a61214771c8b5ac07fa870bdc8b&r2=ba5fce1be74c5d90f085e622b806eae53d4acc38
08/06/2009 05:14:03 PM Michael Slusarz Comment #16
State ⇒ Resolved
Reply to this comment

[Show Quoted Text - 10 lines]
Thanks for the catch - my system is set up so that both are available 
so I didn't notice this.  And thanks for helping to resolve this issue.
08/06/2009 06:33:06 AM frank (dot) richter (at) hrz (dot) tu-chemnitz (dot) de Comment #14 Reply to this comment
I have to change

   $old_names = array_map('trim', explode("\n", 
Horde_Util::getFormData('old_names')));

   $new_names = array_map('trim', explode("\n", 
Horde_Util::getFormData('new_names')));

to:

   $old_names = array_map('trim', explode("\n", 
Util::getFormData('old_names')));

   $new_names = array_map('trim', explode("\n", 
Util::getFormData('new_names')));



(otherwise it exits - empty page in browser).



With this, yes, it works:

  - renaming folder in INBOX namespace

  - renaming folder within shared namespace

  - renaming a shared folder to INBOX: Give INBOX.foldername as new 
folder name, that's ok.



Thank you very much,

Frank
08/05/2009 09:58:00 PM CVS Commit Comment #12 Reply to this comment
08/05/2009 09:30:33 PM frank (dot) richter (at) hrz (dot) tu-chemnitz (dot) de Comment #11 Reply to this comment

[Show Quoted Text - 23 lines]
This is correct IMHO  - at least in our environment no user may create 
toplevel folders

in public namespace, so INBOX.foo.test2 is the only solution.
There are only two ways I can think of to fix:
1. Look at the old mailbox name and only allow a rename within that
namespace.
Would be better than now, but not optimal.
2. Requiring the entire folder name while renaming, but this was what
was specifically refused in the previously mentioned ticket since
personal namespaces should be invisible to the user.
That's right, don't do that.
This is why Cyrus' namespace setup has *never* made sense to me.  The
default namespace should be a user's personal namespace - shared and
other folders are special folders that should live under a specific
sub-folder.
I agree ...

In a GUI this moving of folders between namespaces is easier ...



Frank


08/05/2009 09:29:54 PM Michael Slusarz Comment #10 Reply to this comment
Re-reading RFC 2342, the assumption seems to be that folders (once 
created) are restricted to that particular namespace.  So we will go 
with option #1.
08/05/2009 09:18:48 PM Michael Slusarz Comment #9 Reply to this comment

[Show Quoted Text - 19 lines]
What if the user wants to rename 'group.test.test1' to 'foo.test2'.   
It would fall through to your last case and get added as 
'INBOX.foo.test2' which is not correct.



There are only two ways I can think of to fix:

1. Look at the old mailbox name and only allow a rename within that namespace.

2. Requiring the entire folder name while renaming, but this was what 
was specifically refused in the previously mentioned ticket since 
personal namespaces should be invisible to the user.



This is why Cyrus' namespace setup has *never* made sense to me.  The 
default namespace should be a user's personal namespace - shared and 
other folders are special folders that should live under a specific 
sub-folder.
08/05/2009 10:27:44 AM frank (dot) richter (at) hrz (dot) tu-chemnitz (dot) de Comment #8 Reply to this comment
Take 2 - try this latest patch.  Essentially, it doesn't try to
auto-magically add namespace information.
The same behavior as with the previous patch:

Renaming group.* (namespace '') folder is ok, renaming in INBOX 
namespace is wrong.

I'd like to rename "test" (in INBOX) to "test1",

IMP aks for new name for "test" (not "INBOX.test"), I give "test1"

This leads to:  Rename INBOX.test test1  ->  Permission denied



It's a bit tricky for IMP to detect which namespace a folder should go 
to (if an "empty" namespace '' exists).

An approach might be (pseudo code):



if ($newfolder starts with "non-empty namespace") {

     // INBOX.test1 - should be ok to use $newfolder

} else {

     if ($newfolder doesn't contain delimiter  - '.' im my server) {

         // test1

         $newfolder = defaultnamespace . $newfolder;

     } elseif ($newfolder "starts with existing foldername") {

         // i.e. group.test.test1 ->

         // group.test exists already -> use $newfolder

         // if a user wants to create/rename to INBOX.group.test.test1 
(a rare case IMHO)

         // he has to type INBOX.group.test.test1

     } elseif () {

         // other.folder

         $newfolder defaultnamespace . $newfolder;

     }

}



Frank
08/05/2009 07:48:51 AM Michael Slusarz Comment #7 Reply to this comment
Take 2 - try this latest patch.  Essentially, it doesn't try to 
auto-magically add namespace information.
08/05/2009 07:47:06 AM CVS Commit Comment #6 Reply to this comment
08/05/2009 07:03:08 AM Michael Slusarz Comment #5 Reply to this comment
I knew I had seen this before - this is the same issue as Bug #2874.
08/05/2009 06:47:18 AM frank (dot) richter (at) hrz (dot) tu-chemnitz (dot) de Comment #4 Reply to this comment
Does this patch fix things?
It fixes renaming the "group.*" folders, but breaks renaming folders in INBOX.

Renaming test to test1 (in INBOX) leads to IMAP command

Rename INBOX.test test1  ->  Permission denied



Thanks,

Frank
08/05/2009 03:57:01 AM Michael Slusarz Comment #3
State ⇒ Feedback
Milestone ⇒ 4.3.5
Reply to this comment
Does this patch fix things?
08/05/2009 03:56:39 AM CVS Commit Comment #2 Reply to this comment
08/03/2009 03:31:37 PM Jan Schneider Assigned to Michael Slusarz
State ⇒ Assigned
 
07/31/2009 02:40:14 PM frank (dot) richter (at) hrz (dot) tu-chemnitz (dot) de Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Renaming public folder is wrong
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
Hi,

we have a IMAP server (cyrus) with this namespace:

   NAMESPACE (("INBOX." ".")) (("user." ".")) (("" "."))



We've so-called group mailboxes, aka group.test.folder1

Renaming such a  folder within IMP's folder screen moves this folder 
below user's INBOX, i.e.

   rename group.test.folder1 to group.test.folder2

leads to INBOX.group.test.folder2, but not to group.test.folder2



IMAP command is

    Rename group.test.folder1 INBOX.group.test.folder2



Any help is appreciated.



Regards,

Frank




Saved Queries