I hit this bug by coincidance and thnx to a server crash. Cyrus returned
information like UID, RFC822.SIZE, INTERNALDATE (that info is probably
cached by cyrus) correct, but an empty header. At the end of the response
there was an untagged OK response with as server message: Message <nnn> no
longer exists.
SEARCH responses. That is against RFC3501 !!!
example:
A005 UID SEARCH UID 1:*
* SEARCH 5949 8160 8401 8402 8413 8470 8471 8472 8497 8499
* SEARCH 8502 8504 8514
A005 OK SEARCH completed
We only use that call in case of non server side sorting.
Added basic @package/@subpackage tags
The decode/ files were documented slightly more thoroughly, although they're almost self-explanatory anyway.
The individual functions in the functions/ files need to be documented though, and now that this commit is in, anyone willing to write docblocks for functions should get cracking ;)
Now we can handle returned fetch responses with a different order of
returned arguments. UID i.e. can be properly detected if it is returned
after the HEADER data.
Another issue I fixed is adapting the msgs_id_str to 1:* in case we request all
headers for a mailbox.
If we don't do that the msgs_id_str can become pretty large and in my case
it was 12kb large and the imap server returned a BYE, querystring to long.
We should inspect the last issue better because there are situations where I
can still trigger the error. Setting the number of messages to display to a
large value would cause a BYE again.
1. Wrap all operands of a complex expression with parentheses.
For instance:
if ($bob == 'foo' || $bob == 'bar') {
is wrong. Do this instead:
if (($bob == 'foo') || ($bob == 'bar')) {
2. Carefully decide between pre and post incrementation. If it
does not matter, always choose pre because it is technically
more efficient. For instance:
for ($i = 0; $i < $count; $i++) {
is wrong. Do this instead:
for ($i = 0; $i < $count; ++$i) {
3. Classes should be named in style like this:
MessageHeader
Rfc8222Header
etc. When there is an acronym at the beginning, treat it
like a word - do NOT captitalize each letter of the acronym.
4. Put each class in a seperate file named ClassName.class.php.
Related classes can be put in one directory and then included
in a main include file.
Second, big changes with mime.class.php here. And I don't think I broke
anything. (Sounds like famous last words, eh?)