Changeset 2388 in subversion
- Timestamp:
- Apr 14, 2009 3:35:12 AM (4 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/rcmail.php (modified) (1 diff)
-
program/lib/imap.inc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r2385 r2388 2 2 =========================== 3 3 4 - Support STARTTLS in IMAP connection (#1485284) 4 5 - Fix DEL key problem in search boxes (#1485528) 5 6 - Support several e-mail addresses per user from virtuser_file (#1485678) -
trunk/roundcubemail/config/main.inc.php.dist
r2338 r2388 52 52 // leave blank to show a textbox at login, give a list of hosts 53 53 // to display a pulldown menu or set one host as string. 54 // To use SSL connection, enter ssl://hostname:99354 // To use SSL/TLS connection, enter hostname with prefix ssl:// or tls:// 55 55 $rcmail_config['default_host'] = ''; 56 56 -
trunk/roundcubemail/program/include/rcmail.php
r2384 r2388 437 437 $host = $a_host['host']; 438 438 $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null; 439 $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $config['default_port']); 440 } 441 else 442 $imap_port = $config['default_port']; 443 439 if(!empty($a_host['port'])) 440 $imap_port = $a_host['port']; 441 else if ($imap_ssl && $imap_ssl != 'tls') 442 $imap_port = 993; 443 } 444 445 $imap_port = $imap_port ? $imap_port : $config['default_port']; 444 446 445 447 /* Modify username with domain if required -
trunk/roundcubemail/program/lib/imap.inc
r2378 r2388 336 336 if ($bye && strncmp($string, '* BYE ', 6) == 0) { 337 337 return true; 338 338 339 } 339 340 return false; … … 382 383 383 384 return false; 385 } 386 387 function iil_C_ClearCapability(&$conn) 388 { 389 $conn->capability = array(); 390 $conn->capability_readed = false; 384 391 } 385 392 … … 565 572 $result = false; 566 573 567 // initialize connection574 // initialize connection 568 575 $conn = new iilConnection; 569 576 $conn->error = ''; … … 599 606 return false; 600 607 } 608 601 609 if (!$ICL_PORT) { 602 610 $ICL_PORT = 143; 603 611 } 604 605 612 //check for SSL 606 if ($ICL_SSL ) {613 if ($ICL_SSL && $ICL_SSL != 'tls') { 607 614 $host = $ICL_SSL . '://' . $host; 608 615 } 609 610 //open socket connection 616 611 617 $conn->fp = fsockopen($host, $ICL_PORT, $errno, $errstr, 10); 612 618 if (!$conn->fp) { … … 625 631 626 632 $conn->message .= $line; 633 634 // TLS connection 635 if ($ICL_SSL == 'tls' && iil_C_GetCapability($conn, 'STARTTLS')) { 636 if (version_compare(PHP_VERSION, '5.1.0', '>=')) { 637 iil_PutLine($conn->fp, 'stls000 STARTTLS'); 638 639 $line = iil_ReadLine($conn->fp, 4096); 640 if (!iil_StartsWith($line, 'stls000 OK')) { 641 $iil_error = "Server responded to STARTTLS with: $line"; 642 $iil_errornum = -2; 643 return false; 644 } 645 646 if (!stream_socket_enable_crypto($conn->fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { 647 $iil_error = "Unable to negotiate TLS"; 648 $iil_errornum = -2; 649 return false; 650 } 651 652 // Now we're authenticated, capabilities need to be reread 653 iil_C_ClearCapability($conn); 654 } 655 } 627 656 628 657 if (strcasecmp($auth_method, "check") == 0) {
Note: See TracChangeset
for help on using the changeset viewer.
