diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-01-13 13:59:32 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-01-13 13:59:32 +0800 |
commit | f88c5b4073c70a294157094d2108795c3f160d32 (patch) | |
tree | b5deabcacf24d91a4f70d144ff8136cd7b64958a /mail | |
parent | 771f82cebe9a0113e75bc58db3eb8fde3878ed6b (diff) | |
download | gsoc2013-evolution-f88c5b4073c70a294157094d2108795c3f160d32.tar.gz gsoc2013-evolution-f88c5b4073c70a294157094d2108795c3f160d32.tar.zst gsoc2013-evolution-f88c5b4073c70a294157094d2108795c3f160d32.zip |
Get the X-Evolution-Transport URL and use that if it exists, else fall
2001-01-13 Jeffrey Stedfast <fejj@ximian.com>
* mail-ops.c (do_send_queue): Get the X-Evolution-Transport URL
and use that if it exists, else fall back on the default
transport.
* mail-callbacks.c (composer_postpone_cb): Set an
X-Evolution-Transport header.
svn path=/trunk/; revision=7474
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 10 | ||||
-rw-r--r-- | mail/mail-ops.c | 10 |
3 files changed, 26 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index f2dbf4a922..8ccd4fc80f 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-01-13 Jeffrey Stedfast <fejj@ximian.com> + + * mail-ops.c (do_send_queue): Get the X-Evolution-Transport URL + and use that if it exists, else fall back on the default + transport. + + * mail-callbacks.c (composer_postpone_cb): Set an + X-Evolution-Transport header. + 2001-01-12 Jeffrey Stedfast <fejj@ximian.com> * Makefile.am: Removed GPG_* variables. diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 636f95aecd..47122737c3 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -208,8 +208,6 @@ send_queued_mail (GtkWidget *widget, gpointer user_data) return; } - /* FIXME: use the preferred transport for each message */ - account = mail_config_get_default_account (); if (!account || !account->transport) { GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), @@ -363,6 +361,7 @@ composer_send_cb (EMsgComposer *composer, gpointer data) void composer_postpone_cb (EMsgComposer *composer, gpointer data) { + const MailConfigAccount *account = NULL; extern CamelFolder *outbox_folder; CamelMimeMessage *message; struct post_send_data *psd = data; @@ -380,6 +379,13 @@ composer_postpone_cb (EMsgComposer *composer, gpointer data) } } + /* Attach a X-Evolution-Transport header so we know which account + to use when it gets sent later. */ + account = e_msg_composer_get_preferred_account (composer); + if (!account) + account = mail_config_get_default_account (); + camel_medium_add_header (CAMEL_MEDIUM (message), "X-Evolution-Transport", account->transport->url); + /* Save the message in Outbox */ mail_do_append_mail (outbox_folder, message, NULL); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 6dec663e7b..27351fe700 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -701,6 +701,7 @@ do_send_queue (gpointer in_data, gpointer op_data, CamelException *ex) for (i = 0; i < uids->len; i++) { CamelMimeMessage *message; + char *transport_url = NULL; message = camel_folder_get_message (input->folder_queue, uids->pdata[i], ex); if (camel_exception_is_set (ex)) @@ -710,7 +711,14 @@ do_send_queue (gpointer in_data, gpointer op_data, CamelException *ex) camel_mime_message_set_date (message, CAMEL_MESSAGE_DATE_CURRENT, 0); - xport = camel_session_get_transport (session, input->xport_uri, ex); + /* Get the preferred transport URI */ + transport_url = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Transport")); + if (transport_url) + camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Transport"); + + xport = camel_session_get_transport (session, transport_url ? transport_url : input->xport_uri, ex); + g_free (transport_url); + if (camel_exception_is_set (ex)) break; |