From 7cea1608f0fa1b14c95ecfd5d9b041f70f987a81 Mon Sep 17 00:00:00 2001 From: kink Date: Wed, 30 May 2007 18:30:27 +0000 Subject: [PATCH] fix mail_fetch class to properly cope with dots as specified in the RFC, thanks Tomas Kuliavas. Closes: #1621267 git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12425 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/mail_fetch/class.mail_fetch.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/mail_fetch/class.mail_fetch.php b/plugins/mail_fetch/class.mail_fetch.php index 6e243394..a58884fd 100644 --- a/plugins/mail_fetch/class.mail_fetch.php +++ b/plugins/mail_fetch/class.mail_fetch.php @@ -365,8 +365,10 @@ class mail_fetch { if($this->check_response()) { $ret = ''; while($line = fgets($this->conn)) { - if (trim($line)=='.') { + if ($line == ".\r\n") { break; + } elseif ( $line{0} == '.' ) { + $ret .= substr($line,1); } else { $ret.= $line; } @@ -564,8 +566,8 @@ class mail_fetch { } fwrite($this->conn,"STLS\r\n"); if (! $this->check_response()) { - $this->command_quit(); - return false; + $this->command_quit(); + return false; } if (@stream_socket_enable_crypto($this->conn,true,STREAM_CRYPTO_METHOD_TLS_CLIENT)) { -- 2.25.1