6.0.0-beta1
7/7/25

[#4380] rename_sentmail_monthly doesdn't check for empty folder name
Summary rename_sentmail_monthly doesdn't check for empty folder name
Queue IMP
Queue Version 4.1.2
Type Bug
State Resolved
Priority 3. High
Owners Horde Developers (at) , chuck (at) horde (dot) org
Requester david-shafer (at) uiowa (dot) edu
Created 09/04/2006 (6881 days ago)
Due
Updated 09/05/2006 (6880 days ago)
Assigned 09/05/2006 (6880 days ago)
Resolved 09/05/2006 (6880 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
09/05/2006 03:47:35 AM Chuck Hagenbuch Comment #2
State ⇒ Resolved
Reply to this comment
Done in HEAD and FW_3 for getAllSentmailFolders() and IMP_Folder::rename().
09/05/2006 12:52:21 AM Chuck Hagenbuch Assigned to Chuck Hagenbuch
Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
09/04/2006 03:52:28 PM david-shafer (at) uiowa (dot) edu Comment #1
State ⇒ Unconfirmed
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ rename_sentmail_monthly doesdn't check for empty folder name
Queue ⇒ IMP
Reply to this comment
In lib/Identity/imp.php, the getAllSentmailfolders() function doesn't 
check for empty strings:



include_once 'Horde/Identity.php';

$identity = &Identity::singleton(array('imp', 'imp'));

$folder_list = $identity->getAllSentmailfolders();

var_dump($folder_list);



array(1) {

   [0]=>

   string(0) ""

}



This especially becomes a problem with the rename_sentmail_monthly 
task. If a user has set the sent mail folder for an identity to 
"None", they are prompted with this:



The current folder(s) "" will be renamed to "".



If the user confirms the task, the resulting call to rename() 
effectively traverses the entire IMAP server. The rename() function 
searches for all folders matching $old . $namespace_info['delimiter'] 
. '*'. If $old == "" and the delimiter is '/', it results in a listing 
for '/*'. On a wu-imapd server, this causes a complete traversal of 
the IMAP server from the root filesystem.



Rather than try to rename an empty folder name, it seems like the 
correct behavior would be to catch empty strings in some/all of 
Identity_imp::getAllSentmailfolders(), IMP_Folder::rename(), and 
Maintenance_Task_rename_sentmail_monthly::doMaintenance().

Saved Queries