Index: mail/ChangeLog
===================================================================
--- mail/ChangeLog	(revision 35732)
+++ mail/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-07-09  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #269152
+
+	* em-format-quote.c: (emfq_format_header):
+	* em-format-html.c: (efh_format_headers):
+	Use X-MimeOLE as Mailer header when there's nothing better available.
+
 2008-07-09  Milan Crha  <mcrha@redhat.com>
 
 	** Fix for bug #207802 (Patch suggested by Veerapuram Varadhan.)
Index: mail/em-format-quote.c
===================================================================
--- mail/em-format-quote.c	(revision 35731)
+++ mail/em-format-quote.c	(working copy)
@@ -343,7 +343,9 @@ emfq_format_header (EMFormat *emf, Camel
 	} else if (!strcmp (name, "X-Evolution-Mailer")) { /* pseudo-header */
 		if (!(txt = camel_medium_get_header (part, "x-mailer")))
 			if (!(txt = camel_medium_get_header (part, "user-agent")))
-				return;
+				if (!(txt = camel_medium_get_header (part, "x-newsreader")))
+					if (!(txt = camel_medium_get_header (part, "x-mimeole")))
+						return;
 		
 		txt = value = camel_header_format_ctext (txt, charset);
 		
Index: mail/em-format-html.c
===================================================================
--- mail/em-format-html.c	(revision 35731)
+++ mail/em-format-html.c	(working copy)
@@ -1942,15 +1942,30 @@ efh_format_headers(EMFormatHTML *efh, Ca
 
 				if (!mailer_shown && mailer && (!g_ascii_strcasecmp (header->name, "X-Mailer") ||
 								!g_ascii_strcasecmp (header->name, "User-Agent") ||
-								!g_ascii_strcasecmp (header->name, "X-Newsreader"))) {
-					struct _camel_header_raw xmailer;
+								!g_ascii_strcasecmp (header->name, "X-Newsreader") ||
+								!g_ascii_strcasecmp (header->name, "X-MimeOLE"))) {
+					struct _camel_header_raw xmailer, *use_header = NULL;
+
+					if (!g_ascii_strcasecmp (header->name, "X-MimeOLE")) {
+						for (use_header = header->next; use_header; use_header = use_header->next) {
+							if (!g_ascii_strcasecmp (use_header->name, "X-Mailer") ||
+							    !g_ascii_strcasecmp (use_header->name, "User-Agent") ||
+							    !g_ascii_strcasecmp (use_header->name, "X-Newsreader")) {
+								/* even we have X-MimeOLE, then use rather the standard one, when available */
+								break;
+							}
+						}
+					}
+
+					if (!use_header)
+						use_header = header;
 
 					xmailer.name = "X-Evolution-Mailer";
-					xmailer.value = header->value;
+					xmailer.value = use_header->value;
 					mailer_shown = TRUE;
 
 					efh_format_header (emf, stream, part, &xmailer, h->flags, charset);
-					if (strstr(header->value, "Evolution"))
+					if (strstr(use_header->value, "Evolution"))
 						have_icon = TRUE;
 				} else if (!g_ascii_strcasecmp (header->name, "Face") && !face_decoded) {
 					char *cp = header->value;
