|
|
@ -3083,12 +3083,13 @@ class rcube_imap
|
|
|
|
$a_folders = $this->conn->listMailboxes($root, $name,
|
|
|
|
$a_folders = $this->conn->listMailboxes($root, $name,
|
|
|
|
NULL, array('SUBSCRIBED'));
|
|
|
|
NULL, array('SUBSCRIBED'));
|
|
|
|
|
|
|
|
|
|
|
|
// remove non-existent folders
|
|
|
|
// unsubscribe non-existent folders, remove from the list
|
|
|
|
if (is_array($a_folders)) {
|
|
|
|
if (is_array($a_folders) && $name == '*') {
|
|
|
|
foreach ($a_folders as $idx => $folder) {
|
|
|
|
foreach ($a_folders as $idx => $folder) {
|
|
|
|
if ($this->conn->data['LIST'] && ($opts = $this->conn->data['LIST'][$folder])
|
|
|
|
if ($this->conn->data['LIST'] && ($opts = $this->conn->data['LIST'][$folder])
|
|
|
|
&& in_array('\\NonExistent', $opts)
|
|
|
|
&& in_array('\\NonExistent', $opts)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
$this->conn->unsubscribe($folder);
|
|
|
|
unset($a_folders[$idx]);
|
|
|
|
unset($a_folders[$idx]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3097,6 +3098,21 @@ class rcube_imap
|
|
|
|
// retrieve list of folders from IMAP server using LSUB
|
|
|
|
// retrieve list of folders from IMAP server using LSUB
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
$a_folders = $this->conn->listSubscribed($root, $name);
|
|
|
|
$a_folders = $this->conn->listSubscribed($root, $name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// unsubscribe non-existent folders, remove from the list
|
|
|
|
|
|
|
|
if (is_array($a_folders) && $name == '*') {
|
|
|
|
|
|
|
|
foreach ($a_folders as $idx => $folder) {
|
|
|
|
|
|
|
|
if ($this->conn->data['LIST'] && ($opts = $this->conn->data['LIST'][$folder])
|
|
|
|
|
|
|
|
&& in_array('\\Noselect', $opts)
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
// Some servers returns \Noselect for existing folders
|
|
|
|
|
|
|
|
if (!$this->mailbox_exists($folder)) {
|
|
|
|
|
|
|
|
$this->conn->unsubscribe($folder);
|
|
|
|
|
|
|
|
unset($a_folders[$idx]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|