From 149090c08e00f23d5891eeda5d5387a83790f96d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 25 Sep 2014 12:43:25 +0000 Subject: [PATCH] explicitly fetching structure in get_load_email_data, to supply it to getMessageBody and getMessageAtacchemnts, so they dont get fetcheds twice from imap-server --- mail/inc/class.mail_ui.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index cdbc078ef3..00872e6e4c 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2667,12 +2667,14 @@ class mail_ui $this->partID = $partID; $bufferHtmlOptions = $this->mail_bo->htmlOptions; if (empty($htmlOptions)) $htmlOptions = $this->mail_bo->htmlOptions; - $bodyParts = $this->mail_bo->getMessageBody($uid, ($htmlOptions?$htmlOptions:''), $partID, null, false, $mailbox); + // fetching structure now, to supply it to getMessageBody and getMessageAttachment, so it does not get fetched twice + $structure = $this->mail_bo->getStructure($uid, $partID, $mailbox, false); + $bodyParts = $this->mail_bo->getMessageBody($uid, ($htmlOptions?$htmlOptions:''), $partID, $structure, false, $mailbox); //error_log(__METHOD__.__LINE__.array2string($bodyParts)); $fetchEmbeddedImages = false; if ($htmlOptions !='always_display') $fetchEmbeddedImages = true; - $attachments = (array)$this->mail_bo->getMessageAttachments($uid, $partID, null, $fetchEmbeddedImages, true,true,$mailbox); + $attachments = (array)$this->mail_bo->getMessageAttachments($uid, $partID, $structure, $fetchEmbeddedImages, true,true,$mailbox); //error_log(__METHOD__.__LINE__.array2string($attachments)); foreach ($attachments as &$attach) {