From 79c5e30e50e927b197bd1ecaad0abc6c4b128122 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 11 Jun 2007 16:50:17 +0000 Subject: [PATCH] 2007-06-11 Murray Cumming * src/maemo/easysetup/modest-presets.c: (modest_presets_get_info_server_security): Do not report secure auth if there is none. * src/modest-protocol-info.c: Use the defines for the gconf key names for secure authentication. This was not working because we were writing Password and reading password, and the check was case sensitive. With this, gmail now works for receiving and sending when created via easysetup. pmo-trunk-r2163 --- ChangeLog2 | 11 +++++++++++ src/maemo/easysetup/modest-easysetup-wizard.c | 10 +++++++--- src/maemo/easysetup/modest-presets.c | 1 - src/modest-protocol-info.c | 7 ++++--- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index d98cb0e..6d28fed 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,6 +1,17 @@ 2007-06-11 Murray Cumming * src/maemo/easysetup/modest-presets.c: + (modest_presets_get_info_server_security): Do not report secure auth + if there is none. + * src/modest-protocol-info.c: Use the defines for the gconf key names + for secure authentication. This was not working because we were writing + Password and reading password, and the check was case sensitive. + With this, gmail now works for receiving and sending when created via + easysetup. + +2007-06-11 Murray Cumming + + * src/maemo/easysetup/modest-presets.c: (modest_presets_get_info_server_security): Correct the key name for SecureSmtp, because it seems to be case-sensitive. * src/maemo/easysetup/modest-wizard-dialog.c: (create_title): diff --git a/src/maemo/easysetup/modest-easysetup-wizard.c b/src/maemo/easysetup/modest-easysetup-wizard.c index 5495a43..7dd5fdd 100644 --- a/src/maemo/easysetup/modest-easysetup-wizard.c +++ b/src/maemo/easysetup/modest-easysetup-wizard.c @@ -1517,15 +1517,19 @@ create_account (ModestEasysetupWizardDialog *self, gboolean enabled) ModestPresetsSecurity security_outgoing = modest_presets_get_info_server_security (priv->presets, provider_id, FALSE /* incoming */); - + + /* TODO: There is no SMTP authentication enum for presets, + so we should probably check what the server supports. */ protocol_security_outgoing = MODEST_PROTOCOL_CONNECTION_NORMAL; if (security_outgoing & MODEST_PRESETS_SECURITY_SECURE_SMTP) { + /* printf("DEBUG: %s: using secure SMTP\n", __FUNCTION__); */ protocol_security_outgoing = MODEST_PROTOCOL_CONNECTION_SSL; /* TODO: Is this what we want? */ serverport_outgoing = 465; protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_PASSWORD; - } else + } else { + /* printf("DEBUG: %s: using non-secure SMTP\n", __FUNCTION__); */ protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_NONE; - /* TODO: There is no SMTP authentication enum for presets. */ + } } else { /* Use custom pages because no preset was specified: */ diff --git a/src/maemo/easysetup/modest-presets.c b/src/maemo/easysetup/modest-presets.c index 7511dd1..d3c5553 100644 --- a/src/maemo/easysetup/modest-presets.c +++ b/src/maemo/easysetup/modest-presets.c @@ -268,7 +268,6 @@ modest_presets_get_info_server_security (ModestPresets *self, const gchar *provi MODEST_PRESETS_KEY_OUTGOING, NULL); if (val) { g_free (val); - info |= MODEST_PRESETS_SECURITY_SECURE_SMTP; val = g_key_file_get_string (self->keyfile, provider_id, MODEST_PRESETS_KEY_SECURE_SMTP, NULL); diff --git a/src/modest-protocol-info.c b/src/modest-protocol-info.c index 503d15a..b0ce303 100644 --- a/src/modest-protocol-info.c +++ b/src/modest-protocol-info.c @@ -31,6 +31,7 @@ #include /* strcmp */ #include #include +#include typedef struct { @@ -60,9 +61,9 @@ static const ProtocolInfo ConnectionProtocolMap[] = { /* FIXME: these names must match those of tny_camel_account_get_supported_secure_auth */ static const ProtocolInfo AuthProtocolMap[] = { - { MODEST_PROTOCOL_AUTH_NONE, "none", N_("None") }, - { MODEST_PROTOCOL_AUTH_PASSWORD, "Password", N_("Password") }, - { MODEST_PROTOCOL_AUTH_CRAMMD5, "cram-md5", N_("Cram MD5") } + { MODEST_PROTOCOL_AUTH_NONE, MODEST_ACCOUNT_AUTH_MECH_VALUE_NONE, N_("None") }, + { MODEST_PROTOCOL_AUTH_PASSWORD, MODEST_ACCOUNT_AUTH_MECH_VALUE_PASSWORD, N_("Password") }, + { MODEST_PROTOCOL_AUTH_CRAMMD5, MODEST_ACCOUNT_AUTH_MECH_VALUE_CRAMMD5, N_("Cram MD5") } }; -- 1.7.9.5