Make the use_*_tls options half respect old values. If you leave it as
authorjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 26 Feb 2006 06:32:17 +0000 (06:32 +0000)
committerjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 26 Feb 2006 06:32:17 +0000 (06:32 +0000)
true, then it would try to use STARTTLS.  While I understand this is a
new feature, and this is the dev branch, a little backwards compatibility
is easy in this case.  The value 2 is considered true... Using === instead
is an exact match, so you'd have to have 2 in the use_*_tls options for it
to trigger starttls mode.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10832 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
class/deliver/Deliver_SMTP.class.php
functions/imap_general.php

index 14c0bf024f08af195f1470161c64b65e5407bcbd..aa190b9356d32c9254fe3b9edd5be0e7ee015de1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@ Version 1.5.2 - CVS
   - Added "bad plugin" blacklist in configtest.php.
   - Fix MagicHTML fix with respect to parsing of u\rl in IE.
   - Added monitored folders option to newmail plugin.
+  - Tweaked STARTTLS option for SMTP/IMAP to allow previous settings of just
+    pure TLS not to be used to assume STARTTLS.
+  
        
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------
index 6461d77212a98858b90b55c78bcfb7e564be4674..e50a535522e79e76fb68c6dcf755c42e13246ab3 100644 (file)
@@ -152,7 +152,7 @@ class Deliver_SMTP extends Deliver {
          * Implementing SMTP STARTTLS (rfc2487) in php 5.1.0+
          * http://www.php.net/stream-socket-enable-crypto
          */
-        if ($use_smtp_tls == 2) {
+        if ($use_smtp_tls === 2) {
             if (function_exists('stream_socket_enable_crypto')) {
                 // don't try starting tls, when client thinks that it is already active
                 if ($this->tls_enabled) {
@@ -511,4 +511,4 @@ class Deliver_SMTP extends Deliver {
     }
 }
 
-?>
\ No newline at end of file
+?>
index 509796cfca12bb26d7ab0f3e62a3e9657b8bfe65..958e835d17f214daece6f07ae2285889911c72f0 100755 (executable)
@@ -673,7 +673,7 @@ function sqimap_create_stream($server,$port,$tls=0) {
      * Implementing IMAP STARTTLS (rfc2595) in php 5.1.0+
      * http://www.php.net/stream-socket-enable-crypto
      */
-    if ($tls == 2) {
+    if ($tls === 2) {
         if (function_exists('stream_socket_enable_crypto')) {
             // check starttls capability, don't use cached capability version
             if (! sqimap_capability($imap_stream, 'STARTTLS', false)) {
@@ -1291,4 +1291,4 @@ function map_yp_alias($username) {
    return chop(substr($yp, strlen($username)+1));
 }
 
-?>
\ No newline at end of file
+?>