diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c
index dd7e453..2dd0c6c 100644
--- a/plugins/prefer-plain/prefer-plain.c
+++ b/plugins/prefer-plain/prefer-plain.c
@@ -50,27 +50,52 @@ enum {
 static GConfClient *epp_gconf = NULL;
 static gint epp_mode = -1;
 
+static void
+make_part_attachment (EMFormat *format, CamelStream *stream, CamelMimePart *part, gint i)
+{
+	gint partidlen = format->part_id->len;
+
+	if (i != -1)
+		g_string_append_printf (format->part_id, ".alternative-prefer-plain.%d", i);
+
+	if (camel_content_type_is (camel_mime_part_get_content_type (part), "text", "html")) {
+		/* always show HTML as attachments and not inline */
+		camel_mime_part_set_disposition (part, "attachment");
+
+		if (!camel_mime_part_get_filename (part)) {
+			gchar *str = g_strdup_printf ("%s.html", _("attachment"));
+			camel_mime_part_set_filename (part, str);
+			g_free (str);
+		}
+
+		em_format_part_as (format, stream, part, "application/octet-stream");
+	} else
+		em_format_part (format, stream, part);
+
+	g_string_truncate (format->part_id, partidlen);
+}
+
 void
-org_gnome_prefer_plain_text_html(gpointer ep, EMFormatHookTarget *t)
+org_gnome_prefer_plain_text_html (gpointer ep, EMFormatHookTarget *t)
 {
-	/* In text-only mode, all html output is suppressed */
-	if (epp_mode != EPP_TEXT)
-		t->item->handler.old->handler(t->format, t->stream, t->part, t->item->handler.old);
+	/* In text-only mode, all html output is suppressed for the first processing */
+	if (epp_mode != EPP_TEXT
+	    || strstr (t->format->part_id->str, ".alternative-prefer-plain.") != NULL
+	    || em_format_is_inline (t->format, t->format->part_id->str, t->part, &(t->item->handler)))
+		t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old);
 	else
-		em_format_part_as(t->format, t->stream, t->part, NULL);
+		make_part_attachment (t->format, t->stream, t->part, -1);
 }
 
 static void
 export_as_attachments (CamelMultipart *mp, EMFormat *format, CamelStream *stream, CamelMimePart *except)
 {
-	gint i, nparts, partidlen;
+	gint i, nparts;
 	CamelMimePart *part;
 
 	if (!mp || !CAMEL_IS_MULTIPART (mp))
 		return;
 
-	partidlen = format->part_id->len;
-
 	nparts = camel_multipart_get_number(mp);
 	for (i = 0; i < nparts; i++) {
 		part = camel_multipart_get_part (mp, i);
@@ -81,23 +106,7 @@ export_as_attachments (CamelMultipart *mp, EMFormat *format, CamelStream *stream
 			if (CAMEL_IS_MULTIPART (multipart)) {
 				export_as_attachments (multipart, format, stream, except);
 			} else {
-				g_string_append_printf (format->part_id, ".alternative.%d", i);
-
-				if (camel_content_type_is (camel_mime_part_get_content_type (part), "text", "html")) {
-					/* always show HTML as attachments and not inline */
-					camel_mime_part_set_disposition (part, "attachment");
-
-					if (!camel_mime_part_get_filename (part)) {
-						gchar *str = g_strdup_printf ("%s.html", _("attachment"));
-						camel_mime_part_set_filename (part, str);
-						g_free (str);
-					}
-
-					em_format_part_as (format, stream, part, "application/octet-stream");
-				} else
-					em_format_part (format, stream, part);
-
-				g_string_truncate (format->part_id, partidlen);
+				make_part_attachment (format, stream, part, i);
 			}
 		}
 	}
@@ -147,7 +156,7 @@ org_gnome_prefer_plain_multipart_alternative(gpointer ep, EMFormatHookTarget *t)
 		}
 
 		if (display_part && have_plain && nparts == 2) {
-			g_string_append_printf (t->format->part_id, ".alternative.%d", displayid);
+			g_string_append_printf (t->format->part_id, ".alternative-prefer-plain.%d", displayid);
 			em_format_part_as (t->format, t->stream, display_part, "text/html");
 			g_string_truncate (t->format->part_id, partidlen);
 		} else {
@@ -171,7 +180,7 @@ org_gnome_prefer_plain_multipart_alternative(gpointer ep, EMFormatHookTarget *t)
 
 	/* if we found a text part, show it */
 	if (display_part) {
-		g_string_append_printf(t->format->part_id, ".alternative.%d", displayid);
+		g_string_append_printf(t->format->part_id, ".alternative-prefer-plain.%d", displayid);
 		em_format_part_as(t->format, t->stream, display_part, "text/plain");
 		g_string_truncate(t->format->part_id, partidlen);
 	}
