summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap_generic.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-06-08 12:46:05 +0000
committeralecpl <alec@alec.pl>2010-06-08 12:46:05 +0000
commit64e3e80743415e5fb121eb5c66416593c38ef288 (patch)
treefdf160e8eb9580deab6c4fc2cbdb3ceb63d3c76f /program/include/rcube_imap_generic.php
parentb93d00026aefbdccfabd6253f9cb184956617084 (diff)
- Fix some IMAP errors handling when opening the message (#1485443)
Diffstat (limited to 'program/include/rcube_imap_generic.php')
-rw-r--r--program/include/rcube_imap_generic.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index d5a5e3d4b..7669ceb32 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -1777,12 +1777,11 @@ class rcube_imap_generic
$mode = 0;
}
+ // format request
$reply_key = '* ' . $id;
- $result = false;
+ $key = 'ftch0';
+ $request = $key . ($is_uid ? ' UID' : '') . " FETCH $id (BODY.PEEK[$part])";
- // format request
- $key = 'ftch0';
- $request = $key . ($is_uid ? ' UID' : '') . " FETCH $id (BODY.PEEK[$part])";
// send request
if (!$this->putLine($request)) {
return false;
@@ -1794,7 +1793,8 @@ class rcube_imap_generic
$a = explode(' ', $line);
} while (!($end = $this->startsWith($line, $key, true)) && $a[2] != 'FETCH');
- $len = strlen($line);
+ $len = strlen($line);
+ $result = false;
// handle empty "* X FETCH ()" response
if ($line[$len-1] == ')' && $line[$len-2] != '(') {
@@ -1890,7 +1890,7 @@ class rcube_imap_generic
$line = $this->readLine(1024);
} while (!$this->startsWith($line, $key, true));
- if ($result) {
+ if ($result !== false) {
if ($file) {
fwrite($file, $result);
} else if ($print) {