ZF-9714: _decodeLine() issue in Mail/Protocol/Imap.php

Description

With Dovecot IMAP server, some messages are not retrieved properly and eventually the connection times out because ZF tries to read too many lines.

The problem is in the _decodeLine() function when ZF has to read a specific string length. The server will reply with a line like this: * 767 FETCH (UID 19111 RFC822.TEXT {11825}

Where 11825 is the number of characters ZF has to read.

The problem is that somehow the internal mechanism for tracking the characters read ( strlen($token) ) reports for some messages, the wrong count and this makes ZF ask for more lines using _nextLine() which eventually breaks everything.

At first I thought this was an issue with Dovecot, but testing with other IMAP clients didn't result in any bug. There must be something wrong in the way ZF reads and counts the data from the server.

Comments

No comments to display