Index: evolution-3.5.3.1/libemail-engine/e-mail-session-utils.c
===================================================================
--- evolution-3.5.3.1.orig/libemail-engine/e-mail-session-utils.c	2012-06-28 17:57:48.000000000 +0200
+++ evolution-3.5.3.1/libemail-engine/e-mail-session-utils.c	2012-06-28 18:00:13.000000000 +0200
@@ -765,9 +765,50 @@
 		const CamelInternetAddress *addr;
 		const gchar *type;
 
-		addr = camel_mime_message_get_from (message);
-		camel_address_copy (from, CAMEL_ADDRESS (addr));
+		gchar *fake_msgid;
+		gchar *hostname;
+		ESource *source = NULL;
+		ESourceRegistry *registry;
+		ESourceMailIdentity *extension;
+		const gchar *extension_name;
+		const gchar *who;
+		gchar *res;
 
+		/* Don't get the 'from' from the headers.
+		 * See https://bugzilla.gnome.org/show_bug.cgi?id=585577
+		 * Instead, use camel_header_msgid_generate () to get a canonical
+		 * hostname, then skip the part leading to '@'. If the hostname
+		 * found matches either 'localhost' or 'localhost.localdomain',
+		 * fallback to using the 'from'.
+		*/
+		hostname = strchr ((fake_msgid = camel_header_msgid_generate ()), '@');
+		hostname++;
+
+		if ((g_ascii_strcasecmp (hostname, "localhost") == 0) ||
+		    (g_ascii_strcasecmp (hostname, "localhost.localdomain") == 0)) {
+			addr = camel_mime_message_get_from (message);
+			camel_address_copy (from, CAMEL_ADDRESS (addr));
+		}
+		else {
+			registry = e_mail_session_get_registry (session);
+			source = e_source_registry_ref_default_mail_identity (registry);
+
+			extension_name = E_SOURCE_EXTENSION_MAIL_IDENTITY;
+			extension = e_source_get_extension (source, extension_name);
+
+			who = e_source_mail_identity_dup_address (extension);
+			if (!who)
+			        who = g_strdup ("fake"); /* not sure what we should do here */
+			else {
+			        gchar *p;
+			        p = strchr (who, '@');
+			        *p = '\0';
+			}
+			res = g_strconcat (who, "@", hostname, NULL);
+			g_free (who);
+			g_free (fake_msgid);
+			camel_address_decode (from, res);
+		}
 		type = CAMEL_RECIPIENT_TYPE_TO;
 		addr = camel_mime_message_get_recipients (message, type);
 		camel_address_cat (recipients, CAMEL_ADDRESS (addr));
