diff options
author | alecpl <alec@alec.pl> | 2011-10-24 18:08:53 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-10-24 18:08:53 +0000 |
commit | 1ae11998589900b4161aa4af59e50f31f64ddc66 (patch) | |
tree | a2666e33a36e03be2e2eebc55987b0116cceaf6e /program/include/rcube_imap.php | |
parent | b407e797c20f8d06a85fc90a831f9a8ec6237298 (diff) |
- Improve handling of situation when FETCH returns OK, but no data
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r-- | program/include/rcube_imap.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index 7ffb17a88..834a63938 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -1962,6 +1962,10 @@ class rcube_imap $headers = $this->get_headers($uid, $mailbox); + // message doesn't exist? + if (empty($headers)) + return null; + // structure might be cached if (!empty($headers->structure)) return $headers; @@ -2382,15 +2386,11 @@ class rcube_imap $o_part->charset = rcube_imap_generic::getStructurePartCharset($structure, $part); } - // TODO: Add caching for message parts - - if (!$part) { - $part = 'TEXT'; + if ($o_part && $o_part->size) { + $body = $this->conn->handlePartBody($this->mailbox, $uid, true, + $part ? $part : 'TEXT', $o_part->encoding, $print, $fp); } - $body = $this->conn->handlePartBody($this->mailbox, $uid, true, $part, - $o_part->encoding, $print, $fp); - if ($fp || $print) { return true; } |