- Added 'imap_force_caps' option for after-login CAPABILITY checking (#1485750)

release-0.6
alecpl 14 years ago
parent 02e2b43ee3
commit d8c440c03f

@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail CHANGELOG RoundCube Webmail
=========================== ===========================
- Added 'imap_force_caps' option for after-login CAPABILITY checking (#1485750)
- Password: Support dovecotpw encryption - Password: Support dovecotpw encryption
- TinyMCE 3.3.1 - TinyMCE 3.3.1
- Implemented messages copying using drag&drop + SHIFT (#1484086) - Implemented messages copying using drag&drop + SHIFT (#1484086)

@ -75,6 +75,11 @@ $rcmail_config['imap_auth_type'] = null;
$rcmail_config['imap_root'] = null; $rcmail_config['imap_root'] = null;
$rcmail_config['imap_delimiter'] = null; $rcmail_config['imap_delimiter'] = null;
// By default IMAP capabilities are readed after connection to IMAP server
// In some cases, e.g. when using IMAP proxy, there's a need to refresh the list
// after login. Set to True if you've got this case.
$rcmail_config['imap_force_caps'] = false;
// ---------------------------------- // ----------------------------------
// SMTP // SMTP
// ---------------------------------- // ----------------------------------

@ -426,6 +426,7 @@ class rcmail
'delimiter' => isset($_SESSION['imap_delimiter']) ? $_SESSION['imap_delimiter'] : $this->config->get('imap_delimiter'), 'delimiter' => isset($_SESSION['imap_delimiter']) ? $_SESSION['imap_delimiter'] : $this->config->get('imap_delimiter'),
'rootdir' => isset($_SESSION['imap_root']) ? $_SESSION['imap_root'] : $this->config->get('imap_root'), 'rootdir' => isset($_SESSION['imap_root']) ? $_SESSION['imap_root'] : $this->config->get('imap_root'),
'debug_mode' => (bool) $this->config->get('imap_debug', 0), 'debug_mode' => (bool) $this->config->get('imap_debug', 0),
'force_caps' => (bool) $this->config->get('imap_force_caps'),
); );
$this->imap->set_options($options); $this->imap->set_options($options);

@ -389,7 +389,7 @@ function iil_C_GetCapability(&$conn, $name)
return false; return false;
} }
function iil_ClearCapability() function iil_C_ClearCapability($conn)
{ {
$conn->capability = array(); $conn->capability = array();
$conn->capability_readed = false; $conn->capability_readed = false;
@ -550,26 +550,19 @@ function iil_Connect($host, $user, $password, $options=null) {
$iil_error = ''; $iil_error = '';
$iil_errornum = 0; $iil_errornum = 0;
// set some imap options // set options
if (is_array($options)) { if (is_array($options)) {
foreach($options as $optkey => $optval) { $my_prefs = $options;
if ($optkey == 'auth_method') { }
$auth_method = strtoupper($optval); // set auth method
} else if ($optkey == 'rootdir') { if (!empty($my_prefs['auth_method'])) {
$my_prefs['rootdir'] = $optval; $auth_method = strtoupper($my_prefs['auth_method']);
} else if ($optkey == 'delimiter') { } else {
$my_prefs['delimiter'] = $optval;
} else if ($optkey == 'debug_mode') {
$my_prefs['debug_mode'] = $optval;
}
}
}
if (empty($auth_method))
$auth_method = 'CHECK'; $auth_method = 'CHECK';
}
$message = "INITIAL: $auth_method\n"; $message = "INITIAL: $auth_method\n";
$result = false; $result = false;
// initialize connection // initialize connection
@ -579,13 +572,13 @@ function iil_Connect($host, $user, $password, $options=null) {
$conn->selected = ''; $conn->selected = '';
$conn->user = $user; $conn->user = $user;
$conn->host = $host; $conn->host = $host;
if ($my_prefs['sort_field'] == 'INTERNALDATE') { if ($my_prefs['sort_field'] == 'INTERNALDATE') {
$IMAP_USE_INTERNAL_DATE = true; $IMAP_USE_INTERNAL_DATE = true;
} else if ($my_prefs['sort_field'] == 'DATE') { } else if ($my_prefs['sort_field'] == 'DATE') {
$IMAP_USE_INTERNAL_DATE = false; $IMAP_USE_INTERNAL_DATE = false;
} }
//check input //check input
if (empty($host)) { if (empty($host)) {
$iil_error = "Empty host"; $iil_error = "Empty host";
@ -660,7 +653,7 @@ function iil_Connect($host, $user, $password, $options=null) {
} }
// Now we're authenticated, capabilities need to be reread // Now we're authenticated, capabilities need to be reread
iil_ClearCapability(); iil_C_ClearCapability($conn);
} }
} }
@ -705,6 +698,9 @@ function iil_Connect($host, $user, $password, $options=null) {
} }
if (is_resource($result)) { if (is_resource($result)) {
if ($my_prefs['force_caps']) {
iil_C_ClearCapability($conn);
}
iil_C_Namespace($conn); iil_C_Namespace($conn);
return $conn; return $conn;
} else { } else {

Loading…
Cancel
Save