Support 'greenmail' as an imap vendor label, don't call ID when not supported

pull/7186/head
Aleksander Machniak 4 years ago
parent 4258acf57f
commit c138567ab5

@ -631,7 +631,7 @@ class rcube_imap extends rcube_storage
return;
}
if (($ident = $this->conn->data['ID']) === null) {
if (($ident = $this->conn->data['ID']) === null && $this->get_capability('ID')) {
$ident = $this->conn->id(array(
'name' => 'Roundcube',
'version' => RCUBE_VERSION,
@ -642,7 +642,7 @@ class rcube_imap extends rcube_storage
$vendor = (string) (!empty($ident) ? $ident['name'] : '');
$ident = strtolower($vendor . ' ' . $this->conn->data['GREETING']);
$vendors = array('cyrus', 'dovecot', 'uw-imap', 'gimap', 'hmail');
$vendors = array('cyrus', 'dovecot', 'uw-imap', 'gimap', 'hmail', 'greenmail');
foreach ($vendors as $v) {
if (strpos($ident, $v) !== false) {

@ -202,10 +202,15 @@ class bootstrap
rcube::raise_error(__METHOD__ . ': IMAP connection unavailable', false, true);
}
$imap = rcmail::get_instance()->get_storage();
$rcmail = rcmail::get_instance();
$imap = $rcmail->get_storage();
$no_special = $rcmail->config->get('create_special_folders');
// Note: We do not expect IMAP server auto-creating any folders
foreach ($imap->list_folders() as $folder) {
if (!$imap->is_special_folder($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
$imap->delete_folder($folder);
}
}

Loading…
Cancel
Save