* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
#include "modest-easysetup-wizard.h"
#include <glib/gi18n.h>
#include "maemo/modest-connection-specific-smtp-window.h"
#include "widgets/modest-ui-constants.h"
#include "maemo/modest-account-settings-dialog.h"
+#include "maemo/modest-maemo-utils.h"
#include <gconf/gconf-client.h>
#include <string.h> /* For strlen(). */
typedef struct _ModestEasysetupWizardDialogPrivate ModestEasysetupWizardDialogPrivate;
+typedef enum {
+ MODEST_EASYSETUP_WIZARD_DIALOG_INCOMING_CHANGED = 0x01,
+ MODEST_EASYSETUP_WIZARD_DIALOG_OUTGOING_CHANGED = 0x02
+} ModestEasysetupWizardDialogServerChanges;
+
struct _ModestEasysetupWizardDialogPrivate
{
ModestPresets *presets;
+
+ /* Remember what fields the user edited manually to not prefill them
+ * again. */
+ ModestEasysetupWizardDialogServerChanges server_changes;
};
static void
/** This is a convenience function to create a caption containing a mandatory widget.
* When the widget is edited, the enable_buttons() vfunc will be called.
*/
-static GtkWidget* create_caption_new_with_asterix(ModestEasysetupWizardDialog *self,
+static GtkWidget* create_caption_new_with_asterisk(ModestEasysetupWizardDialog *self,
GtkSizeGroup *group,
const gchar *value,
GtkWidget *control,
GtkWidget *icon,
HildonCaptionStatus flag)
{
- GtkWidget *caption = hildon_caption_new (group, value, control, icon, flag);
+ GtkWidget *caption = NULL;
-/* The translated strings seem to already contain the *,
- * but this code can be used if that is not true in future.
- */
-#if 0
+ /* Note: Previously, the translated strings already contained the "*",
+ * Comment out this code if they do again.
+ */
/* Add a * character to indicate mandatory fields,
* as specified in our "Email UI Specification": */
if (flag == HILDON_CAPTION_MANDATORY) {
}
else
caption = hildon_caption_new (group, value, control, icon, flag);
-#endif
/* Connect to the appropriate changed signal for the widget,
* so we can ask for the prev/next buttons to be enabled/disabled appropriately:
{
GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
GtkWidget *label = gtk_label_new(_("mcen_ia_emailsetup_intro"));
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ /* So that it is not truncated: */
+ gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
gtk_widget_show (GTK_WIDGET (box));
{
GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
GtkWidget *label = gtk_label_new(_("mcen_ia_accountdetails"));
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (label);
/* The country widgets: */
self->combo_account_country = GTK_WIDGET (easysetup_country_combo_box_new ());
- GtkWidget *caption = create_caption_new_with_asterix (self, sizegroup, _("mcen_fi_country"),
+ GtkWidget *caption = create_caption_new_with_asterisk (self, sizegroup, _("mcen_fi_country"),
self->combo_account_country, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->combo_account_country);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
/* The service provider widgets: */
self->combo_account_serviceprovider = GTK_WIDGET (easysetup_provider_combo_box_new ());
- caption = create_caption_new_with_asterix (self, sizegroup, _("mcen_fi_serviceprovider"),
+ caption = create_caption_new_with_asterisk (self, sizegroup, _("mcen_fi_serviceprovider"),
self->combo_account_serviceprovider, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->combo_account_serviceprovider);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
g_free (default_account_name);
default_account_name = NULL;
- caption = create_caption_new_with_asterix (self, sizegroup, _("mcen_fi_account_title"),
+ caption = create_caption_new_with_asterisk (self, sizegroup, _("mcen_fi_account_title"),
self->entry_account_title, NULL, HILDON_CAPTION_MANDATORY);
gtk_widget_show (self->entry_account_title);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_entry_set_max_length (GTK_ENTRY (self->entry_user_name), 64);
modest_validating_entry_set_max_func (MODEST_VALIDATING_ENTRY (self->entry_user_name),
on_entry_max, self);
- GtkWidget *caption = create_caption_new_with_asterix (self, sizegroup,
+ GtkWidget *caption = create_caption_new_with_asterisk (self, sizegroup,
_("mcen_li_emailsetup_name"), self->entry_user_name, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->entry_user_name);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
self->entry_user_username = GTK_WIDGET (modest_validating_entry_new ());
/* Auto-capitalization is the default, so let's turn it off: */
hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_user_username), HILDON_GTK_INPUT_MODE_FULL);
- caption = create_caption_new_with_asterix (self, sizegroup, _("mail_fi_username"),
+ caption = create_caption_new_with_asterisk (self, sizegroup, _("mail_fi_username"),
self->entry_user_username, NULL, HILDON_CAPTION_MANDATORY);
gtk_widget_show (self->entry_user_username);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE);
gtk_entry_set_visibility (GTK_ENTRY (self->entry_user_password), FALSE);
/* gtk_entry_set_invisible_char (GTK_ENTRY (self->entry_user_password), '*'); */
- caption = create_caption_new_with_asterix (self, sizegroup,
+ caption = create_caption_new_with_asterisk (self, sizegroup,
_("mail_fi_password"), self->entry_user_password, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->entry_user_password);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
self->entry_user_email = GTK_WIDGET (modest_validating_entry_new ());
/* Auto-capitalization is the default, so let's turn it off: */
hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_user_email), HILDON_GTK_INPUT_MODE_FULL);
- caption = create_caption_new_with_asterix (self, sizegroup,
+ caption = create_caption_new_with_asterisk (self, sizegroup,
_("mcen_li_emailsetup_email_address"), self->entry_user_email, NULL, HILDON_CAPTION_MANDATORY);
gtk_entry_set_text (GTK_ENTRY (self->entry_user_email), EXAMPLE_EMAIL_ADDRESS); /* Default text. */
gtk_widget_show (self->entry_user_email);
static GtkWidget* create_page_complete_easysetup (ModestEasysetupWizardDialog *self)
{
GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
+
GtkWidget *label = gtk_label_new(_("mcen_ia_emailsetup_setup_complete"));
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
+ gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
+
+ label = gtk_label_new (_("mcen_ia_easysetup_complete"));
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
+ gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+ gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
+ gtk_widget_show (label);
+
gtk_widget_show (GTK_WIDGET (box));
return GTK_WIDGET (box);
}
ModestEasysetupWizardDialog *self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data);
update_incoming_server_title (self);
update_incoming_server_security_choices (self);
+
+ set_default_custom_servernames (self);
}
-
+
+static void on_entry_incoming_servername_changed(GtkEntry *entry, gpointer user_data)
+{
+ ModestEasysetupWizardDialog *self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data);
+ ModestEasysetupWizardDialogPrivate *priv = WIZARD_DIALOG_GET_PRIVATE (self);
+ priv->server_changes |= MODEST_EASYSETUP_WIZARD_DIALOG_INCOMING_CHANGED;
+}
+
static GtkWidget* create_page_custom_incoming (ModestEasysetupWizardDialog *self)
{
GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
+
+ /* Show note that account type cannot be changed in future: */
+ GtkWidget *label = gtk_label_new (_("mcen_ia_emailsetup_account_type"));
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
+ gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
+ gtk_widget_show (label);
/* Create a size group to be used by all captions.
* Note that HildonCaption does not create a default size group if we do not specify one.
self->combo_incoming_servertype = GTK_WIDGET (easysetup_servertype_combo_box_new ());
easysetup_servertype_combo_box_set_active_servertype (
EASYSETUP_SERVERTYPE_COMBO_BOX (self->combo_incoming_servertype), MODEST_PROTOCOL_STORE_POP);
- GtkWidget *caption = create_caption_new_with_asterix (self, sizegroup,
+ GtkWidget *caption = create_caption_new_with_asterisk (self, sizegroup,
_("mcen_li_emailsetup_type"), self->combo_incoming_servertype, NULL, HILDON_CAPTION_MANDATORY);
gtk_widget_show (self->combo_incoming_servertype);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
/* The caption title will be updated in update_incoming_server_title().
* so this default text will never be seen: */
/* (Note: Changing the title seems pointless. murrayc) */
- self->caption_incoming = create_caption_new_with_asterix (self, sizegroup,
+ self->caption_incoming = create_caption_new_with_asterisk (self, sizegroup,
"Incoming Server", self->entry_incomingserver, NULL, HILDON_CAPTION_MANDATORY);
update_incoming_server_title (self);
gtk_widget_show (self->entry_incomingserver);
* as in the UI spec: */
g_signal_connect (G_OBJECT (self->combo_incoming_servertype), "changed",
G_CALLBACK (on_combo_servertype_changed), self);
-
+
+ /* Remember when the servername was changed manually: */
+ g_signal_connect (G_OBJECT (self->entry_incomingserver), "changed",
+ G_CALLBACK (on_entry_incoming_servername_changed), self);
+
/* The secure connection widgets: */
if (!self->combo_incoming_security)
self->combo_incoming_security = GTK_WIDGET (modest_serversecurity_combo_box_new ());
gtk_widget_show (self->specific_window);
}
+static void on_entry_outgoing_servername_changed (GtkEntry *entry, gpointer user_data)
+{
+ ModestEasysetupWizardDialog *self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data);
+ ModestEasysetupWizardDialogPrivate *priv = WIZARD_DIALOG_GET_PRIVATE (self);
+ priv->server_changes |= MODEST_EASYSETUP_WIZARD_DIALOG_OUTGOING_CHANGED;
+}
+
static GtkWidget* create_page_custom_outgoing (ModestEasysetupWizardDialog *self)
{
GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
self->entry_outgoingserver = gtk_entry_new ();
/* Auto-capitalization is the default, so let's turn it off: */
hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_outgoingserver), HILDON_GTK_INPUT_MODE_FULL);
- GtkWidget *caption = create_caption_new_with_asterix (self, sizegroup,
+ GtkWidget *caption = create_caption_new_with_asterisk (self, sizegroup,
_("mcen_li_emailsetup_smtp"), self->entry_outgoingserver, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->entry_outgoingserver);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
g_signal_connect (G_OBJECT (self->button_outgoing_smtp_servers), "clicked",
G_CALLBACK (on_button_outgoing_smtp_servers), self);
+
+ g_signal_connect (G_OBJECT (self->entry_outgoingserver), "changed",
+ G_CALLBACK (on_entry_outgoing_servername_changed), self);
gtk_widget_show (GTK_WIDGET (box));
{
GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
GtkWidget *label = gtk_label_new(_("mcen_ia_emailsetup_setup_complete"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+ gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
+ gtk_widget_show (label);
+
+ label = gtk_label_new (_("mcen_ia_customsetup_complete"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
}
g_assert(priv->presets);
-
-
+
+ /* The server fields did not have been manually changed yet */
+ priv->server_changes = 0;
+
/* Get the account manager object,
* so we can check for existing accounts,
* and create new accounts: */
* because we need _some_ final page to enable the Next and Finish buttons: */
create_subsequent_easysetup_pages (self);
-
/* Connect to the dialog's response signal so we can enable/disable buttons
* for the newly-selected page, because the prev/next buttons cause response to be emitted.
* Note that we use g_signal_connect_after() instead of g_signal_connect()
*/
g_signal_connect_after (G_OBJECT (self), "response",
G_CALLBACK (on_response), self);
-
+
/* When this window is shown, hibernation should not be possible,
* because there is no sensible way to save the state: */
modest_window_mgr_prevent_hibernation_while_window_is_shown (
static void set_default_custom_servernames (ModestEasysetupWizardDialog *account_wizard)
{
+ ModestEasysetupWizardDialogPrivate *priv = WIZARD_DIALOG_GET_PRIVATE(account_wizard);
+
if (!account_wizard->entry_incomingserver)
return;
/* Set a default domain for the server, based on the email address,
* if no server name was already specified.
*/
- const gchar* incoming_existing = gtk_entry_get_text (GTK_ENTRY (account_wizard->entry_incomingserver));
- if ((!incoming_existing || (strlen(incoming_existing) == 0))
- && account_wizard->entry_user_email) {
+ if (account_wizard->entry_user_email
+ && ((priv->server_changes & MODEST_EASYSETUP_WIZARD_DIALOG_INCOMING_CHANGED) == 0)) {
const ModestTransportStoreProtocol protocol = easysetup_servertype_combo_box_get_active_servertype (
EASYSETUP_SERVERTYPE_COMBO_BOX (account_wizard->combo_incoming_servertype));
const gchar* email_address = gtk_entry_get_text (GTK_ENTRY(account_wizard->entry_user_email));
gchar* servername = util_get_default_servername_from_email_address (email_address, protocol);
+
+ /* Do not set the INCOMING_CHANGED flag because of this edit */
+ g_signal_handlers_block_by_func (G_OBJECT (account_wizard->entry_incomingserver), G_CALLBACK (on_entry_incoming_servername_changed), account_wizard);
gtk_entry_set_text (GTK_ENTRY (account_wizard->entry_incomingserver), servername);
+ g_signal_handlers_unblock_by_func (G_OBJECT (account_wizard->entry_incomingserver), G_CALLBACK (on_entry_incoming_servername_changed), account_wizard);
+
g_free (servername);
}
if (!account_wizard->entry_outgoingserver)
return;
- const gchar* outgoing_existing = gtk_entry_get_text (GTK_ENTRY (account_wizard->entry_outgoingserver));
- if ((!outgoing_existing || (strlen(outgoing_existing) == 0))
- && account_wizard->entry_user_email) {
+ if (account_wizard->entry_user_email
+ && ((priv->server_changes & MODEST_EASYSETUP_WIZARD_DIALOG_OUTGOING_CHANGED) == 0)) {
const gchar* email_address = gtk_entry_get_text (GTK_ENTRY(account_wizard->entry_user_email));
gchar* servername = util_get_default_servername_from_email_address (email_address, MODEST_PROTOCOL_TRANSPORT_SMTP);
+
+ /* Do not set the OUTGOING_CHANGED flag because of this edit */
+ g_signal_handlers_block_by_func (G_OBJECT (account_wizard->entry_outgoingserver), G_CALLBACK (on_entry_outgoing_servername_changed), account_wizard);
gtk_entry_set_text (GTK_ENTRY (account_wizard->entry_outgoingserver), servername);
+ g_signal_handlers_unblock_by_func (G_OBJECT (account_wizard->entry_outgoingserver), G_CALLBACK (on_entry_outgoing_servername_changed), account_wizard);
+
g_free (servername);
}
}
}
else if (next_page == account_wizard->page_custom_outgoing) {
set_default_custom_servernames (account_wizard);
+ /* Check if the server support secure authentication */
+ if (gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (account_wizard->checkbox_incoming_auth))) {
+#if 0
+ const ModestTransportStoreProtocol protocol =
+ easysetup_servertype_combo_box_get_active_servertype (
+ EASYSETUP_SERVERTYPE_COMBO_BOX (account_wizard->combo_incoming_servertype));
+ const gchar* hostname = gtk_entry_get_text(GTK_ENTRY(account_wizard->entry_incomingserver));
+ /* FIXME: Get correct port */
+
+ int port_num = 22;
+ GList *list_auth_methods =
+ modest_maemo_utils_get_supported_secure_authentication_methods (
+ protocol,
+ hostname, port_num, GTK_WINDOW (dialog));
+ if (list_auth_methods) {
+ /* TODO: Select the correct method */
+ g_list_free (list_auth_methods);
+ }
+ else
+ {
+ GtkWidget* error_dialog = gtk_message_dialog_new(GTK_WINDOW(dialog),
+ GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK, _("Server does not support secure authentication!"));
+ gtk_dialog_run(GTK_DIALOG(error_dialog));
+ gtk_widget_destroy(error_dialog);
+ return FALSE;
+ }
+#endif
+ }
}
/* If this is the last page, and this is a click on Finish,
/* Note: We need something as default for the ModestTransportStoreProtocol* values,
* or modest_account_mgr_add_server_account will fail. */
gchar* servername_incoming = NULL;
+ guint serverport_incoming = 0;
ModestTransportStoreProtocol protocol_incoming = MODEST_PROTOCOL_STORE_POP;
ModestConnectionProtocol protocol_security_incoming = MODEST_PROTOCOL_CONNECTION_NORMAL;
ModestAuthProtocol protocol_authentication_incoming = MODEST_PROTOCOL_AUTH_NONE;
/* Get details from the specified presets: */
gchar* provider_id = easysetup_provider_combo_box_get_active_provider_id (
EASYSETUP_PROVIDER_COMBO_BOX (self->combo_account_serviceprovider));
- if(provider_id) {
+ if (provider_id) {
/* Use presets: */
-
servername_incoming = modest_presets_get_server (priv->presets, provider_id,
TRUE /* incoming */);
- ModestPresetsServerType servertype_incoming = modest_presets_get_info_server_type (priv->presets, provider_id,
+ ModestPresetsServerType servertype_incoming = modest_presets_get_info_server_type (priv->presets,
+ provider_id,
+ TRUE /* incoming */);
+ ModestPresetsSecurity security_incoming = modest_presets_get_info_server_security (priv->presets,
+ provider_id,
TRUE /* incoming */);
+
+ g_warning ("security incoming: %x", security_incoming);
-
/* We don't check for SMTP here as that is impossible for an incoming server. */
- if (servertype_incoming == MODEST_PRESETS_SERVER_TYPE_IMAP)
+ if (servertype_incoming == MODEST_PRESETS_SERVER_TYPE_IMAP) {
protocol_incoming = MODEST_PROTOCOL_STORE_IMAP;
- else if (servertype_incoming == MODEST_PRESETS_SERVER_TYPE_POP)
+ serverport_incoming =
+ (security_incoming & MODEST_PRESETS_SECURITY_SECURE_INCOMING_ALTERNATE_PORT) ? 993 : 143;
+ } else if (servertype_incoming == MODEST_PRESETS_SERVER_TYPE_POP) {
protocol_incoming = MODEST_PROTOCOL_STORE_POP;
+ serverport_incoming =
+ (security_incoming & MODEST_PRESETS_SECURITY_SECURE_INCOMING_ALTERNATE_PORT) ? 995 : 110;
+ }
- ModestPresetsSecurity security_incoming = modest_presets_get_info_server_security (priv->presets, provider_id,
- TRUE /* incoming */);
-
-
if (security_incoming & MODEST_PRESETS_SECURITY_SECURE_INCOMING)
protocol_security_incoming = MODEST_PROTOCOL_CONNECTION_SSL; /* TODO: Is this what we want? */
protocol_authentication_incoming = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->checkbox_incoming_auth))
? MODEST_PROTOCOL_AUTH_CRAMMD5
: MODEST_PROTOCOL_AUTH_PASSWORD;
-
}
/* First we add the 2 server accounts, and then we add the account that uses them.
gboolean created = modest_account_mgr_add_server_account (self->account_manager,
store_name,
servername_incoming,
+ serverport_incoming,
username, password,
protocol_incoming,
protocol_security_incoming,
ModestTransportStoreProtocol protocol_outgoing = MODEST_PROTOCOL_STORE_POP;
ModestConnectionProtocol protocol_security_outgoing = MODEST_PROTOCOL_CONNECTION_NORMAL;
ModestAuthProtocol protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_NONE;
+ guint serverport_outgoing = 0;
- if(provider_id) {
+ if (provider_id) {
/* Use presets: */
servername_outgoing = modest_presets_get_server (priv->presets, provider_id,
FALSE /* incoming */);
- ModestPresetsServerType servertype_outgoing = modest_presets_get_info_server_type (priv->presets, provider_id,
+ ModestPresetsServerType servertype_outgoing = modest_presets_get_info_server_type (priv->presets,
+ provider_id,
FALSE /* incoming */);
/* Note: We need something as default, or modest_account_mgr_add_server_account will fail. */
FALSE /* incoming */);
protocol_security_outgoing = MODEST_PROTOCOL_CONNECTION_NORMAL;
- if (security_outgoing & MODEST_PRESETS_SECURITY_SECURE_SMTP)
+ if (security_outgoing & MODEST_PRESETS_SECURITY_SECURE_SMTP) {
protocol_security_outgoing = MODEST_PROTOCOL_CONNECTION_SSL; /* TODO: Is this what we want? */
-
- protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_NONE;
+ serverport_outgoing = 465;
+ protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_PASSWORD;
+ } else
+ protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_NONE;
/* TODO: There is no SMTP authentication enum for presets. */
}
else {
created = modest_account_mgr_add_server_account (self->account_manager,
transport_name,
servername_outgoing,
+ serverport_outgoing,
username, password,
protocol_outgoing,
protocol_security_outgoing,
modest_account_mgr_set_string (self->account_manager, account_name,
MODEST_ACCOUNT_DISPLAY_NAME, display_name, FALSE /* not server account */);
+ /* Set retrieve type */
+ const gchar *retrieve = MODEST_ACCOUNT_RETRIEVE_VALUE_HEADERS_ONLY;
+ modest_account_mgr_set_string (self->account_manager, account_name,
+ MODEST_ACCOUNT_RETRIEVE, retrieve, FALSE /* not server account */);
+
/* Save the connection-specific SMTP server accounts. */
gboolean result = TRUE;
if (self->specific_window)
return result;
}
-
-