|
|
|
@ -204,17 +204,22 @@ class bootstrap
|
|
|
|
|
|
|
|
|
|
$rcmail = rcmail::get_instance();
|
|
|
|
|
$imap = $rcmail->get_storage();
|
|
|
|
|
$no_special = $rcmail->config->get('create_special_folders');
|
|
|
|
|
$got_defaults = $rcmail->config->get('create_default_folders');
|
|
|
|
|
$vendor = $imap->get_vendor();
|
|
|
|
|
|
|
|
|
|
// Note: We do not expect IMAP server auto-creating any folders
|
|
|
|
|
foreach ($imap->list_folders() as $folder) {
|
|
|
|
|
if ($folder != 'INBOX' && (!$no_special || !$imap->is_special_folder($folder))) {
|
|
|
|
|
// Note: GreenMail throws errors when unsubscribing deleted folder
|
|
|
|
|
// We'll ignore that for now
|
|
|
|
|
if ($folder != 'INBOX' && (!$got_defaults || !$imap->is_special_folder($folder))) {
|
|
|
|
|
// GreenMail throws errors when unsubscribing a deleted folder
|
|
|
|
|
if ($vendor == 'greenmail') {
|
|
|
|
|
$imap->conn->deleteFolder($folder);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$imap->delete_folder($folder);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Check IMAP capabilities
|
|
|
|
|