Skip to content

Commit

Permalink
Sanity checking for servers that might send back the wrong (but equiv…
Browse files Browse the repository at this point in the history
…alent) FETCH response data item

Gmail has an issue with the reverse - it will return BODY responses for
RFC822 requests, but that doesn't affect us.  But doesn't hurt to be as
thorough as possible.
  • Loading branch information
slusarz committed Jul 31, 2014
1 parent eba666a commit aaf2d07
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions framework/Imap_Client/lib/Horde/Imap/Client/Socket.php
Expand Up @@ -3013,6 +3013,22 @@ protected function _parseFetch(
while (($tag = $data->next()) !== false) {
$tag = strtoupper($tag);

/* Catch equivalent RFC822 tags, in case server returns them
* (in error, since we only use BODY in FETCH requests). */
switch ($tag) {
case 'RFC822':
$tag = 'BODY[]';
break;

case 'RFC822.HEADER':
$tag = 'BODY[HEADER]';
break;

case 'RFC822.TEXT':
$tag = 'BODY[TEXT]';
break;
}

switch ($tag) {
case 'BODYSTRUCTURE':
$data->next();
Expand Down

0 comments on commit aaf2d07

Please sign in to comment.