diff options
author | Gary Ching-Pang Lin <chingpang@gmail.com> | 2010-08-23 11:49:29 +0800 |
---|---|---|
committer | Gary Ching-Pang Lin <chingpang@gmail.com> | 2010-08-23 12:36:45 +0800 |
commit | 242593df87629e19d4614266861ebb8f19004f01 (patch) | |
tree | 7f6d9182c2092377c4c0242f0c248a3385a3c51a /mail | |
parent | ec9a3ed06d0f9b4d413be5710c416e65697aff22 (diff) | |
download | gsoc2013-evolution-242593df87629e19d4614266861ebb8f19004f01.tar.gz gsoc2013-evolution-242593df87629e19d4614266861ebb8f19004f01.tar.zst gsoc2013-evolution-242593df87629e19d4614266861ebb8f19004f01.zip |
Add encryption and authentication support for autoconfig
Bug 625627 - Fail to send mail with smtp.live.com with autoconfig
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-account-editor.c | 40 | ||||
-rw-r--r-- | mail/em-account-editor.h | 4 |
2 files changed, 41 insertions, 3 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 99ba81739c..a6d624e54b 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -3325,6 +3325,29 @@ emae_check_servers (const gchar *email) return NULL; } +static void +emae_check_set_authtype (GtkComboBox *dropdown, const gchar *auth) +{ + GtkTreeModel *model; + GtkTreeIter iter; + gint id; + gint children; + + model = gtk_combo_box_get_model (dropdown); + children = gtk_tree_model_iter_n_children (model, NULL); + for (id = 0; id < children; id++) { + CamelServiceAuthType *authtype; + + gtk_tree_model_iter_nth_child (model, &iter, NULL, id); + gtk_tree_model_get (model, &iter, 1, &authtype, -1); + if (g_ascii_strcasecmp (authtype->authproto, auth) == 0) + break; + } + + if (id < children) + gtk_combo_box_set_active (dropdown, id); +} + static gboolean emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) { @@ -3386,7 +3409,10 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) camel_url_set_user (url, user); if (sdata != NULL) { camel_url_set_protocol (url, sdata->proto); - camel_url_set_param (url, "use_ssl", sdata->ssl); + if (sdata->recv_sock && *sdata->recv_sock) + camel_url_set_param (url, "use_ssl", sdata->recv_sock); + else + camel_url_set_param (url, "use_ssl", sdata->ssl); camel_url_set_host (url, sdata->recv); if (sdata->recv_port && *sdata->recv_port) camel_url_set_port (url, atoi(sdata->recv_port)); @@ -3398,6 +3424,8 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) g_free (uri); uri = camel_url_to_string (url, 0); e_account_set_string (account, E_ACCOUNT_SOURCE_URL, uri); + if (sdata != NULL && sdata->recv_auth && *sdata->recv_auth) + emae_check_set_authtype (emae->priv->source.authtype, sdata->recv_auth); camel_url_free (url); } @@ -3423,7 +3451,10 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) if (sdata != NULL && uri && (url = camel_url_new (uri, NULL)) != NULL) { refresh = TRUE; camel_url_set_protocol (url, "smtp"); - camel_url_set_param (url, "use_ssl", sdata->ssl); + if (sdata->send_sock && *sdata->send_sock) + camel_url_set_param (url, "use_ssl", sdata->send_sock); + else + camel_url_set_param (url, "use_ssl", sdata->ssl); camel_url_set_host (url, sdata->send); if (sdata->send_port && *sdata->send_port) camel_url_set_port (url, atoi(sdata->send_port)); @@ -3437,7 +3468,10 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) g_free (uri); camel_url_free (url); gtk_toggle_button_set_active (emae->priv->transport.needs_auth, TRUE); - emae_authtype_changed(emae->priv->transport.authtype, &emae->priv->transport); + if (sdata->send_auth && *sdata->send_auth) + emae_check_set_authtype (emae->priv->transport.authtype, sdata->send_auth); + else + emae_authtype_changed(emae->priv->transport.authtype, &emae->priv->transport); uri = (gchar *)e_account_get_string (account, E_ACCOUNT_TRANSPORT_URL); } } diff --git a/mail/em-account-editor.h b/mail/em-account-editor.h index a8128afb6c..64f514b6a1 100644 --- a/mail/em-account-editor.h +++ b/mail/em-account-editor.h @@ -63,6 +63,10 @@ struct _server_data { const gchar *recv_user; const gchar *send_port; const gchar *recv_port; + const gchar *send_sock; + const gchar *recv_sock; + const gchar *send_auth; + const gchar *recv_auth; }; typedef enum { |