[Tickets #4380] NEW: rename_sentmail_monthly doesdn't check for empty folder name

bugs@bugs.horde.org bugs at bugs.horde.org
Mon Sep 4 08:52:28 PDT 2006


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

Ticket URL: http://bugs.horde.org/ticket/?id=4380
-----------------------------------------------------------------------
 Ticket             | 4380
 Created By         | david-shafer at uiowa.edu
 Summary            | rename_sentmail_monthly doesdn't check for empty folder name
 Queue              | IMP
 Version            | 4.1.2
 Type               | Bug
 State              | Unconfirmed
 Priority           | 3. High
 Owners             | 
-----------------------------------------------------------------------


david-shafer at uiowa.edu (2006-09-04 08:52) wrote:

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().




More information about the bugs mailing list