Issues

ZF-9561: Zend_Mail_Protocol_Imap::readResponse ignoring final line of return

Description

Zend_Mail_Protocol_Imap::readResponse contains the following code:

302 $lines = array();
303 while (!$this->readLine($tokens, $tag, $dontParse)) {
304     $lines[] = $tokens;
305 }
306 
307 if ($dontParse) {
308     // last to chars are still needed for response code
309     $tokens = array(substr($tokens, 0, 2));
310 }   
311 // last line has response code
312 if ($tokens[0] == 'OK') {
313     return $lines ? $lines : true;
314 } else if ($tokens[0] == 'NO'){
315     return false;
316 }   
317 return null;

This fails to allow collection of final line of response, crucial for operations such as IMAP COPY (on servers implementing UIDPLUS) where new UID is generated and returned in final line of response: " OK [COPYUID ] Done"

Zend_Mail_Protocol_Imap::readResponse should include final line in return

Comments

Fixed Description formatting