From: jangliss Date: Sun, 26 Feb 2006 06:32:17 +0000 (+0000) Subject: Make the use_*_tls options half respect old values. If you leave it as X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=c4de9863a2cd0e8da286a7d8fa5bf407e3a4d12f Make the use_*_tls options half respect old values. If you leave it as 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 --- diff --git a/ChangeLog b/ChangeLog index 14c0bf02..aa190b93 100644 --- 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) -------------------------------------- diff --git a/class/deliver/Deliver_SMTP.class.php b/class/deliver/Deliver_SMTP.class.php index 6461d772..e50a5355 100644 --- a/class/deliver/Deliver_SMTP.class.php +++ b/class/deliver/Deliver_SMTP.class.php @@ -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 +?> diff --git a/functions/imap_general.php b/functions/imap_general.php index 509796cf..958e835d 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -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 +?>