Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 990dbf0cedc5e7df39833eaf1ef25821 > files > 17

squirrelmail-1.4.8-5.el5_7.13.src.rpm

--- squirrelmail-1.4.8/functions/imap_general.php.orig	2006-07-06 14:39:38.000000000 -0600
+++ squirrelmail-1.4.8/functions/imap_general.php.orig	2011-10-11 14:38:27.662710538 -0600
@@ -511,18 +511,16 @@ function sqimap_login ($username, $passw
             $message .= _("Please contact your system administrator and report this error.");
         } else {
             // Original IMAP login code
-            $query = 'LOGIN';
-            if(sq_is8bit($username)) {
-                $query .= ' {' . strlen($username) . "}\r\n$username";
+            if(sq_is8bit($username) || sq_is8bit($password)) {
+                $query['command'] = 'LOGIN';
+                $query['literal_args'][0] = $username;
+                $query['literal_args'][1] = $password;
+                $read = sqimap_run_literal_command($imap_stream, $query, false, $response, $message);
             } else {
-                $query .= ' "' . quoteimap($username) . '"';
+                $query = 'LOGIN "' . quoteimap($username) . '"'
+                       . ' "' . quoteimap($password) . '"';
+                $read = sqimap_run_command ($imap_stream, $query, false, $response, $message);
             }
-            if(sq_is8bit($password)) {
-                $query .= ' {' . strlen($password) . "}\r\n$password";
-            } else {
-                $query .= ' "' . quoteimap($password) . '"';
-            }
-            $read = sqimap_run_command ($imap_stream, $query, false, $response, $message);
         }
     } elseif ($imap_auth_mech == 'plain') {
         /* Replace this with SASL PLAIN if it ever gets implemented */