summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-10-22 19:25:00 +0000
committeralecpl <alec@alec.pl>2010-10-22 19:25:00 +0000
commita1fe6bd11d7afb8ddd42d1fe465a6d2d93b51592 (patch)
treecb4163894257d61ce255ece895d5af1f36b6a81a
parent63d4d61148cdaac48973baea2ab783d3e965a9c2 (diff)
- Add support for IMAP proxy authentication (#1486690)
-rw-r--r--CHANGELOG3
-rw-r--r--config/main.inc.php.dist8
-rw-r--r--program/include/rcmail.php2
-rw-r--r--program/include/rcube_imap_generic.php11
4 files changed, 21 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index edbbc33f1..215c2109c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -44,7 +44,8 @@ CHANGELOG Roundcube Webmail
- Add SASL-IR support in IMAP (RFC 4959)
- Add LOGINDISABLED support (RFC 2595)
- Add support for AUTH=PLAIN in IMAP authentication
-- Re-implemented SMTP proxy authorization support
+- Re-implemented SMTP proxy authentication support
+- Add support for IMAP proxy authentication (#1486690)
RELEASE 0.4.2
-------------
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index 60a87f73c..9579c0d0f 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -87,6 +87,12 @@ $rcmail_config['imap_force_caps'] = false;
// IMAP connection timeout, in seconds. Default: 0 (no limit)
$rcmail_config['imap_timeout'] = 0;
+// Optional IMAP authentication identifier to be used as authorization proxy
+$rcmail_config['imap_auth_cid'] = null;
+
+// Optional IMAP authentication password to be used for imap_auth_cid
+$rcmail_config['imap_auth_pw'] = null;
+
// ----------------------------------
// SMTP
// ----------------------------------
@@ -120,7 +126,7 @@ $rcmail_config['smtp_auth_type'] = '';
// Optional SMTP authentication identifier to be used as authorization proxy
$rcmail_config['smtp_auth_cid'] = null;
-// Optional SMTP authorization password to be used for smtp_auth_cid
+// Optional SMTP authentication password to be used for smtp_auth_cid
$rcmail_config['smtp_auth_pw'] = null;
// SMTP HELO host
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index a26ad809c..c7ba41935 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -501,6 +501,8 @@ class rcmail
// can save time detecting them using NAMESPACE and LIST
$options = array(
'auth_method' => $this->config->get('imap_auth_type', 'check'),
+ 'auth_cid' => $this->config->get('imap_auth_cid'),
+ 'auth_pw' => $this->config->get('imap_auth_pw'),
'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'),
'debug_mode' => (bool) $this->config->get('imap_debug', 0),
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 67d71f619..4211cca44 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -420,7 +420,16 @@ class rcube_imap_generic
}
}
else { // PLAIN
- $reply = base64_encode($user . chr(0) . $user . chr(0) . $pass);
+ // proxy authentication
+ if (!empty($this->prefs['auth_cid'])) {
+ $authc = $this->prefs['auth_cid'];
+ $pass = $this->prefs['auth_pw'];
+ }
+ else {
+ $authc = $user;
+ }
+
+ $reply = base64_encode($user . chr(0) . $authc . chr(0) . $pass);
// RFC 4959 (SASL-IR): save one round trip
if ($this->getCapability('SASL-IR')) {