6.0.0-beta1
7/13/25

[#7745] The folder "sent-mail" already exists
Summary The folder "sent-mail" already exists
Queue IMP
Queue Version 4.3
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester voyager (at) centrum (dot) cz
Created 12/01/2008 (6068 days ago)
Due
Updated 01/13/2010 (5660 days ago)
Assigned 02/23/2009 (5984 days ago)
Resolved 03/11/2009 (5968 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/11/2009 08:53:51 AM Jan Schneider State ⇒ Resolved
 
03/11/2009 08:35:40 AM rsalmon (at) mbpgroup (dot) com Comment #26 Reply to this comment
Appears to be a cache issue.  Do these fixes help?  Note: CVS fix is
different from the Git fix
(http://lists.horde.org/archives/commits/2009-March/000663.html).
After patching imp-cvs and imp-git, they both work as expected. This 
bug is fixed here.

Thanks a lot.
03/10/2009 09:12:44 PM Michael Slusarz Comment #25 Reply to this comment
Appears to be a cache issue.  Do these fixes help?  Note: CVS fix is 
different from the Git fix 
(http://lists.horde.org/archives/commits/2009-March/000663.html).
03/05/2009 01:23:10 PM rsalmon (at) mbpgroup (dot) com Comment #23 Reply to this comment
I noticed as well that, before calling getPollList, INBOX.Sent-02-2009 
appears in arrays _parent:protected and _tree:protected (which is the 
expected behaviour I guess) but not in array _fulllist:protected.


03/05/2009 11:21:58 AM rsalmon (at) mbpgroup (dot) com Comment #22
New Attachment: log_imaptree.txt Download
Reply to this comment

[Show Quoted Text - 10 lines]
patched like this :

+ Horde::logMessage(print_r($imaptree,true), __FILE__, __LINE__, 
PEAR_LOG_ERR);

$flist = $imaptree->getPollList(true, true);

+ Horde::logMessage(print_r($imaptree,true), __FILE__, __LINE__, 
PEAR_LOG_ERR);





Sent disappear in  _parent:protected but still there in 
_fulllist:protected before calling $flist = 
$imaptree->getPollList(true, true);

Sent reappear everywhere after calling getPollList.



See attached log file. Log file contains login and running maintenance.




03/05/2009 12:00:49 AM Michael Slusarz Comment #21 Reply to this comment
In IMP_Search::createVINBOXFolder(), can you put print_r($imaptree) 
statements around getPollList(), i.e.:



/* Create Virtual INBOX with nav_poll list. Filter out any nav_poll

  * entries that don't exist. Sort the list also. */

print_r($imaptree);

$flist = $imaptree->getPollList(true, true);

print_r($imaptree);



And see if the sent folder is reappearing in $imaptree after this call.
03/03/2009 08:38:39 AM rsalmon (at) mbpgroup (dot) com Comment #20 Reply to this comment
Do you see this if both virtual inbox and virtual trash are disabled?
Yes! setting $_prefs['use_vinbox']['value'] to 0  and
$_prefs['use_vinbox']['value'] to 0 (or 1) solves the problem on both
imp-git and the old imp-cvs.
I'm not clear on what you mean here.  Are you saying that if you turn
Virtual Inbox off, this is fixed?
I was so happy to see this working that I didn't re-read before posting.

If Virtual Inbox is off, no matter what Virtual Trash is set to 
(on/off),  this is fixed using both version of imp, old cvs and latest 
git.






03/02/2009 08:30:39 PM Michael Slusarz Comment #19 Reply to this comment
Do you see this if both virtual inbox and virtual trash are disabled?
Yes! setting $_prefs['use_vinbox']['value'] to 0  and
$_prefs['use_vinbox']['value'] to 0 (or 1) solves the problem on both
imp-git and the old imp-cvs.
I'm not clear on what you mean here.  Are you saying that if you turn 
Virtual Inbox off, this is fixed?
02/24/2009 04:01:27 PM rsalmon (at) mbpgroup (dot) com Comment #18 Reply to this comment
Do you see this if both virtual inbox and virtual trash are disabled?
Yes! setting $_prefs['use_vinbox']['value'] to 0  and 
$_prefs['use_vinbox']['value'] to 0 (or 1) solves the problem on both 
imp-git and the old imp-cvs.






02/23/2009 08:03:37 AM Michael Slusarz Comment #17
State ⇒ Feedback
Reply to this comment
Do you see this if both virtual inbox and virtual trash are disabled?   
  You may want to debug IMP_Folder::_onDelete() because IMP_IMAP_Tree 
is manipulated by various functions called in there also.
02/12/2009 08:18:52 AM voyager (at) centrum (dot) cz Comment #16 Reply to this comment
I have Debian 3.1 with php 4.3.10
02/10/2009 05:06:19 PM ericr (at) horde (dot) org Comment #15 Reply to this comment
For the record, also not running PHP 4 (was seeing it with PHP 5.1).
02/09/2009 10:23:03 AM rsalmon (at) mbpgroup (dot) com Comment #14
New Attachment: config.tgz Download
Reply to this comment
We use courier-imap. Is anyone having this problem using the same
IMAP server ?
I've just tried with dovecot 1.0-0.beta8.3.fc5 (not the latest I know) 
and I get the same behaviour :-(

I deleted the user's pref before testing :

mysql> delete from horde_prefs where pref_uid='ronan';

login into horde, logout, then

mysql> update horde_prefs set pref_value='1230048685' where 
pref_uid='ronan' and pref_name ='last_maintenance';





I've attached horde and imp-git config files. Can someone reproduce 
with those config files ?






02/09/2009 09:21:25 AM rsalmon (at) mbpgroup (dot) com Comment #13 Reply to this comment
The people seeing this wouldn't happen to be running PHP 4, are they?
php 5.2.6 and 5.2.5.

OS : Fedora
02/09/2009 08:32:57 AM Michael Slusarz Comment #12 Reply to this comment
The people seeing this wouldn't happen to be running PHP 4, are they?
02/09/2009 08:15:08 AM rsalmon (at) mbpgroup (dot) com Comment #11 Reply to this comment
We use courier-imap. Is anyone having this problem using the same IMAP 
server ?
01/26/2009 11:44:21 AM rsalmon (at) mbpgroup (dot) com Comment #10 Reply to this comment
I've just tried with IMP git and I still get the same problem.


01/24/2009 04:08:15 PM Chuck Hagenbuch Comment #9
Assigned to Michael Slusarz
State ⇒ Assigned
Reply to this comment
Michael, if this isn't enough to reproduce it, I'm not sure what we 
gain by the ticket remaining open.
01/07/2009 02:45:14 PM rsalmon (at) mbpgroup (dot) com Comment #8 Reply to this comment
I forgot to mention that after running IMP_Folder::rename, the Sent 
folder doesn't exist on the IMAP server. So, on the server, the Sent 
folder has been renamed as Sent-12-2008.


01/07/2009 02:41:31 PM rsalmon (at) mbpgroup (dot) com Comment #7 Reply to this comment
I've modified Folder.php and Tree.php :

--- Folder.php.org        2009-01-07 15:31:15.000000000 +0100

+++ Folder.php        2009-01-07 15:28:36.000000000 +0100

@@ -401,12 +401,12 @@

                  imap_subscribe($imp_imap->stream(), $server . $folder_new);

              }

          }

-

+        $GLOBALS['notification']->push(__FILE__ . ' line ' . __LINE__ . ' ' 
. print_r($imaptree->_parent,true));

          if (!empty($deleted)) {

              $imaptree->rename($deleted, $inserted);

              $this->_onDelete($deleted);

          }

-

+        $GLOBALS['notification']->push(__FILE__ . ' line ' . __LINE__ . ' ' 
. print_r($imaptree->_parent,true));

          return true;

      }



--- Tree.php.org        2009-01-07 15:31:16.000000000 +0100

+++ Tree.php        2009-01-07 15:29:18.000000000 +0100

@@ -1691,7 +1691,8 @@

       */

      function rename($old, $new)

      {

-        foreach ($old as $key => $val) {

+         $GLOBALS['notification']->push(__FILE__ . ' line ' . __LINE__ . ' ' 
. print_r($this->_parent,true));

+       foreach ($old as $key => $val) {

              $polled = (isset($this->_tree[$val])) ? 
$this->isPolled($this->_tree[$val]) : false;

              if ($this->delete($val)) {

                  $this->insert($new[$key]);

@@ -1700,7 +1701,8 @@

                  }

              }

          }

-    }

+         $GLOBALS['notification']->push(__FILE__ . ' line ' . __LINE__ . ' ' 
. print_r($this->_parent,true));

+   }





This is what I get :



/var/www/html/horde/imp/lib/Folder.php line 404 Array

(

     [%] => Array

         (

             [0] => INBOX

             [1] => INBOX.Brouillon

             [2] => INBOX.Sent

             [3] => INBOX.Sent-07-2008

             [4] => INBOX.Sent-08-2008

             [5] => INBOX.Sent-09-2008

             [6] => INBOX.Sent-10-2008

             [7] => INBOX.Sent-nov-2008

             [8] => INBOX.ShareRonan

             [9] => INBOX.Spam

             [10] => INBOX.Trash

             [11] => Dossiers partagés%

             [12] => Dossiers virtuels%

         )



     [Dossiers virtuels%] => Array

         (

             [0] => **search_ff9dsrqr8m0c8kcw4084

         )



)



/var/www/html/horde/imp/lib/IMAP/Tree.php line 1694 Array

(

     [%] => Array

         (

             [0] => INBOX

             [1] => INBOX.Brouillon

             [2] => INBOX.Sent

             [3] => INBOX.Sent-07-2008

             [4] => INBOX.Sent-08-2008

             [5] => INBOX.Sent-09-2008

             [6] => INBOX.Sent-10-2008

             [7] => INBOX.Sent-nov-2008

             [8] => INBOX.ShareRonan

             [9] => INBOX.Spam

             [10] => INBOX.Trash

             [11] => Dossiers partagés%

             [12] => Dossiers virtuels%

         )



     [Dossiers virtuels%] => Array

         (

             [0] => **search_ff9dsrqr8m0c8kcw4084

         )



)



/var/www/html/horde/imp/lib/IMAP/Tree.php line 1704 Array

(

     [%] => Array

         (

             [0] => INBOX

             [1] => INBOX.Brouillon

             [2] => INBOX.Sent-07-2008

             [3] => INBOX.Sent-08-2008

             [4] => INBOX.Sent-09-2008

             [5] => INBOX.Sent-10-2008

             [6] => INBOX.Sent-nov-2008

             [7] => INBOX.ShareRonan

             [8] => INBOX.Spam

             [9] => INBOX.Trash

             [10] => Dossiers partagés%

             [11] => Dossiers virtuels%

             [12] => INBOX.Sent-12-2008

         )



     [Dossiers virtuels%] => Array

         (

             [0] => **search_ff9dsrqr8m0c8kcw4084

         )



)



/var/www/html/horde/imp/lib/Folder.php line 409 Array

(

     [%] => Array

         (

             [0] => INBOX

             [1] => INBOX.Brouillon

             [2] => INBOX.Sent

             [3] => INBOX.Sent-07-2008

             [4] => INBOX.Sent-08-2008

             [5] => INBOX.Sent-09-2008

             [6] => INBOX.Sent-10-2008

             [7] => INBOX.Sent-12-2008

             [8] => INBOX.Sent-nov-2008

             [9] => INBOX.ShareRonan

             [10] => INBOX.Spam

             [11] => INBOX.Trash

             [12] => Dossiers partagés%

             [13] => Dossiers virtuels%

         )



     [Dossiers virtuels%] => Array

         (

             [0] => **search_ff9dsrqr8m0c8kcw4084

         )



)



I can't find out why folder INBOX.Sent is gone from the tree at the 
end of function IMP_Tree::rename (which is the expected behaviour) and 
is back at the end of function IMP_Folder::rename!






01/07/2009 10:25:57 AM rsalmon (at) mbpgroup (dot) com Comment #6 Reply to this comment
People are still seeing this, but again - someone will have to debug
for themselves since none of the devs can reproduce.  I don't have
any specific pointers on how to debug either - you're just going to
have to trace the code and related data structures (i.e. IMP_Tree) to
see where the error resides.
With the following imp's settings :

$conf['server']['cache_folders'] = false;

$conf['server']['cachejs'] = 'none';

$conf['server']['cachecss'] = 'none';

$conf['msgcache']['use_msgcache'] = false;

$conf['mlistcache']['use_mlistcache'] = false;



If $_prefs['subscribe']['value']  is set to  1, maintenance works perfectly.

If $_prefs['subscribe']['value']  is set to  0, I get 'The folder 
"sent-mail" already exists'.



Can someone reproduce this as well ?






01/06/2009 08:49:52 PM Michael Slusarz Comment #5
State ⇒ Feedback
Reply to this comment
People are still seeing this, but again - someone will have to debug 
for themselves since none of the devs can reproduce.  I don't have any 
specific pointers on how to debug either - you're just going to have 
to trace the code and related data structures (i.e. IMP_Tree) to see 
where the error resides.
01/05/2009 09:26:14 AM voyager (at) centrum (dot) cz Comment #4 Reply to this comment
New month, same problem :( I have about 200 mailboxes but only some of 
them doing this. I have no idea why. It started after upgrading to 
Horde 3.3 and IMP4.3
12/23/2008 04:18:55 PM rsalmon (at) mbpgroup (dot) com Comment #3 Reply to this comment
I can't reproduce.  It most likely has something to do with the fact
that the old mailbox is not being removed from the IMP_Tree object
correctly (since exists() uses that object to check for existence),
but I can't reproduce this so someone who sees this will have to
debug.
I do get this as well. As soon as I login I get :

-   The current folder(s) "Sent" will be renamed to "Sent-nov-2008".

-   All old linked attachments more than 6 months old will be deleted.



After selecting both options, and clicking on "perform maintenance", I 
get the following messages :

# Sent folder being renamed at the start of the month.

# Success The folder "Sent" was successfully renamed to "Sent-nov-2008".

# Warning The folder "Sent" already exists



The Sent folder is visible in the folder tree nav bar but doesn't 
exist on the server.



From the Folder Navigator screen, I select "Rebuild Folder Tree" and 
the 'Sent' folder disappear from the folder tree nav bar as expected.



I can reproduce the same bug doing this :

- rename "Sent-nov-2008" to "Sent" from IMP

- logout

- set pref "last_maintenance" to "1226660810".

- login + maintenance

->  # Warning The folder "Sent" already exists



we use latest cvs version and courier-imap-4.3.0 and imp pref 'subscribe' = 0



I don't mind debugging but I don't know where to start. Any ideas?




12/22/2008 03:06:26 AM Chuck Hagenbuch State ⇒ No Feedback
 
12/07/2008 07:59:00 PM Michael Slusarz Comment #2
State ⇒ Feedback
Reply to this comment

[Show Quoted Text - 12 lines]
I can't reproduce.  It most likely has something to do with the fact 
that the old mailbox is not being removed from the IMP_Tree object 
correctly (since exists() uses that object to check for existence), 
but I can't reproduce this so someone who sees this will have to debug.
12/01/2008 04:12:30 PM voyager (at) centrum (dot) cz Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ The folder "sent-mail" already exists
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
I have maintenance enabled to rename the sent-mail folder at the beginning

of the month, but it will display after maintenance



- sent-mail folder being renamed at the start of the month.

- The folder "sent-mail" was successfully renamed to "sent-mail-11-2008".

- The folder "sent-mail" already exists



in the left menu "sent-mail" really exists but after sending new email 
it says Message sent successfully, but not saved to sent-mail. When I 
reload page sent-mail folder disappear then I must logout and login to 
Horde and send new mail, the sent-mail will then create again and 
works correctly.

Saved Queries