Fixes the parsing of outgoing port numbers for preset providers
pmo-trunk-r8813
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (dialog);
protocol_registry = modest_runtime_get_protocol_registry ();
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (dialog);
protocol_registry = modest_runtime_get_protocol_registry ();
- incoming_account = modest_account_settings_get_store_settings (settings);
- outgoing_account = modest_account_settings_get_transport_settings (settings);
-
account_name = modest_account_settings_get_account_name (settings);
/* Save the account name so we can refer to it later: */
account_name = modest_account_settings_get_account_name (settings);
/* Save the account name so we can refer to it later: */
hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_leave_messages),
modest_account_settings_get_leave_messages_on_server (settings));
hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_leave_messages),
modest_account_settings_get_leave_messages_on_server (settings));
+ incoming_account = modest_account_settings_get_store_settings (settings);
if (incoming_account) {
const gchar *username, *password, *hostname, *proto_str, *account_title;
gchar *proto_name, *title;
if (incoming_account) {
const gchar *username, *password, *hostname, *proto_str, *account_title;
gchar *proto_name, *title;
if (provider_id) {
ModestProtocolType transport_provider_server_type;
ModestProtocolType transport_provider_security;
if (provider_id) {
ModestProtocolType transport_provider_server_type;
ModestProtocolType transport_provider_security;
/* Use presets */
transport_hostname = modest_presets_get_server (priv->presets, provider_id,
/* Use presets */
transport_hostname = modest_presets_get_server (priv->presets, provider_id,
/* Note: We need something as default, or modest_account_mgr_add_server_account will fail. */
transport_protocol = transport_provider_server_type;
transport_security = transport_provider_security;
/* Note: We need something as default, or modest_account_mgr_add_server_account will fail. */
transport_protocol = transport_provider_server_type;
transport_security = transport_provider_security;
- if (transport_security == MODEST_PROTOCOLS_CONNECTION_SSL) {
- /* printf("DEBUG: %s: using secure SMTP\n", __FUNCTION__); */
- /* we check if there is a *special* port */
- special_port = modest_presets_get_port (priv->presets, provider_id,
- FALSE /* transport */);
- if (special_port != 0)
- transport_port = special_port;
- else
- transport_port = 465;
- transport_auth_protocol = MODEST_PROTOCOLS_AUTH_PASSWORD;
+ is_secure = modest_protocol_registry_protocol_type_is_secure (modest_runtime_get_protocol_registry (),
+ transport_security);
+
+ /* we check if there is a *special* port */
+ special_port = modest_presets_get_port (priv->presets, provider_id,
+ FALSE /* transport */);
+ if (special_port != 0) {
+ transport_port = special_port;
- /* printf("DEBUG: %s: using non-secure SMTP\n", __FUNCTION__); */
- transport_auth_protocol = MODEST_PROTOCOLS_AUTH_NONE;
+ gboolean use_alternate_port = FALSE;
+ if (transport_security == MODEST_PROTOCOLS_CONNECTION_SSL)
+ use_alternate_port = TRUE;
+ transport_port = get_port_from_protocol(transport_provider_server_type, use_alternate_port);
+ if (is_secure)
+ transport_auth_protocol = MODEST_PROTOCOLS_AUTH_PASSWORD;
+ else
+ transport_auth_protocol = MODEST_PROTOCOLS_AUTH_NONE;
+
modest_server_account_settings_set_security_protocol (transport_settings,
transport_security);
modest_server_account_settings_set_auth_protocol (transport_settings,
modest_server_account_settings_set_security_protocol (transport_settings,
transport_security);
modest_server_account_settings_set_auth_protocol (transport_settings,
/* Get security */
#ifdef MODEST_TOOLKIT_HILDON2
/* Get security */
#ifdef MODEST_TOOLKIT_HILDON2
modest_serversecurity_picker_get_active_serversecurity (MODEST_SERVERSECURITY_PICKER (priv->security_view));
modest_serversecurity_picker_get_active_serversecurity (MODEST_SERVERSECURITY_PICKER (priv->security_view));
+ state->port =
+ modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (priv->security_view));
modest_serversecurity_combo_box_get_active_serversecurity (MODEST_SERVERSECURITY_COMBO_BOX (priv->security_view));
modest_serversecurity_combo_box_get_active_serversecurity (MODEST_SERVERSECURITY_COMBO_BOX (priv->security_view));
+ state->port =
+ modest_serversecurity_combo_box_get_active_serversecurity_port (MODEST_SERVERSECURITY_COMBO_BOX (priv->security_view));