[Tickets #10447] New trash folder gets created in the shared namespace

bugs at horde.org bugs at horde.org
Mon Aug 22 09:23:43 UTC 2011


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

Ticket URL: http://bugs.horde.org/ticket/10447
------------------------------------------------------------------------------
  Ticket             | 10447
  Created By         | Gunnar Wrobel <wrobel at pardus.de>
  Summary            | New trash folder gets created in the shared namespace
  Queue              | IMP
  Version            | 5.0.10
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             |
------------------------------------------------------------------------------


Gunnar Wrobel <wrobel at pardus.de> (2011-08-22 09:23) wrote:

When creating a new "Trash" folder via the preferences IMP fails with  
"Permission denied" as the code tries to create the folder in the  
shared namespace (given that the user does not have the permission to  
create folders there).

On a default Kolab server the users have the personal namespace with  
prefix "INBOX", the other namespace with prefix "user", and the shared  
namespace with no prefix.

When trying to create a new "Trash" folder the code automatically  
selects the shared namespace without prefix as a default. As far as I  
can see there is no method to change this behaviour via a configuration.

My assumption would be that a "Trash" folder would always be created  
in the personal namespace. In fact the method IMP_Mailbox::prefFrom()  
seems to indicate that this is the intended way how it should work. So  
maybe this would be an appropriate fix:


diff --git a/imp/lib/Prefs/Ui.php b/imp/lib/Prefs/Ui.php
index bd69b5c..536bf41 100644
--- a/imp/lib/Prefs/Ui.php
+++ b/imp/lib/Prefs/Ui.php
@@ -1831,7 +1831,7 @@ class IMP_Prefs_Ui
              $folder = IMP_Mailbox::get(substr($folder,  
strlen(self::PREF_SPECIALUSE)));
          } elseif (!empty($new)) {
              $new = Horde_String::convertCharset($new, 'UTF-8', 'UTF7-IMAP');
-            $folder = IMP_Mailbox::get($new)->namespace_append;
+            $folder = IMP_Mailbox::get(IMP_Mailbox::prefFrom($new));
              if (!$folder->create(array('special_use' => array($type)))) {
                  $folder = null;
              }






More information about the bugs mailing list