[Svn] r4124 - in trunk/roundcubemail: . config program/include

trac at roundcube.net trac at roundcube.net
Fri Oct 22 21:25:00 CEST 2010


Author: alec
Date: 2010-10-22 14:25:00 -0500 (Fri, 22 Oct 2010)
New Revision: 4124

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/config/main.inc.php.dist
   trunk/roundcubemail/program/include/rcmail.php
   trunk/roundcubemail/program/include/rcube_imap_generic.php
Log:
- Add support for IMAP proxy authentication (#1486690)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-10-22 19:16:45 UTC (rev 4123)
+++ trunk/roundcubemail/CHANGELOG	2010-10-22 19:25:00 UTC (rev 4124)
@@ -44,7 +44,8 @@
 - 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
 -------------

Modified: trunk/roundcubemail/config/main.inc.php.dist
===================================================================
--- trunk/roundcubemail/config/main.inc.php.dist	2010-10-22 19:16:45 UTC (rev 4123)
+++ trunk/roundcubemail/config/main.inc.php.dist	2010-10-22 19:25:00 UTC (rev 4124)
@@ -87,6 +87,12 @@
 // 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 @@
 // 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 

Modified: trunk/roundcubemail/program/include/rcmail.php
===================================================================
--- trunk/roundcubemail/program/include/rcmail.php	2010-10-22 19:16:45 UTC (rev 4123)
+++ trunk/roundcubemail/program/include/rcmail.php	2010-10-22 19:25:00 UTC (rev 4124)
@@ -501,6 +501,8 @@
     // 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),

Modified: trunk/roundcubemail/program/include/rcube_imap_generic.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap_generic.php	2010-10-22 19:16:45 UTC (rev 4123)
+++ trunk/roundcubemail/program/include/rcube_imap_generic.php	2010-10-22 19:25:00 UTC (rev 4124)
@@ -420,8 +420,17 @@
             }
         }
         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')) {
                 $result = $this->execute("AUTHENTICATE PLAIN", array($reply), self::COMMAND_NORESPONSE);

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list