From 542f15bfece569ba3d07f57339aca22e535027dd Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Thu, 14 Mar 2013 07:17:38 -0400
Subject: [PATCH] Enriched content should be also converted to text if html is disabled

---
 program/steps/mail/func.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 137e87d..3aea632 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -707,7 +707,10 @@
         + $p + array('safe' => false, 'plain' => false, 'inline_html' => true));
 
   // convert html to text/plain
-  if ($data['type'] == 'html' && $data['plain']) {
+  if ($data['plain'] && ($data['type'] == 'html' || $data['type'] == 'enriched')) {
+    if ($data['type'] == 'enriched') {
+      $data['body'] = rcube_enriched::to_html($data['body']);
+    }
     $txt = new rcube_html2text($data['body'], false, true);
     $body = $txt->get_text();
     $part->ctype_secondary = 'plain';

--
Gitblit v1.9.1