Index: Abstract.php =================================================================== --- Abstract.php (revision 19248) +++ Abstract.php (working copy) @@ -361,6 +361,7 @@ $this->_response = array(); $cmd = ''; $msg = ''; + $err = ''; if (!is_array($code)) { $code = array($code); @@ -370,12 +371,17 @@ $this->_response[] = $result = $this->_receive($timeout); sscanf($result, $this->_template, $cmd, $msg); - if ($cmd === null || !in_array($cmd, $code)) { - /** - * @see Zend_Mail_Protocol_Exception - */ - require_once 'Zend/Mail/Protocol/Exception.php'; - throw new Zend_Mail_Protocol_Exception($result); + if ($cmd === null || !in_array($cmd, $code) || $err) { + $err .= $result; + + // don't throw exception until full response is read [ZF-8511] + if (strpos($msg, '-') !== 0) { + /** + * @see Zend_Mail_Protocol_Exception + */ + require_once 'Zend/Mail/Protocol/Exception.php'; + throw new Zend_Mail_Protocol_Exception($err); + } } } while (strpos($msg, '-') === 0); // The '-' message prefix indicates an information string instead of a response string.