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 |
State ⇒ Resolved
Assigned to
State ⇒ Assigned
State ⇒ Unconfirmed
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ rename_sentmail_monthly doesdn't check for empty folder name
Queue ⇒ IMP
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().