Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2444.2.8
diff -u -r1.2444.2.8 ChangeLog
--- ChangeLog	3 Dec 2002 16:05:29 -0000	1.2444.2.8
+++ ChangeLog	8 Dec 2002 15:10:14 -0000
@@ -1,3 +1,20 @@
+2002-12-07 leon.zhang  <leon.zhang@sun.com>
+
+        * component-factory.c ():  Choose default account as sender when
+        create messages from local inbox folder; Choose current account
+        as sender when compose messages in other folders.
+
+        * mail-callbacks.c (send_to_url): Create composer base on source
+        account info from parent folder physical uri.
+
+        * mail-callbacks.h (send_to_url): Add a new parameter for parent
+        folder uri.
+
+        * mail-display.c (on_link_clicked): Apply new format of function:
+        send_to_url.
+
+        Fixes bug #35289.
+
 2002-12-02  Jeffrey Stedfast  <fejj@ximian.com>
 
 	* mail-callbacks.c (guess_me_from_accounts): Use the same logic as
Index: component-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/component-factory.c,v
retrieving revision 1.290.2.1
diff -u -r1.290.2.1 component-factory.c
--- component-factory.c	3 Dec 2002 16:05:47 -0000	1.290.2.1
+++ component-factory.c	8 Dec 2002 15:10:18 -0000
@@ -860,7 +860,7 @@
 	
 	/* FIXME: Sigh.  This shouldn't be here.  But the code is messy, so
 	   I'll just put it here anyway.  */
-	send_to_url (uri);
+	send_to_url (uri, NULL);
 }
 
 static void
@@ -871,7 +871,12 @@
 			 gpointer data)
 {
 	if (!strcmp (id, "message")) {
-		send_to_url (NULL);
+		if (strncmp(parent_folder_physical_uri, "file:", 5) == 0) {
+			send_to_url (NULL, NULL);
+		} else {
+			send_to_url (NULL, parent_folder_physical_uri);
+		}
+
 		return;
 	} else if (!strcmp (id, "post")) {
 		post_to_url (parent_folder_physical_uri);
Index: mail-callbacks.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-callbacks.c,v
retrieving revision 1.399.2.1
diff -u -r1.399.2.1 mail-callbacks.c
--- mail-callbacks.c	3 Dec 2002 16:05:50 -0000	1.399.2.1
+++ mail-callbacks.c	8 Dec 2002 15:10:25 -0000
@@ -868,18 +868,24 @@
 
 /* Send according to a mailto (RFC 2368) URL. */
 void
-send_to_url (const char *url)
+send_to_url (const char *url, const char *parent_uri)
 {
 	struct _composer_callback_data *ccd;
 	GtkWidget *composer;
+	MailConfigAccount *account;
 	
 	/* FIXME: no way to get folder browser? Not without
 	 * big pain in the ass, as far as I can tell */
 	if (!check_send_configuration (NULL))
 		return;
-	
-	/* Tell create_msg_composer to use the default email profile */
-	composer = create_msg_composer (NULL, FALSE, url);
+
+       if (parent_uri) {
+		account = mail_config_get_account_by_source_url (parent_uri);
+		composer = create_msg_composer (account, FALSE, NULL);
+	} else {
+		composer = create_msg_composer (NULL, FALSE, url);
+	}
+
 	if (!composer)
 		return;
 	
Index: mail-callbacks.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-callbacks.h,v
retrieving revision 1.51
diff -u -r1.51 mail-callbacks.h
--- mail-callbacks.h	5 Aug 2002 18:33:04 -0000	1.51
+++ mail-callbacks.h	8 Dec 2002 15:10:25 -0000
@@ -48,7 +48,7 @@
 void send_queued_mail      (GtkWidget *widget, gpointer user_data);
 
 void compose_msg           (GtkWidget *widget, gpointer user_data);
-void send_to_url           (const char *url);
+void send_to_url           (const char *url, const char *parent_uri);
 
 void forward_inline        (GtkWidget *widget, gpointer user_data);
 void forward_quoted        (GtkWidget *widget, gpointer user_data);
Index: mail-display.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-display.c,v
retrieving revision 1.235.2.3
diff -u -r1.235.2.3 mail-display.c
--- mail-display.c	22 Nov 2002 18:31:19 -0000	1.235.2.3
+++ mail-display.c	8 Dec 2002 15:10:29 -0000
@@ -303,7 +303,7 @@
 	if (!g_strncasecmp (url, "news:", 5) || !g_strncasecmp (url, "nntp:", 5)) {
 		g_warning ("Can't handle news URLs yet.");
 	} else if (!g_strncasecmp (url, "mailto:", 7)) {
-		send_to_url (url);
+		send_to_url (url, NULL);
 	} else if (*url == '#') {
 		mail_display_jump_to_anchor (md, url);
 	} else {
