Skip to content

Commit

Permalink
Add option imap_force_ns to make buggy servers support optional
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed May 21, 2012
1 parent e95f13e commit 3c5489b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
4 changes: 4 additions & 0 deletions config/main.inc.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ $rcmail_config['imap_force_caps'] = false;
// Enable this option to force LSUB command usage instead.
$rcmail_config['imap_force_lsub'] = false;

// Some server configurations (e.g. Courier) doesn't list folders in all namespaces
// Enable this option to force listing of folders in all namespaces
$rcmail_config['imap_force_ns'] = false;

// IMAP connection timeout, in seconds. Default: 0 (no limit)
$rcmail_config['imap_timeout'] = 0;

Expand Down
4 changes: 2 additions & 2 deletions plugins/subscriptions_option/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<email>ziba@umich.edu</email>
<active>yes</active>
</developer>
<date>2012-03-05</date>
<date>2012-05-21</date>
<version>
<release>1.2</release>
<release>1.3</release>
<api>1.1</api>
</version>
<stability>
Expand Down
7 changes: 2 additions & 5 deletions plugins/subscriptions_option/subscriptions_option.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ function save_prefs($args)

function mailboxes_list($args)
{
$rcmail = rcmail::get_instance();
$rcmail = rcmail::get_instance();
if (!$rcmail->config->get('use_subscriptions', true)) {
$storage = $rcmail->get_storage();
if ($storage->check_connection()) {
$args['folders'] = $storage->conn->listMailboxes($args['root'], $args['name']);
}
$args['folders'] = $rcmail->get_storage()->list_folders_direct();
}
return $args;
}
Expand Down
14 changes: 4 additions & 10 deletions program/include/rcube_imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2539,11 +2539,8 @@ public function list_folders_subscribed_direct($root='', $name='*')
return array();
}

// #1486796: some server configurations doesn't
// return folders in all namespaces, we'll try to detect that situation
// and ask for these namespaces separately
// @TODO: make this optional
if ($root == '' && $name == '*') {
// #1486796: some server configurations doesn't return folders in all namespaces
if ($root == '' && $name == '*' && $config->get('imap_force_ns')) {
$this->list_folders_update($a_folders, ($list_extended ? 'ext-' : '') . 'subscribed');
}

Expand Down Expand Up @@ -2673,11 +2670,8 @@ public function list_folders_direct($root='', $name='*')
return array();
}

// #1486796: some server configurations doesn't
// return folders in all namespaces, we'll try to detect that situation
// and ask for these namespaces separately
// @TODO: make this optional
if ($root == '' && $name == '*') {
// #1486796: some server configurations doesn't return folders in all namespaces
if ($root == '' && $name == '*' && $config->get('imap_force_ns')) {
$this->list_folders_update($result);
}

Expand Down

0 comments on commit 3c5489b

Please sign in to comment.