|
|
@ -85,7 +85,7 @@ class rcube_imap_generic
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param int Number of bytes sent, False on error
|
|
|
|
* @param int Number of bytes sent, False on error
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function putLine($string, $endln = true, $anonymized = false)
|
|
|
|
protected function putLine($string, $endln = true, $anonymized = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!$this->fp) {
|
|
|
|
if (!$this->fp) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -127,7 +127,7 @@ class rcube_imap_generic
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return int|bool Number of bytes sent, False on error
|
|
|
|
* @return int|bool Number of bytes sent, False on error
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function putLineC($string, $endln=true, $anonymized=false)
|
|
|
|
protected function putLineC($string, $endln=true, $anonymized=false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!$this->fp) {
|
|
|
|
if (!$this->fp) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -184,7 +184,7 @@ class rcube_imap_generic
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return string Line of text response
|
|
|
|
* @return string Line of text response
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function readLine($size = 1024)
|
|
|
|
protected function readLine($size = 1024)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$line = '';
|
|
|
|
$line = '';
|
|
|
|
|
|
|
|
|
|
|
@ -209,7 +209,8 @@ class rcube_imap_generic
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$line .= $buffer;
|
|
|
|
$line .= $buffer;
|
|
|
|
} while (substr($buffer, -1) != "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
while (substr($buffer, -1) != "\n");
|
|
|
|
|
|
|
|
|
|
|
|
return $line;
|
|
|
|
return $line;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -223,7 +224,7 @@ class rcube_imap_generic
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return string Line of text response
|
|
|
|
* @return string Line of text response
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function multLine($line, $escape = false)
|
|
|
|
protected function multLine($line, $escape = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$line = rtrim($line);
|
|
|
|
$line = rtrim($line);
|
|
|
|
if (preg_match('/\{([0-9]+)\}$/', $line, $m)) {
|
|
|
|
if (preg_match('/\{([0-9]+)\}$/', $line, $m)) {
|
|
|
@ -253,7 +254,7 @@ class rcube_imap_generic
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return string Response text
|
|
|
|
* @return string Response text
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function readBytes($bytes)
|
|
|
|
protected function readBytes($bytes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$data = '';
|
|
|
|
$data = '';
|
|
|
|
$len = 0;
|
|
|
|
$len = 0;
|
|
|
@ -281,7 +282,7 @@ class rcube_imap_generic
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return string Response text
|
|
|
|
* @return string Response text
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function readReply(&$untagged = null)
|
|
|
|
protected function readReply(&$untagged = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
$line = trim($this->readLine(1024));
|
|
|
|
$line = trim($this->readLine(1024));
|
|
|
@ -289,7 +290,8 @@ class rcube_imap_generic
|
|
|
|
if ($line[0] == '*') {
|
|
|
|
if ($line[0] == '*') {
|
|
|
|
$untagged[] = $line;
|
|
|
|
$untagged[] = $line;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while ($line[0] == '*');
|
|
|
|
}
|
|
|
|
|
|
|
|
while ($line[0] == '*');
|
|
|
|
|
|
|
|
|
|
|
|
if ($untagged) {
|
|
|
|
if ($untagged) {
|
|
|
|
$untagged = join("\n", $untagged);
|
|
|
|
$untagged = join("\n", $untagged);
|
|
|
@ -306,7 +308,7 @@ class rcube_imap_generic
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return int Response status
|
|
|
|
* @return int Response status
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function parseResult($string, $err_prefix = '')
|
|
|
|
protected function parseResult($string, $err_prefix = '')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (preg_match('/^[a-z0-9*]+ (OK|NO|BAD|BYE)(.*)$/i', trim($string), $matches)) {
|
|
|
|
if (preg_match('/^[a-z0-9*]+ (OK|NO|BAD|BYE)(.*)$/i', trim($string), $matches)) {
|
|
|
|
$res = strtoupper($matches[1]);
|
|
|
|
$res = strtoupper($matches[1]);
|
|
|
@ -2681,7 +2683,7 @@ class rcube_imap_generic
|
|
|
|
while (preg_match('/^BODY\[([0-9\.]+)\.'.$type.'\]/', $line, $matches)) {
|
|
|
|
while (preg_match('/^BODY\[([0-9\.]+)\.'.$type.'\]/', $line, $matches)) {
|
|
|
|
$line = substr($line, strlen($matches[0]));
|
|
|
|
$line = substr($line, strlen($matches[0]));
|
|
|
|
$result[$matches[1]] = trim($this->multLine($line));
|
|
|
|
$result[$matches[1]] = trim($this->multLine($line));
|
|
|
|
$line = ltrim($this->readLine(1024));
|
|
|
|
$line = $this->readLine(1024);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|