diff -r -u -up evolution-2.24.1.1.orig/mail/em-format-html.c evolution-2.24.1.1/mail/em-format-html.c
--- evolution-2.24.1.1.orig/mail/em-format-html.c	2008-11-07 01:38:04.000000000 -0500
+++ evolution-2.24.1.1/mail/em-format-html.c	2009-04-28 16:44:54.000000000 -0400
@@ -1364,8 +1364,7 @@ static MailMsgInfo efh_format_info = {
 	(MailMsgFreeFunc) efh_format_free
 };
 
-static gboolean
-efh_format_timeout(struct _format_msg *m)
+static gboolean efh_format_helper(struct _format_msg *m, gboolean async)
 {
 	GtkHTMLStream *hstream;
 	EMFormatHTML *efh = m->format;
@@ -1376,10 +1375,12 @@ efh_format_timeout(struct _format_msg *m
 		return FALSE;
 	}
 
-	d(printf("timeout called ...\n"));
-	if (p->format_id != -1) {
-		d(printf(" still waiting for cancellation to take effect, waiting ...\n"));
-		return TRUE;
+	if (async) {
+		d(printf("timeout called ...\n"));
+		if (p->format_id != -1) {
+			d(printf(" still waiting for cancellation to take effect, waiting ...\n"));
+			return TRUE;
+		}
 	}
 
 	g_return_val_if_fail (e_dlist_empty(&p->pending_jobs), FALSE);
@@ -1426,7 +1427,12 @@ efh_format_timeout(struct _format_msg *m
 		}
 
 		efh->priv->format_id = m->base.seq;
-		mail_msg_unordered_push (m);
+
+		if (async) {
+			mail_msg_unordered_push (m);
+		} else {
+			efh_format_exec(m);
+		}
 	}
 
 	efh->priv->format_timeout_id = 0;
@@ -1435,6 +1441,28 @@ efh_format_timeout(struct _format_msg *m
 	return FALSE;
 }
 
+static gboolean
+efh_format_timeout(struct _format_msg *m)
+{
+	return efh_format_helper(m, TRUE);
+}
+
+void em_format_html_clone_sync(CamelFolder *folder, const char *uid,
+                   CamelMimeMessage *msg, EMFormatHTML *efhp, EMFormat * source) {
+	struct _format_msg *m;
+	m = mail_msg_new(&efh_format_info);
+	m->format = efhp;
+	m->format_source = source;
+	m->folder = folder;
+	m->uid = g_strdup(uid);
+	m->message = msg; 
+
+	((EMFormat*) efhp)->show_photo = FALSE;
+
+	efh_format_helper(m, FALSE);
+	efh_format_free(m);
+}
+
 static void efh_format_clone(EMFormat *emf, CamelFolder *folder, const char *uid, CamelMimeMessage *msg, EMFormat *emfsource)
 {
 	EMFormatHTML *efh = (EMFormatHTML *)emf;
@@ -2144,3 +2172,4 @@ efh_busy(EMFormat *emf)
 {
 	return (((EMFormatHTML *)emf)->priv->format_id != -1);
 }
+
diff -r -u -up evolution-2.24.1.1.orig/mail/em-format-html.h evolution-2.24.1.1/mail/em-format-html.h
--- evolution-2.24.1.1.orig/mail/em-format-html.h	2008-10-13 04:37:24.000000000 -0400
+++ evolution-2.24.1.1/mail/em-format-html.h	2009-04-10 02:10:12.000000000 -0400
@@ -233,4 +233,6 @@ EMFormatHTMLJob *em_format_html_job_new(
 ;
 void em_format_html_job_queue(EMFormatHTML *emfh, struct _EMFormatHTMLJob *job);
 
+void em_format_html_clone_sync(CamelFolder *folder, const char *uid, CamelMimeMessage *msg, EMFormatHTML *efhp, EMFormat * source);
+
 #endif /* ! EM_FORMAT_HTML_H */
diff -r -u -up evolution-2.24.1.1.orig/mail/em-format-html-print.c evolution-2.24.1.1/mail/em-format-html-print.c
--- evolution-2.24.1.1.orig/mail/em-format-html-print.c	2008-10-13 04:37:24.000000000 -0400
+++ evolution-2.24.1.1/mail/em-format-html-print.c	2009-04-28 17:02:03.000000000 -0400
@@ -42,6 +42,8 @@ efhp_finalize (GObject *o)
 {
 	EMFormatHTMLPrint *efhp = (EMFormatHTMLPrint *)o;
 
+	g_free (efhp->export_filename);
+	efhp->export_filename = NULL;
 	gtk_widget_destroy (efhp->window);
 	if (efhp->source != NULL)
 		g_object_unref (efhp->source);
@@ -71,6 +73,9 @@ efhp_init (GObject *o)
 	gtk_container_add (GTK_CONTAINER (efhp->window), html);
 	gtk_widget_realize (html);
 	efhp->parent.show_icon = FALSE;
+
+	efhp->export_filename = NULL;
+	efhp->async = TRUE;
 }
 
 GType
@@ -187,6 +192,9 @@ emfhp_complete (EMFormatHTMLPrint *efhp)
 
 	operation = e_print_operation_new ();
 
+	if (efhp->action == GTK_PRINT_OPERATION_ACTION_EXPORT)
+		gtk_print_operation_set_export_filename (operation, efhp->export_filename);
+
 	gtk_html_print_operation_run (
 		efhp->parent.html, operation, efhp->action, NULL,
 		(GtkHTMLPrintCalcHeight) NULL,
@@ -213,11 +221,16 @@ emfhp_got_message (CamelFolder *folder,
 		((EMFormatHTML *)efhp)->load_http =
 			efhp->source->load_http_now;
 
-	g_signal_connect (
-		efhp, "complete", G_CALLBACK (emfhp_complete), efhp);
-	em_format_format_clone (
-		(EMFormat *) efhp, folder, uid, msg,
-		(EMFormat *) efhp->source);
+	if (efhp->async) {
+		g_signal_connect (
+			efhp, "complete", G_CALLBACK (emfhp_complete), efhp);
+		em_format_format_clone (
+			(EMFormat *) efhp, folder, uid, msg,
+			(EMFormat *) efhp->source);
+	} else {
+		em_format_html_clone_sync(folder, uid, msg, (EMFormatHTML *)efhp, (EMFormat *)efhp->source);
+		emfhp_complete(efhp);
+	}
 }
 
 void
diff -r -u -up evolution-2.24.1.1.orig/mail/em-format-html-print.h evolution-2.24.1.1/mail/em-format-html-print.h
--- evolution-2.24.1.1.orig/mail/em-format-html-print.h	2008-10-13 04:37:24.000000000 -0400
+++ evolution-2.24.1.1/mail/em-format-html-print.h	2009-04-10 01:00:02.000000000 -0400
@@ -34,6 +34,9 @@ struct _EMFormatHTMLPrint {
 	EMFormatHTML *source; /* used for print_message */
 
 	GtkPrintOperationAction action;
+	gchar *export_filename;
+
+	gboolean async;
 };
 
 struct _EMFormatHTMLPrintClass {
diff -r -u -up evolution-2.24.1.1.orig/mail/em-utils.c evolution-2.24.1.1/mail/em-utils.c
--- evolution-2.24.1.1.orig/mail/em-utils.c	2008-11-06 23:34:07.000000000 -0500
+++ evolution-2.24.1.1/mail/em-utils.c	2009-04-28 17:04:09.000000000 -0400
@@ -77,6 +77,7 @@
 #include "em-composer-utils.h"
 #include "em-folder-view.h"
 #include "em-format-quote.h"
+#include "em-format-html-print.h"
 #include "em-account-editor.h"
 #include "e-attachment.h"
 #include "e-activity-handler.h"
@@ -85,6 +86,12 @@ static void emu_save_part_done (CamelMim
 
 extern struct _CamelSession *session;
 
+/* drag and drop resulting file naming possibilities */
+enum {
+	DND_USE_SENT_DATE = 1, /* YYYYMMDDhhmmssms_<title> and use email sent date */
+	DND_USE_DND_DATE  = 2,  /*  YYYYMMDDhhmmssms_<title> and drag'drop date */
+};
+
 #define d(x)
 
 /**
@@ -995,6 +1002,30 @@ em_utils_write_messages_to_stream(CamelF
 	return res;
 }
 
+static int
+em_utils_print_messages_to_file (CamelFolder *folder, const char* uid, const char *filename, gboolean async)
+{
+	EMFormatHTMLPrint *efhp;
+	CamelMimeMessage *message;
+
+	message = camel_folder_get_message(folder, uid, NULL);
+	if (message == NULL)
+		return -1;
+
+	efhp = em_format_html_print_new (
+		NULL, GTK_PRINT_OPERATION_ACTION_EXPORT);
+	efhp->export_filename = g_strdup (filename);
+	efhp->async = FALSE;
+	em_format_set_session ((EMFormat *) efhp, session);
+
+	em_format_html_print_raw_message (efhp, message);
+
+	g_object_unref (efhp);
+	camel_object_unref(message);
+
+	return 0;
+}
+
 /* This kind of sucks, because for various reasons most callers need to run synchronously
    in the gui thread, however this could take a long, blocking time, to run */
 static int
@@ -1187,6 +1218,55 @@ em_utils_selection_get_uidlist(GtkSelect
 	em_utils_uids_free(uids);
 }
 
+static gchar*
+em_utils_build_export_filename(CamelFolder *folder, const char* uid, const gchar* exporttype, int exportname, const char* tmpdir)
+{
+	CamelMessageInfo *info;
+	char *file, *tmpfile;
+	struct tm  *ts;
+	char datetmp[15];
+
+	/* Try to get the drop filename from the message or folder */
+	info = camel_folder_get_message_info(folder, uid);
+	if (info) {
+		if (camel_message_info_subject (info)) {
+			time_t reftime;
+			reftime = camel_message_info_date_sent (info);
+			if (exportname==DND_USE_DND_DATE) {
+				reftime = time(NULL);
+			}
+			
+			ts = localtime(&reftime);
+			strftime(datetmp, 15, "%Y%m%d%H%M%S", ts);
+
+			if (g_ascii_strcasecmp (exporttype, "pdf")==0)
+				file = g_strdup_printf ("%s_%s.pdf", datetmp, camel_message_info_subject (info));
+			else
+				file = g_strdup_printf ("%s_%s", datetmp, camel_message_info_subject(info));
+			
+		}
+		camel_folder_free_message_info(folder, info);
+	} else {
+		time_t reftime;
+		reftime = time(NULL);
+		ts = localtime(&reftime);
+		strftime(datetmp, 15, "%Y%m%d%H%M%S", ts);
+		if (g_ascii_strcasecmp (exporttype, "pdf")==0)
+			file = g_strdup_printf ("%s_Untitled Message.pdf", datetmp);
+		else
+			file = g_strdup_printf ("%s_Untitled Message", datetmp);
+		
+	}
+	
+	e_filename_make_safe(file);
+	
+	tmpfile = g_build_filename(tmpdir, file, NULL);
+	
+	g_free(file);
+
+	return tmpfile;
+}
+
 /**
  * em_utils_selection_set_urilist:
  * @data:
@@ -1201,59 +1281,110 @@ void
 em_utils_selection_set_urilist(GtkSelectionData *data, CamelFolder *folder, GPtrArray *uids)
 {
 	char *tmpdir;
-	CamelStream *fstream;
-	char *uri, *file = NULL, *tmpfile;
+	char *uri;
 	int fd;
-	CamelMessageInfo *info;
+	GConfClient *gconf;
+	char* exporttype;
+	int exportname;
 
 	tmpdir = e_mkdtemp("drag-n-drop-XXXXXX");
 	if (tmpdir == NULL)
 		return;
 
-	/* Try to get the drop filename from the message or folder */
-	if (uids->len == 1) {
-		info = camel_folder_get_message_info(folder, uids->pdata[0]);
-		if (info) {
-			file = g_strdup(camel_message_info_subject(info));
-			camel_folder_free_message_info(folder, info);
+	gconf = mail_config_get_gconf_client ();
+	exporttype = gconf_client_get_string(gconf, "/apps/evolution/mail/save_file_format", NULL);
+   if (exporttype == NULL)
+        exporttype = g_strdup ("mbox");
+	exportname = gconf_client_get_int(gconf, "/apps/evolution/mail/save_name_format", NULL);
+
+	if (g_ascii_strcasecmp (exporttype, "mbox")==0) {
+		char* file = NULL;
+		CamelStream *fstream;
+
+		if(uids->len>1) {
+			char* tmp = g_strdup_printf(_("Messages from %s"), folder->name);
+			e_filename_make_safe(tmp);
+			file = g_build_filename(tmpdir, tmp, NULL);
+			g_free(tmp);
+		} else {
+			file = em_utils_build_export_filename(folder, uids->pdata[0], exporttype, exportname, tmpdir);
+		}
+
+		g_free(tmpdir);
+		fd = g_open(file, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0666);
+		if (fd == -1) {
+			g_free(file);
+			g_free(exporttype);
+			return;
 		}
-	}
+		
+		uri = g_filename_to_uri(file, NULL, NULL);
+		fstream = camel_stream_fs_new_with_fd(fd);
+		if (fstream) {
+			if (em_utils_write_messages_to_stream(folder, uids, fstream) == 0) {
+				/* terminate with \r\n to be compliant with the spec */
+				char *uri_crlf = g_strconcat(uri, "\r\n", NULL);
+				gtk_selection_data_set(data, data->target, 8, (unsigned char *)uri_crlf, strlen(uri_crlf));
+				g_free(uri_crlf);
+			}
+			camel_object_unref(fstream);
+		} else
+			close(fd);
 
-	/* TODO: Handle conflicts? */
-	if (file == NULL) {
-		/* Drop filename for messages from a mailbox */
-		file = g_strdup_printf(_("Messages from %s"), folder->name);
-	}
+		g_free(exporttype);
+		g_free(file);
+		g_free(uri);
+	} else if(g_ascii_strcasecmp (exporttype, "pdf")==0) {
+		gchar** filenames, **uris;
+		int i, uris_count=0;
+
+		filenames = g_new(gchar*, uids->len);
+		uris = g_new(gchar*, uids->len + 1);
+		for(i=0; i<uids->len; i++) {
+			filenames[i] = em_utils_build_export_filename(folder, uids->pdata[i], exporttype, exportname, tmpdir);
+			/* validity test */
+			fd = g_open(filenames[i], O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0666);
+			if (fd == -1) {
+				int j;
+				for(j=0; j<=i; j++) {
+					g_free(filenames[j]);
+				}
+				g_free(filenames);
+				g_free(uris);
+				g_free(tmpdir);
+				g_free(exporttype);
+				return;
+			}
+			close(fd);
 
-	e_filename_make_safe(file);
+			/* export */
+			if (em_utils_print_messages_to_file (folder, uids->pdata[i], filenames[i], FALSE) == 0) {
+				/* terminate with \r\n to be compliant with the spec */
+				uri = g_filename_to_uri(filenames[i], NULL, NULL);
+				uris[uris_count++] = g_strconcat(uri, "\r\n", NULL);
+				g_free(uri);
+			}
+		}
 
-	tmpfile = g_build_filename(tmpdir, file, NULL);
-	g_free(tmpdir);
-	g_free(file);
+		uris[uris_count] = NULL;
+		gtk_selection_data_set_uris(data, uris);
+
+		g_free(tmpdir);
+		for(i=0; i<uids->len; i++) {
+			g_free(filenames[i]);
+		}
+		g_free(filenames);
+		for(i=0; i<uris_count; i++) {
+			g_free(uris[i]);
+		}
+		g_free(uris);
+		g_free(exporttype);
 
-	fd = g_open(tmpfile, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0666);
-	if (fd == -1) {
-		g_free(tmpfile);
+	} else {
+		g_free(tmpdir);
+		g_free(exporttype);
 		return;
 	}
-
-	uri = g_filename_to_uri(tmpfile, NULL, NULL);
-	g_free(tmpfile);
-	fstream = camel_stream_fs_new_with_fd(fd);
-	if (fstream) {
-		if (em_utils_write_messages_to_stream(folder, uids, fstream) == 0) {
-			/* terminate with \r\n to be compliant with the spec */
-			char *uri_crlf = g_strconcat(uri, "\r\n", NULL);
-
-			gtk_selection_data_set(data, data->target, 8, (unsigned char *)uri_crlf, strlen(uri_crlf));
-			g_free(uri_crlf);
-		}
-
-		camel_object_unref(fstream);
-	} else
-		close(fd);
-
-	g_free(uri);
 }
 
 /**
@@ -2243,7 +2374,7 @@ em_utils_contact_photo (struct _CamelInt
 		}
 	}
 
-    	query = e_book_query_field_test(E_CONTACT_EMAIL, E_BOOK_QUERY_IS, addr);
+	 	query = e_book_query_field_test(E_CONTACT_EMAIL, E_BOOK_QUERY_IS, addr);
 	for (g = e_source_list_peek_groups(emu_addr_list); g; g = g_slist_next(g)) {
 		if (local && strcmp (e_source_group_peek_name ((ESourceGroup *)g->data), "On This Computer"))
 			continue;
diff -r -u -up evolution-2.24.1.1.orig/mail/evolution-mail.schemas.in evolution-2.24.1.1/mail/evolution-mail.schemas.in
--- evolution-2.24.1.1.orig/mail/evolution-mail.schemas.in	2008-10-13 04:37:24.000000000 -0400
+++ evolution-2.24.1.1/mail/evolution-mail.schemas.in	2009-04-28 16:51:34.000000000 -0400
@@ -1334,6 +1334,38 @@
       </locale>
     </schema>
 
+    <!-- email drag'n'drop settings -->
+
+    <schema>
+      <key>/schemas/apps/evolution/mail/save_file_format</key>
+      <applyto>/apps/evolution/mail/save_file_format</applyto>
+      <owner>evolution-mail</owner>
+      <type>string</type>
+      <default>mbox</default>
+      <locale name="C">
+         <short>Drag'n'drop export format</short>
+         <long>
+           Define the email export format when doing drag'n'drop.
+           Possible values are : mbox or pdf
+         </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/evolution/mail/save_name_format</key>
+      <applyto>/apps/evolution/mail/save_name_format</applyto>
+      <owner>evolution-mail</owner>
+      <type>int</type>
+     <default>1</default>
+      <locale name="C">
+         <short>Format of the drag'n'drop export filename</short>
+         <long>
+           Exported file name will be : YYYmmDDHHMMSS_email_title
+           Possible values : 1 (: email sent date), 2 (: drag'n'drop date)
+         </long>
+      </locale>
+    </schema>
+
     <!-- Others -->
 
     <schema>
