ZF-10092: POP3 in Exchange Server 2003 - wrong multiline response
Description
Hi,
I found that in the Exchange Server 2003 the response of message sometimes contains faultly a single dot on line while it is not end of the message. But Zend_Mail_Protocol_Pop3 identifies that dot as an end of the message and therefore it cannot read the whole message and also leave the rest of message on the socket (which effectively disables the whole rest of the communication with the server).
I looked in the POP3 RFC and it is definitely the ES2003 fault. However, the server is still used and we need to live with that. Therefore i suggest to change part of the readResponse method to something similar to this:
if ($multiline) { $message = ''; $line = fgets($this->_socket); $stat = socket_get_status($this->_socket); $queue = $stat['unread_bytes']; // How many bytes to read from socket?
while (($line && rtrim($line, "\r\n") != '.') || ($queue > 0)) {
if ($line[0] == '.') {
$line = substr($line, 1);
}
$message .= $line;
$line = fgets($this->_socket);
$stat = socket_get_status($this->_socket);
$queue = $stat['unread_bytes']; // How many bytes to read from socket?
};
}
It works fine with the ES2003, however I havent try it on another POP3 server. It could also be affected by the fact, that the connection is estabilished with ES2003, and so on...
Comments
No comments to display