From 4f82c7bcd63e44cb114be4f55beb460c4d5d2d0f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Dec 2008 07:37:55 +0000 Subject: [PATCH] Added comment to sieve TLS git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13217 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/mail/personal/mail/sieve/class_sieve.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/mail/personal/mail/sieve/class_sieve.inc b/gosa-plugins/mail/personal/mail/sieve/class_sieve.inc index f1875d445..290a96b05 100644 --- a/gosa-plugins/mail/personal/mail/sieve/class_sieve.inc +++ b/gosa-plugins/mail/personal/mail/sieve/class_sieve.inc @@ -491,13 +491,18 @@ class sieve /* Check if PHP supports TLS encryption for sockets */ if(function_exists("stream_socket_enable_crypto")){ + + /* Initiate TLS and get response + */ if (@ fputs ($this->fp, "STARTTLS\r\n") === false) { $this->error_raw = "fputs() returned 'false'"; return (false); } @ $linha = fgets ($this->fp, 1024); if ($linha === false) { $this->error_raw = "fgets() returned 'false'"; return (false); - } if (! preg_match ("/\\s*OK\\s/i", $linha)) { + } + if (! preg_match ("/\\s*OK\\s/i", $linha)) { $this->error_raw = "expected an 'OK', but server replied: '" . trim ($linha) . "'"; return (false); - } if (! @ stream_socket_enable_crypto ($this->fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { + } + if (! @ stream_socket_enable_crypto ($this->fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { $this->error_raw = "stream_socket_enable_crypto() returned 'false'"; return (false); } } -- 2.30.2