From 1df25c1984927cdc5e7c04871de5a9d947d2b76b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 5 Apr 2013 11:17:16 +0200 Subject: [PATCH] Skip charset conversion when it's not needed --- plugins/libkolab/lib/kolab_storage_folder.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php index fe17d637..2c6f04c9 100644 --- a/plugins/libkolab/lib/kolab_storage_folder.php +++ b/plugins/libkolab/lib/kolab_storage_folder.php @@ -947,10 +947,11 @@ class kolab_storage_folder // save object attachments as separate parts foreach ((array)$object['_attachments'] as $key => $att) { if (empty($att['content']) && !empty($att['id'])) { + // @TODO: use IMAP CATENATE to skip attachment fetch+push operation $msguid = !empty($object['_msguid']) ? $object['_msguid'] : $object['uid']; if ($is_file) { $att['path'] = tempnam($temp_dir, 'rcmAttmnt'); - if (($fp = fopen($att['path'], 'w')) && $this->get_attachment($msguid, $att['id'], $object['_mailbox'], false, $fp)) { + if (($fp = fopen($att['path'], 'w')) && $this->get_attachment($msguid, $att['id'], $object['_mailbox'], false, $fp, true)) { fclose($fp); } else { @@ -958,7 +959,7 @@ class kolab_storage_folder } } else { - $att['content'] = $this->get_attachment($msguid, $att['id'], $object['_mailbox']); + $att['content'] = $this->get_attachment($msguid, $att['id'], $object['_mailbox'], false, null, true); } }