Add new login_before_page_header (boolean) hook; allows plugins to have more explicit...
[squirrelmail.git] / src / configtest.php
index 3ce6539065c92a733cbf30b2063fc79e0bedb49d..92a50484da709ce2acc3ac58c1aa8af9534e563a 100644 (file)
@@ -120,6 +120,9 @@ if (file_exists(SM_PATH . 'config/config_local.php')) {
     require(SM_PATH . 'config/config_local.php');
 }
 
+sqGetGlobalVar('REMOTE_ADDR',$client_ip,SQ_SERVER);
+sqGetGlobalVar('SERVER_ADDR',$server_ip,SQ_SERVER);
+
 /**
  * Include Compatibility plugin if available.
  */
@@ -175,8 +178,6 @@ if(!in_array('strings.php', $included)) {
 
 /* Block remote use of script */
 if (! $allow_remote_configtest) {
-    sqGetGlobalVar('REMOTE_ADDR',$client_ip,SQ_SERVER);
-    sqGetGlobalVar('SERVER_ADDR',$server_ip,SQ_SERVER);
 
     if ((! isset($client_ip) || $client_ip!='127.0.0.1') &&
             (! isset($client_ip) || ! isset($server_ip) || $client_ip!=$server_ip)) {
@@ -631,7 +632,10 @@ if($useSendmail) {
 
     echo $IND . "sendmail OK<br />\n";
 } else {
-    $stream = fsockopen( ($use_smtp_tls==1?'tls://':'').$smtpServerAddress, $smtpPort,
+    // NB: Using "ssl://" ensures the highest possible TLS version
+    // will be negotiated with the server (whereas "tls://" only
+    // uses TLS version 1.0)
+    $stream = fsockopen( ($use_smtp_tls==1?'ssl://':'').$smtpServerAddress, $smtpPort,
             $errorNumber, $errorString);
     if(!$stream) {
         do_err("Error connecting to SMTP server \"$smtpServerAddress:$smtpPort\".".
@@ -735,7 +739,10 @@ if($useSendmail) {
 echo "Checking IMAP service....<br />\n";
 
 /** Can we open a connection? */
-$stream = fsockopen( ($use_imap_tls==1?'tls://':'').$imapServerAddress, $imapPort,
+// NB: Using "ssl://" ensures the highest possible TLS version
+// will be negotiated with the server (whereas "tls://" only
+// uses TLS version 1.0)
+$stream = fsockopen( ($use_imap_tls==1?'ssl://':'').$imapServerAddress, $imapPort,
         $errorNumber, $errorString);
 if(!$stream) {
     do_err("Error connecting to IMAP server \"$imapServerAddress:$imapPort\".".