Index: /branches/release-0.7/program/include/rcube_imap.php
===================================================================
--- /branches/release-0.7/program/include/rcube_imap.php	(revision 5600)
+++ /branches/release-0.7/program/include/rcube_imap.php	(revision 5601)
@@ -1637,4 +1637,5 @@
      * @return array   search results as list of message IDs
      * @access public
+     * @todo: Search criteria should be provided in non-IMAP format, eg. array
      */
     function search($mailbox='', $str=NULL, $charset=NULL, $sort_field=NULL)
@@ -1776,7 +1777,7 @@
                 $string = substr($str, $string_offset - 1, $m[0]);
                 $string = rcube_charset_convert($string, $charset, $dest_charset);
-                if (!$string)
+                if ($string === false)
                     continue;
-                $res .= sprintf("%s{%d}\r\n%s", substr($str, $last, $m[1] - $last - 1), strlen($string), $string);
+                $res .= substr($str, $last, $m[1] - $last - 1) . rcube_imap_generic::escape($string);
                 $last = $m[0] + $string_offset - 1;
             }
Index: /branches/release-0.7/program/steps/mail/func.inc
===================================================================
--- /branches/release-0.7/program/steps/mail/func.inc	(revision 5600)
+++ /branches/release-0.7/program/steps/mail/func.inc	(revision 5601)
@@ -1047,4 +1047,9 @@
   if ($CONFIG['inline_images'] && !empty($MESSAGE->attachments)) {
     foreach ($MESSAGE->attachments as $attach_prop) {
+      // skip inline images
+      if ($attach_prop->content_id && $attach_prop->disposition == 'inline') {
+        continue;
+      }
+
       // Content-Type: image/*...
       if (preg_match('/^image\//i', $attach_prop->mimetype) ||
