Changeset d6584f7 in github


Ignore:
Timestamp:
Jan 19, 2010 8:17:48 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
a7dba854
Parents:
638fb8a
Message:
  • Use PLAIN auth when CRAM fails and imap_auth_type='check' (#1486371)
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r96b679d rd6584f7  
    22=========================== 
    33 
     4- Use PLAIN auth when CRAM fails and imap_auth_type='check' (#1486371) 
    45- Fix removal of <title> tag from HTML messages (#1486432) 
    56- Fix 'force_https' to specified port when URL contains a port number (#1486411) 
  • program/lib/imap.inc

    raa16b4a rd6584f7  
    648648        } 
    649649 
    650         $conn->message .= $line . "\n"; 
     650        $conn->message .= $line; 
    651651 
    652652        // TLS connection 
     
    673673        } 
    674674 
     675        $orig_method = $auth_method; 
     676 
    675677        if ($auth_method == 'CHECK') { 
    676                 //check for supported auth methods 
     678                // check for supported auth methods 
    677679                if (iil_C_GetCapability($conn, 'AUTH=CRAM-MD5') || iil_C_GetCapability($conn, 'AUTH=CRAM_MD5')) { 
    678680                        $auth_method = 'AUTH'; 
    679681                } 
    680682                else { 
    681                         //default to plain text auth 
     683                        // default to plain text auth 
    682684                        $auth_method = 'PLAIN'; 
    683685                } 
     
    685687 
    686688        if ($auth_method == 'AUTH') { 
    687                 //do CRAM-MD5 authentication 
     689                // do CRAM-MD5 authentication 
    688690                iil_PutLine($conn->fp, "a000 AUTHENTICATE CRAM-MD5"); 
    689691                $line = trim(iil_ReadLine($conn->fp, 1024)); 
    690692 
    691693                if ($line[0] == '+') { 
    692                         //got a challenge string, try CRAM-5 
     694                        // got a challenge string, try CRAM-MD5 
    693695                        $result = iil_C_Authenticate($conn, $user, $password, substr($line,2)); 
    694696                         
    695697                        // stop if server sent BYE response 
    696                         if($result == -3) { 
     698                        if ($result == -3) { 
    697699                                $iil_error = $conn->error; 
    698700                                $iil_errornum = $conn->errorNum; 
    699701                                return false; 
    700702                        } 
    701                         $conn->message .= "AUTH CRAM-MD5: $result\n"; 
    702                 } else { 
    703                         $conn->message .= "AUTH CRAM-MD5: failed\n"; 
     703                } 
     704                 
     705                if (!is_resource($result) && $orig_method == 'CHECK') { 
    704706                        $auth_method = 'PLAIN'; 
    705707                } 
    706708        } 
    707709                 
    708         if (!$result || $auth_method == 'PLAIN') { 
    709                 //do plain text auth 
     710        if ($auth_method == 'PLAIN') { 
     711                // do plain text auth 
    710712                $result = iil_C_Login($conn, $user, $password); 
    711                 $conn->message .= "AUTH PLAIN: $result\n"; 
    712         } 
    713                  
    714         if (!is_int($result)) { 
     713        } 
     714 
     715        if (is_resource($result)) { 
    715716                iil_C_Namespace($conn); 
    716717                return $conn; 
Note: See TracChangeset for help on using the changeset viewer.