[evolution/account-mgmt: 38/51] Add 'mail-config' module.



commit 4b7750cbc449e5653eea143896582fd57cc583cd
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Feb 17 10:47:06 2012 -0500

    Add 'mail-config' module.
    
    This breaks a good chunk of logic out of EMAccountEditor and hopefully
    makes it less brittle.  Because honestly, every time I fix one thing in
    EMAccountEditor it breaks three other things.  It's unmaintainable.

 configure.ac                                       |    1 +
 modules/Makefile.am                                |    1 +
 modules/mail-config/Makefile.am                    |   32 ++
 modules/mail-config/e-mail-config-local-accounts.c |  415 +++++++++++++++++
 .../mail-config/e-mail-config-remote-accounts.c    |  475 ++++++++++++++++++++
 modules/mail-config/e-mail-config-transports.c     |  343 ++++++++++++++
 modules/mail-config/evolution-mail-config.c        |   39 ++
 7 files changed, 1306 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fb42caa..0482939 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1670,6 +1670,7 @@ modules/cal-config-weather/Makefile
 modules/cal-config-webcal/Makefile
 modules/composer-autosave/Makefile
 modules/connman/Makefile
+modules/mail-config/Makefile
 modules/mailto-handler/Makefile
 modules/mdn/Makefile
 modules/network-manager/Makefile
diff --git a/modules/Makefile.am b/modules/Makefile.am
index fb82c89..3c7ee10 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -46,6 +46,7 @@ SUBDIRS = \
 	$(CONFIG_WEATHER_DIR) \
 	cal-config-webcal \
 	composer-autosave \
+	mail-config \
 	mailto-handler \
 	mdn \
 	offline-alert \
diff --git a/modules/mail-config/Makefile.am b/modules/mail-config/Makefile.am
new file mode 100644
index 0000000..55b3138
--- /dev/null
+++ b/modules/mail-config/Makefile.am
@@ -0,0 +1,32 @@
+NULL =
+
+module_LTLIBRARIES = libevolution-module-mail-config.la
+
+libevolution_module_mail_config_la_CPPFLAGS =			\
+	$(AM_CPPFLAGS)						\
+	-I$(top_srcdir)						\
+	-I$(top_srcdir)/widgets					\
+	-DG_LOG_DOMAIN=\"evolution-mail-config\"		\
+	$(EVOLUTION_DATA_SERVER_CFLAGS)				\
+	$(GNOME_PLATFORM_CFLAGS)				\
+	$(NULL)
+
+libevolution_module_mail_config_la_SOURCES =			\
+	evolution-mail-config.c					\
+	e-mail-config-local-accounts.c				\
+	e-mail-config-remote-accounts.c				\
+	e-mail-config-transports.c				\
+	$(NULL)
+
+libevolution_module_mail_config_la_LIBADD =			\
+	$(top_builddir)/mail/libevolution-mail.la		\
+	$(top_builddir)/widgets/misc/libemiscwidgets.la		\
+	$(top_builddir)/libemail-engine/libemail-engine.la	\
+	$(EVOLUTION_DATA_SERVER_LIBS)				\
+	$(GNOME_PLATFORM_LIBS)					\
+	$(NULL)
+
+libevolution_module_mail_config_la_LDFLAGS =			\
+	-module -avoid-version $(NO_UNDEFINED)
+
+-include $(top_srcdir)/git.mk
diff --git a/modules/mail-config/e-mail-config-local-accounts.c b/modules/mail-config/e-mail-config-local-accounts.c
new file mode 100644
index 0000000..fbbed04
--- /dev/null
+++ b/modules/mail-config/e-mail-config-local-accounts.c
@@ -0,0 +1,415 @@
+/*
+ * e-mail-config-local-accounts.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include <config.h>
+#include <glib/gi18n-lib.h>
+
+#include <camel/camel.h>
+#include <libebackend/e-extension.h>
+
+#include <mail/e-mail-config-backend.h>
+
+/* Standard GObject macros */
+#define E_TYPE_MAIL_CONFIG_LOCAL \
+	(e_mail_config_local_get_type ())
+#define E_MAIL_CONFIG_LOCAL(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_MAIL_CONFIG_LOCAL, EMailConfigLocal))
+#define E_MAIL_CONFIG_LOCAL_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_MAIL_CONFIG_LOCAL, EMailConfigLocalClass))
+#define E_IS_MAIL_CONFIG_LOCAL(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_MAIL_CONFIG_LOCAL))
+#define E_IS_MAIL_CONFIG_LOCAL_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_MAIL_CONFIG_LOCAL))
+#define E_MAIL_CONFIG_LOCAL_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_MAIL_CONFIG_LOCAL, EMailConfigLocalClass))
+
+typedef struct _EMailConfigLocal EMailConfigLocal;
+typedef struct _EMailConfigLocalClass EMailConfigLocalClass;
+
+typedef EMailConfigLocal EMailConfigMH;
+typedef EMailConfigLocalClass EMailConfigMHClass;
+
+typedef EMailConfigLocal EMailConfigMbox;
+typedef EMailConfigLocalClass EMailConfigMboxClass;
+
+typedef EMailConfigLocal EMailConfigMaildir;
+typedef EMailConfigLocalClass EMailConfigMaildirClass;
+
+typedef EMailConfigLocal EMailConfigSpoolDir;
+typedef EMailConfigLocalClass EMailConfigSpoolDirClass;
+
+typedef EMailConfigLocal EMailConfigSpoolFile;
+typedef EMailConfigLocalClass EMailConfigSpoolFileClass;
+
+/* XXX For lack of a better place for this... */
+typedef EMailConfigBackend EMailConfigNone;
+typedef EMailConfigBackendClass EMailConfigNoneClass;
+
+typedef struct _Context Context;
+
+struct _EMailConfigLocal {
+	EMailConfigBackend parent;
+};
+
+struct _EMailConfigLocalClass {
+	EMailConfigBackendClass parent_class;
+
+	const gchar *file_chooser_label;
+	const gchar *file_chooser_title;
+	GtkFileChooserAction file_chooser_action;
+};
+
+struct _Context {
+	GtkWidget *file_chooser_label;
+	GtkWidget *file_chooser_button;
+};
+
+/* Forward Declarations */
+void		e_mail_config_local_accounts_register_types
+						(GTypeModule *type_module);
+GType		e_mail_config_local_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_mh_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_mbox_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_maildir_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_spool_dir_get_type
+						(void) G_GNUC_CONST;
+GType		e_mail_config_spool_file_get_type
+						(void) G_GNUC_CONST;
+GType		e_mail_config_none_get_type	(void) G_GNUC_CONST;
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (
+	EMailConfigLocal,
+	e_mail_config_local,
+	E_TYPE_MAIL_CONFIG_BACKEND,
+	G_TYPE_FLAG_ABSTRACT,
+	/* no custom code */)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigMH,
+	e_mail_config_mh,
+	E_TYPE_MAIL_CONFIG_LOCAL)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigMbox,
+	e_mail_config_mbox,
+	E_TYPE_MAIL_CONFIG_LOCAL)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigMaildir,
+	e_mail_config_maildir,
+	E_TYPE_MAIL_CONFIG_LOCAL)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigSpoolDir,
+	e_mail_config_spool_dir,
+	E_TYPE_MAIL_CONFIG_LOCAL)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigSpoolFile,
+	e_mail_config_spool_file,
+	E_TYPE_MAIL_CONFIG_LOCAL)
+
+/* XXX For lack of a better place for this... */
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigNone,
+	e_mail_config_none,
+	E_TYPE_MAIL_CONFIG_BACKEND)
+
+static void
+mail_config_local_context_free (Context *context)
+{
+	g_object_unref (context->file_chooser_label);
+	g_object_unref (context->file_chooser_button);
+
+	g_slice_free (Context, context);
+}
+
+static void
+mail_config_local_file_set_cb (GtkFileChooserButton *file_chooser_button,
+                               CamelLocalSettings *local_settings)
+{
+	GtkFileChooser *file_chooser;
+	gchar *path;
+
+	file_chooser = GTK_FILE_CHOOSER (file_chooser_button);
+
+	path = gtk_file_chooser_get_filename (file_chooser);
+	camel_local_settings_set_path (local_settings, path);
+	g_free (path);
+}
+
+static void
+mail_config_local_insert_widgets (EMailConfigBackend *backend,
+                                  ESource *scratch_source,
+                                  GtkBox *page)
+{
+	EMailConfig *config;
+	EMailConfigLocalClass *class;
+	CamelSettings *settings;
+	GtkFileChooser *file_chooser;
+	GtkLabel *label;
+	GtkWidget *widget;
+	GtkWidget *container;
+	Context *context;
+	const gchar *path;
+	const gchar *uid;
+
+	class = E_MAIL_CONFIG_LOCAL_GET_CLASS (backend);
+	config = e_mail_config_backend_get_config (backend);
+	settings = e_mail_config_get_settings (config, scratch_source);
+
+	context = g_slice_new (Context);
+	uid = e_source_get_uid (scratch_source);
+
+	g_object_set_data_full (
+		G_OBJECT (backend), uid, context,
+		(GDestroyNotify) mail_config_local_context_free);
+
+	widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+	gtk_box_pack_start (page, widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	widget = gtk_label_new_with_mnemonic (class->file_chooser_label);
+	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+	context->file_chooser_label = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	widget = gtk_file_chooser_button_new (
+		class->file_chooser_title,
+		class->file_chooser_action);
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+	context->file_chooser_button = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	g_signal_connect (
+		widget, "file-set",
+		G_CALLBACK (mail_config_local_file_set_cb),
+		CAMEL_LOCAL_SETTINGS (settings));
+
+	file_chooser = GTK_FILE_CHOOSER (context->file_chooser_button);
+	path = camel_local_settings_get_path (CAMEL_LOCAL_SETTINGS (settings));
+	if (path != NULL)
+		gtk_file_chooser_set_filename (file_chooser, path);
+}
+
+static gboolean
+mail_config_local_check_complete (EMailConfigBackend *backend,
+                                  ESource *scratch_source)
+{
+	EMailConfig *config;
+	CamelSettings *settings;
+	CamelLocalSettings *local_settings;
+	const gchar *path;
+
+	config = e_mail_config_backend_get_config (backend);
+	settings = e_mail_config_get_settings (config, scratch_source);
+
+	local_settings = CAMEL_LOCAL_SETTINGS (settings);
+	path = camel_local_settings_get_path (local_settings);
+
+	return (path != NULL && *path != '\0');
+}
+
+static void
+mail_config_local_commit_changes (EMailConfigBackend *backend,
+                                  ESource *scratch_source)
+{
+	/* CamelLocalSettings "path" property is already up-to-date,
+	 * and it's bound to the appropriate ESourceExtension property,
+	 * so nothing to do here. */
+}
+
+static void
+e_mail_config_local_class_init (EMailConfigLocalClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->insert_widgets = mail_config_local_insert_widgets;
+	backend_class->check_complete = mail_config_local_check_complete;
+	backend_class->commit_changes = mail_config_local_commit_changes;
+}
+
+static void
+e_mail_config_local_class_finalize (EMailConfigLocalClass *class)
+{
+}
+
+static void
+e_mail_config_local_init (EMailConfigLocal *backend)
+{
+}
+
+static void
+e_mail_config_mh_class_init (EMailConfigLocalClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "mh";
+
+	class->file_chooser_label = _("Mail _Directory:");
+	class->file_chooser_title = _("Choose a MH mail directory");
+	class->file_chooser_action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
+}
+
+static void
+e_mail_config_mh_class_finalize (EMailConfigLocalClass *class)
+{
+}
+
+static void
+e_mail_config_mh_init (EMailConfigLocal *backend)
+{
+}
+
+static void
+e_mail_config_mbox_class_init (EMailConfigLocalClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "mbox";
+
+	class->file_chooser_label = _("Local Delivery _File:");
+	class->file_chooser_title = _("Choose a local delivery file");
+	class->file_chooser_action = GTK_FILE_CHOOSER_ACTION_OPEN;
+}
+
+static void
+e_mail_config_mbox_class_finalize (EMailConfigLocalClass *class)
+{
+}
+
+static void
+e_mail_config_mbox_init (EMailConfigLocal *backend)
+{
+}
+
+static void
+e_mail_config_maildir_class_init (EMailConfigLocalClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "maildir";
+
+	class->file_chooser_label = _("Mail _Directory:");
+	class->file_chooser_title = _("Choose a Maildir mail directory");
+	class->file_chooser_action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
+}
+
+static void
+e_mail_config_maildir_class_finalize (EMailConfigLocalClass *class)
+{
+}
+
+static void
+e_mail_config_maildir_init (EMailConfigLocal *backend)
+{
+}
+
+static void
+e_mail_config_spool_dir_class_init (EMailConfigLocalClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "spool";
+
+	class->file_chooser_label = _("Spool _File:");
+	class->file_chooser_title = _("Choose a mbox spool file");
+	class->file_chooser_action = GTK_FILE_CHOOSER_ACTION_OPEN;
+}
+
+static void
+e_mail_config_spool_dir_class_finalize (EMailConfigLocalClass *class)
+{
+}
+
+static void
+e_mail_config_spool_dir_init (EMailConfigLocal *backend)
+{
+}
+
+static void
+e_mail_config_spool_file_class_init (EMailConfigLocalClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "spooldir";
+
+	class->file_chooser_label = _("Spool _Directory:");
+	class->file_chooser_title = _("Choose a mbox spool directory");
+	class->file_chooser_action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
+}
+
+static void
+e_mail_config_spool_file_class_finalize (EMailConfigLocalClass *class)
+{
+}
+
+static void
+e_mail_config_spool_file_init (EMailConfigLocal *backend)
+{
+}
+
+static void
+e_mail_config_none_class_init (EMailConfigBackendClass *class)
+{
+	class->backend_name = "none";
+}
+
+static void
+e_mail_config_none_class_finalize (EMailConfigBackendClass *class)
+{
+}
+
+static void
+e_mail_config_none_init (EMailConfigBackend *backend)
+{
+}
+
+void
+e_mail_config_local_accounts_register_types (GTypeModule *type_module)
+{
+	/* Abstract base type */
+	e_mail_config_local_register_type (type_module);
+
+	/* Concrete sub-types */
+	e_mail_config_mh_register_type (type_module);
+	e_mail_config_mbox_register_type (type_module);
+	e_mail_config_maildir_register_type (type_module);
+	e_mail_config_spool_dir_register_type (type_module);
+	e_mail_config_spool_file_register_type (type_module);
+
+	/* XXX For lack of a better place for this... */
+	e_mail_config_none_register_type (type_module);
+}
+
diff --git a/modules/mail-config/e-mail-config-remote-accounts.c b/modules/mail-config/e-mail-config-remote-accounts.c
new file mode 100644
index 0000000..bc8abb4
--- /dev/null
+++ b/modules/mail-config/e-mail-config-remote-accounts.c
@@ -0,0 +1,475 @@
+/*
+ * e-mail-config-transports.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include <config.h>
+#include <glib/gi18n-lib.h>
+
+#include <camel/camel.h>
+#include <libebackend/e-extension.h>
+#include <libedataserver/e-source-backend.h>
+#include <libedataserver/e-data-server-util.h>
+
+#include <misc/e-port-entry.h>
+
+#include <mail/e-mail-config-backend.h>
+#include <mail/e-mail-config-auth-check.h>
+
+/* Standard GObject macros */
+#define E_TYPE_MAIL_CONFIG_REMOTE \
+	(e_mail_config_remote_get_type ())
+#define E_MAIL_CONFIG_REMOTE(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_MAIL_CONFIG_REMOTE, EMailConfigRemote))
+#define E_MAIL_CONFIG_REMOTE_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_MAIL_CONFIG_REMOTE, EMailConfigRemoteClass))
+#define E_IS_MAIL_CONFIG_REMOTE(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_MAIL_CONFIG_REMOTE))
+#define E_IS_MAIL_CONFIG_REMOTE_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_MAIL_CONFIG_REMOTE))
+#define E_MAIL_CONFIG_REMOTE_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_MAIL_CONFIG_REMOTE, EMailConfigRemoteClass))
+
+typedef struct _EMailConfigRemote EMailConfigRemote;
+typedef struct _EMailConfigRemoteClass EMailConfigRemoteClass;
+
+typedef EMailConfigRemote EMailConfigPOP;
+typedef EMailConfigRemoteClass EMailConfigPOPClass;
+
+typedef EMailConfigRemote EMailConfigNNTP;
+typedef EMailConfigRemoteClass EMailConfigNNTPClass;
+
+typedef EMailConfigRemote EMailConfigIMAP;
+typedef EMailConfigRemoteClass EMailConfigIMAPClass;
+
+typedef EMailConfigRemote EMailConfigIMAPX;
+typedef EMailConfigRemoteClass EMailConfigIMAPXClass;
+
+typedef struct _Context Context;
+
+struct _EMailConfigRemote {
+	EMailConfigBackend parent;
+};
+
+struct _EMailConfigRemoteClass {
+	EMailConfigBackendClass parent_class;
+};
+
+struct _Context {
+	GtkWidget *host_entry;
+	GtkWidget *port_entry;
+	GtkWidget *user_entry;
+	GtkWidget *security_combo_box;
+};
+
+/* Forward Declarations */
+void		e_mail_config_remote_accounts_register_types
+						(GTypeModule *type_module);
+GType		e_mail_config_remote_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_pop_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_nntp_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_imap_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_imapx_get_type	(void) G_GNUC_CONST;
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (
+	EMailConfigRemote,
+	e_mail_config_remote,
+	E_TYPE_MAIL_CONFIG_BACKEND,
+	G_TYPE_FLAG_ABSTRACT,
+	/* no custom code */)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigPOP,
+	e_mail_config_pop,
+	E_TYPE_MAIL_CONFIG_REMOTE)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigNNTP,
+	e_mail_config_nntp,
+	E_TYPE_MAIL_CONFIG_REMOTE)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigIMAP,
+	e_mail_config_imap,
+	E_TYPE_MAIL_CONFIG_REMOTE)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigIMAPX,
+	e_mail_config_imapx,
+	E_TYPE_MAIL_CONFIG_REMOTE)
+
+static void
+mail_config_remote_context_free (Context *context)
+{
+	g_object_unref (context->host_entry);
+	g_object_unref (context->port_entry);
+	g_object_unref (context->user_entry);
+	g_object_unref (context->security_combo_box);
+
+	g_slice_free (Context, context);
+}
+
+static void
+mail_config_remote_insert_widgets (EMailConfigBackend *backend,
+                                   ESource *scratch_source,
+                                   GtkBox *page)
+{
+	EMailConfig *config;
+	CamelProvider *provider;
+	CamelSettings *settings;
+	ESourceBackend *extension;
+	GtkLabel *label;
+	GtkWidget *widget;
+	GtkWidget *container;
+	Context *context;
+	const gchar *backend_name;
+	const gchar *extension_name;
+	const gchar *text;
+	const gchar *uid;
+	gchar *markup;
+
+	config = e_mail_config_backend_get_config (backend);
+	settings = e_mail_config_get_settings (config, scratch_source);
+
+	extension_name = E_MAIL_CONFIG_GET_CLASS (config)->extension_name;
+	extension = e_source_get_extension (scratch_source, extension_name);
+	backend_name = e_source_backend_get_backend_name (extension);
+
+	context = g_slice_new (Context);
+	uid = e_source_get_uid (scratch_source);
+
+	g_object_set_data_full (
+		G_OBJECT (backend), uid, context,
+		(GDestroyNotify) mail_config_remote_context_free);
+
+	text = _("Configuration");
+	markup = g_markup_printf_escaped ("<b>%s</b>", text);
+	widget = gtk_label_new (markup);
+	gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
+	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+	g_free (markup);
+
+	widget = gtk_grid_new ();
+	gtk_widget_set_margin_left (widget, 12);
+	gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
+	gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	widget = gtk_label_new_with_mnemonic (_("_Server:"));
+	gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
+	gtk_grid_attach (GTK_GRID (container), widget, 0, 0, 1, 1);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	widget = gtk_entry_new ();
+	gtk_widget_set_hexpand (widget, TRUE);
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_grid_attach (GTK_GRID (container), widget, 1, 0, 1, 1);
+	context->host_entry = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	widget = gtk_label_new_with_mnemonic (_("_Port:"));
+	gtk_grid_attach (GTK_GRID (container), widget, 2, 0, 1, 1);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	widget = e_port_entry_new ();
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_grid_attach (GTK_GRID (container), widget, 3, 0, 1, 1);
+	context->port_entry = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	widget = gtk_label_new_with_mnemonic (_("User_name:"));
+	gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
+	gtk_grid_attach (GTK_GRID (container), widget, 0, 1, 1, 1);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	widget = gtk_entry_new ();
+	gtk_widget_set_hexpand (widget, TRUE);
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_grid_attach (GTK_GRID (container), widget, 1, 1, 3, 1);
+	context->user_entry = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	text = _("Security");
+	markup = g_markup_printf_escaped ("<b>%s</b>", text);
+	widget = gtk_label_new (markup);
+	gtk_widget_set_margin_top (widget, 6);
+	gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
+	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+	g_free (markup);
+
+	widget = gtk_grid_new ();
+	gtk_widget_set_margin_left (widget, 12);
+	gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
+	gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	widget = gtk_label_new_with_mnemonic (_("Encryption _method:"));
+	gtk_grid_attach (GTK_GRID (container), widget, 0, 0, 1, 1);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	/* The IDs correspond to the CamelNetworkSecurityMethod enum. */
+	widget = gtk_combo_box_text_new ();
+	gtk_combo_box_text_append (
+		GTK_COMBO_BOX_TEXT (widget),
+		"none",
+		_("No encryption"));
+	gtk_combo_box_text_append (
+		GTK_COMBO_BOX_TEXT (widget),
+		"starttls-on-standard-port",
+		_("STARTTLS after connecting"));
+	gtk_combo_box_text_append (
+		GTK_COMBO_BOX_TEXT (widget),
+		"ssl-on-alternate-port",
+		_("SSL on a dedicated port"));
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_widget_set_halign (widget, GTK_ALIGN_START);
+	gtk_grid_attach (GTK_GRID (container), widget, 1, 0, 1, 1);
+	context->security_combo_box = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	provider = camel_provider_get (backend_name, NULL);
+	if (provider != NULL && provider->port_entries != NULL)
+		e_port_entry_set_camel_entries (
+			E_PORT_ENTRY (context->port_entry),
+			provider->port_entries);
+
+	text = _("Authentication");
+	markup = g_markup_printf_escaped ("<b>%s</b>", text);
+	widget = gtk_label_new (markup);
+	gtk_widget_set_margin_top (widget, 6);
+	gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
+	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+	g_free (markup);
+
+	widget = e_mail_config_auth_check_new (backend, scratch_source);
+	gtk_widget_set_margin_left (widget, 12);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+
+	g_object_bind_property (
+		settings, "host",
+		context->host_entry, "text",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE);
+
+	g_object_bind_property_full (
+		settings, "security-method",
+		context->security_combo_box, "active-id",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE,
+		e_binding_transform_enum_value_to_nick,
+		e_binding_transform_enum_nick_to_value,
+		NULL, (GDestroyNotify) NULL);
+
+	g_object_bind_property (
+		settings, "port",
+		context->port_entry, "port",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE);
+
+	g_object_bind_property (
+		settings, "security-method",
+		context->port_entry, "security-method",
+		G_BINDING_SYNC_CREATE);
+
+	g_object_bind_property (
+		settings, "user",
+		context->user_entry, "text",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE);
+}
+
+static gboolean
+mail_config_remote_check_complete (EMailConfigBackend *backend,
+                                   ESource *scratch_source)
+{
+	EMailConfig *config;
+	CamelSettings *settings;
+	CamelNetworkSettings *network_settings;
+	EPortEntry *port_entry;
+	Context *context;
+	const gchar *host;
+	const gchar *user;
+	const gchar *uid;
+
+	uid = e_source_get_uid (scratch_source);
+	context = g_object_get_data (G_OBJECT (backend), uid);
+	g_return_val_if_fail (context != NULL, FALSE);
+
+	config = e_mail_config_backend_get_config (backend);
+	settings = e_mail_config_get_settings (config, scratch_source);
+
+	network_settings = CAMEL_NETWORK_SETTINGS (settings);
+	host = camel_network_settings_get_host (network_settings);
+	user = camel_network_settings_get_user (network_settings);
+
+	if (host == NULL || *host == '\0')
+		return FALSE;
+
+	port_entry = E_PORT_ENTRY (context->port_entry);
+	if (!e_port_entry_is_valid (port_entry))
+		return FALSE;
+
+	if (user == NULL || *user == '\0')
+		return FALSE;
+
+	return TRUE;
+}
+
+static void
+mail_config_remote_commit_changes (EMailConfigBackend *backend,
+                                   ESource *scratch_source)
+{
+	/* All CamelNetworkSettings properties are already up-to-date,
+	 * and these properties are bound to ESourceExtension properties,
+	 * so nothing to do here. */
+}
+
+static void
+e_mail_config_remote_class_init (EMailConfigRemoteClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->insert_widgets = mail_config_remote_insert_widgets;
+	backend_class->check_complete = mail_config_remote_check_complete;
+	backend_class->commit_changes = mail_config_remote_commit_changes;
+}
+
+static void
+e_mail_config_remote_class_finalize (EMailConfigRemoteClass *class)
+{
+}
+
+static void
+e_mail_config_remote_init (EMailConfigRemote *backend)
+{
+}
+
+static void
+e_mail_config_pop_class_init (EMailConfigRemoteClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "pop";
+}
+
+static void
+e_mail_config_pop_class_finalize (EMailConfigRemoteClass *class)
+{
+}
+
+static void
+e_mail_config_pop_init (EMailConfigRemote *backend)
+{
+}
+
+static void
+e_mail_config_nntp_class_init (EMailConfigRemoteClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "nntp";
+}
+
+static void
+e_mail_config_nntp_class_finalize (EMailConfigRemoteClass *class)
+{
+}
+
+static void
+e_mail_config_nntp_init (EMailConfigRemote *backend)
+{
+}
+
+static void
+e_mail_config_imap_class_init (EMailConfigRemoteClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "imap";
+}
+
+static void
+e_mail_config_imap_class_finalize (EMailConfigRemoteClass *class)
+{
+}
+
+static void
+e_mail_config_imap_init (EMailConfigRemote *backend)
+{
+}
+
+static void
+e_mail_config_imapx_class_init (EMailConfigRemoteClass *class)
+{
+	EMailConfigBackendClass *backend_class;
+
+	backend_class = E_MAIL_CONFIG_BACKEND_CLASS (class);
+	backend_class->backend_name = "imapx";
+}
+
+static void
+e_mail_config_imapx_class_finalize (EMailConfigRemoteClass *class)
+{
+}
+
+static void
+e_mail_config_imapx_init (EMailConfigRemote *backend)
+{
+}
+
+void
+e_mail_config_remote_accounts_register_types (GTypeModule *type_module)
+{
+	/* Abstract base type */
+	e_mail_config_remote_register_type (type_module);
+
+	/* Concrete sub-types */
+	e_mail_config_pop_register_type (type_module);
+	e_mail_config_nntp_register_type (type_module);
+	e_mail_config_imap_register_type (type_module);
+	e_mail_config_imapx_register_type (type_module);
+}
+
diff --git a/modules/mail-config/e-mail-config-transports.c b/modules/mail-config/e-mail-config-transports.c
new file mode 100644
index 0000000..083683d
--- /dev/null
+++ b/modules/mail-config/e-mail-config-transports.c
@@ -0,0 +1,343 @@
+/*
+ * e-mail-config-transport-accounts.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include <config.h>
+#include <glib/gi18n-lib.h>
+
+#include <camel/camel.h>
+#include <libebackend/e-extension.h>
+#include <libedataserver/e-source-backend.h>
+#include <libedataserver/e-data-server-util.h>
+
+#include <misc/e-port-entry.h>
+
+#include <mail/e-mail-config-backend.h>
+
+typedef EMailConfigBackend EMailConfigSMTP;
+typedef EMailConfigBackendClass EMailConfigSMTPClass;
+
+typedef EMailConfigBackend EMailConfigSendmail;
+typedef EMailConfigBackendClass EMailConfigSendmailClass;
+
+typedef struct _Context Context;
+
+struct _Context {
+	GtkWidget *host_entry;
+	GtkWidget *port_entry;
+	GtkWidget *user_entry;
+	GtkWidget *security_combo_box;
+	GtkWidget *auth_required_toggle;
+};
+
+/* Forward Declarations */
+void		e_mail_config_transports_register_types
+						(GTypeModule *type_module);
+GType		e_mail_config_smtp_get_type	(void) G_GNUC_CONST;
+GType		e_mail_config_sendmail_get_type	(void) G_GNUC_CONST;
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigSMTP,
+	e_mail_config_smtp,
+	E_TYPE_MAIL_CONFIG_BACKEND)
+
+G_DEFINE_DYNAMIC_TYPE (
+	EMailConfigSendmail,
+	e_mail_config_sendmail,
+	E_TYPE_MAIL_CONFIG_BACKEND)
+
+static void
+mail_config_smtp_context_free (Context *context)
+{
+	g_object_unref (context->host_entry);
+	g_object_unref (context->port_entry);
+	g_object_unref (context->user_entry);
+	g_object_unref (context->security_combo_box);
+	g_object_unref (context->auth_required_toggle);
+
+	g_slice_free (Context, context);
+}
+
+static void
+mail_config_smtp_insert_widgets (EMailConfigBackend *backend,
+                                 ESource *scratch_source,
+                                 GtkBox *page)
+{
+	EMailConfig *config;
+	CamelProvider *provider;
+	CamelSettings *settings;
+	ESourceBackend *extension;
+	GtkLabel *label;
+	GtkWidget *widget;
+	GtkWidget *container;
+	Context *context;
+	const gchar *backend_name;
+	const gchar *extension_name;
+	const gchar *text;
+	const gchar *uid;
+	gchar *markup;
+
+	config = e_mail_config_backend_get_config (backend);
+	settings = e_mail_config_get_settings (config, scratch_source);
+
+	extension_name = E_MAIL_CONFIG_GET_CLASS (config)->extension_name;
+	extension = e_source_get_extension (scratch_source, extension_name);
+	backend_name = e_source_backend_get_backend_name (extension);
+
+	context = g_slice_new (Context);
+	uid = e_source_get_uid (scratch_source);
+
+	g_object_set_data_full (
+		G_OBJECT (backend), uid, context,
+		(GDestroyNotify) mail_config_smtp_context_free);
+
+	text = _("Configuration");
+	markup = g_markup_printf_escaped ("<b>%s</b>", text);
+	widget = gtk_label_new (markup);
+	gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
+	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+	g_free (markup);
+
+	widget = gtk_grid_new ();
+	gtk_widget_set_margin_left (widget, 12);
+	gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
+	gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	widget = gtk_label_new_with_mnemonic (_("_Server:"));
+	gtk_grid_attach (GTK_GRID (container), widget, 0, 0, 1, 1);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	widget = gtk_entry_new ();
+	gtk_widget_set_hexpand (widget, TRUE);
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_grid_attach (GTK_GRID (container), widget, 1, 0, 1, 1);
+	context->host_entry = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	widget = gtk_label_new_with_mnemonic (_("_Port:"));
+	gtk_grid_attach (GTK_GRID (container), widget, 2, 0, 1, 1);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	widget = e_port_entry_new ();
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_grid_attach (GTK_GRID (container), widget, 3, 0, 1, 1);
+	context->port_entry = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	text = _("Ser_ver requires authentication");
+	widget = gtk_check_button_new_with_mnemonic (text);
+	gtk_grid_attach (GTK_GRID (container), widget, 1, 1, 3, 1);
+	context->auth_required_toggle = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	text = _("Security");
+	markup = g_markup_printf_escaped ("<b>%s</b>", text);
+	widget = gtk_label_new (markup);
+	gtk_widget_set_margin_top (widget, 6);
+	gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
+	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+	g_free (markup);
+
+	widget = gtk_grid_new ();
+	gtk_widget_set_margin_left (widget, 12);
+	gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
+	gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	widget = gtk_label_new_with_mnemonic (_("Encryption _method:"));
+	gtk_grid_attach (GTK_GRID (container), widget, 0, 0, 1, 1);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	/* The IDs correspond to the CamelNetworkSecurityMethod enum. */
+	widget = gtk_combo_box_text_new ();
+	gtk_combo_box_text_append (
+		GTK_COMBO_BOX_TEXT (widget),
+		"none",
+		_("No encryption"));
+	gtk_combo_box_text_append (
+		GTK_COMBO_BOX_TEXT (widget),
+		"starttls-on-standard-port",
+		_("STARTTLS after connecting"));
+	gtk_combo_box_text_append (
+		GTK_COMBO_BOX_TEXT (widget),
+		"ssl-on-alternate-port",
+		_("SSL on a dedicated port"));
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_widget_set_halign (widget, GTK_ALIGN_START);
+	gtk_grid_attach (GTK_GRID (container), widget, 1, 0, 1, 1);
+	context->security_combo_box = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	provider = camel_provider_get (backend_name, NULL);
+	if (provider != NULL && provider->port_entries != NULL)
+		e_port_entry_set_camel_entries (
+			E_PORT_ENTRY (context->port_entry),
+			provider->port_entries);
+
+	text = _("Authentication");
+	markup = g_markup_printf_escaped ("<b>%s</b>", text);
+	widget = gtk_label_new (markup);
+	gtk_widget_set_margin_top (widget, 6);
+	gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
+	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+	g_free (markup);
+
+	g_object_bind_property (
+		context->auth_required_toggle, "active",
+		widget, "sensitive",
+		G_BINDING_SYNC_CREATE);
+
+	widget = gtk_grid_new ();
+	gtk_widget_set_margin_left (widget, 12);
+	gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
+	gtk_grid_set_column_spacing (GTK_GRID (widget), 6);
+	gtk_box_pack_start (GTK_BOX (page), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+
+	g_object_bind_property (
+		context->auth_required_toggle, "active",
+		widget, "sensitive",
+		G_BINDING_SYNC_CREATE);
+
+	container = widget;
+
+	/* FIXME Insert auth types here. */
+
+	widget = gtk_label_new_with_mnemonic (_("User_name:"));
+	gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
+	gtk_grid_attach (GTK_GRID (container), widget, 0, 1, 1, 1);
+	gtk_widget_show (widget);
+
+	label = GTK_LABEL (widget);
+
+	widget = gtk_entry_new ();
+	gtk_widget_set_hexpand (widget, TRUE);
+	gtk_label_set_mnemonic_widget (label, widget);
+	gtk_grid_attach (GTK_GRID (container), widget, 1, 1, 2, 1);
+	gtk_widget_show (widget);
+
+	g_object_bind_property (
+		settings, "host",
+		context->host_entry, "text",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE);
+
+	g_object_bind_property_full (
+		settings, "security-method",
+		context->security_combo_box, "active-id",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE,
+		e_binding_transform_enum_value_to_nick,
+		e_binding_transform_enum_nick_to_value,
+		NULL, (GDestroyNotify) NULL);
+
+	g_object_bind_property (
+		settings, "port",
+		context->port_entry, "port",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE);
+
+	g_object_bind_property (
+		settings, "security-method",
+		context->port_entry, "security-method",
+		G_BINDING_SYNC_CREATE);
+
+	g_object_bind_property (
+		settings, "user",
+		context->user_entry, "text",
+		G_BINDING_BIDIRECTIONAL |
+		G_BINDING_SYNC_CREATE);
+}
+
+static gboolean
+mail_config_smtp_check_complete (EMailConfigBackend *backend,
+                                 ESource *scratch_source)
+{
+}
+
+static void
+mail_config_smtp_commit_changes (EMailConfigBackend *backend,
+                                 ESource *scratch_source)
+{
+	/* All CamelNetworkSettings properties are already up-to-date,
+	 * and these properties are bound to ESourceExtension properties,
+	 * so nothing to do here. */
+}
+
+static void
+e_mail_config_smtp_class_init (EMailConfigBackendClass *class)
+{
+	class->backend_name = "smtp";
+	class->insert_widgets = mail_config_smtp_insert_widgets;
+	class->check_complete = mail_config_smtp_check_complete;
+	class->commit_changes = mail_config_smtp_commit_changes;
+}
+
+static void
+e_mail_config_smtp_class_finalize (EMailConfigBackendClass *class)
+{
+}
+
+static void
+e_mail_config_smtp_init (EMailConfigBackend *backend)
+{
+}
+
+static void
+e_mail_config_sendmail_class_init (EMailConfigBackendClass *class)
+{
+	class->backend_name = "sendmail";
+
+	/* No extra widgets for this backend. */
+}
+
+static void
+e_mail_config_sendmail_class_finalize (EMailConfigBackendClass *class)
+{
+}
+
+static void
+e_mail_config_sendmail_init (EMailConfigBackend *backend)
+{
+}
+
+void
+e_mail_config_transports_register_types (GTypeModule *type_module)
+{
+	e_mail_config_smtp_register_type (type_module);
+	e_mail_config_sendmail_register_type (type_module);
+}
+
diff --git a/modules/mail-config/evolution-mail-config.c b/modules/mail-config/evolution-mail-config.c
new file mode 100644
index 0000000..799f9a0
--- /dev/null
+++ b/modules/mail-config/evolution-mail-config.c
@@ -0,0 +1,39 @@
+/*
+ * evolution-mail-config.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include <gmodule.h>
+#include <glib-object.h>
+
+/* Module Entry Points */
+void e_module_load (GTypeModule *type_module);
+void e_module_unload (GTypeModule *type_module);
+
+void e_mail_config_local_accounts_register_types (GTypeModule *type_module);
+void e_mail_config_remote_accounts_register_types (GTypeModule *type_module);
+
+G_MODULE_EXPORT void
+e_module_load (GTypeModule *type_module)
+{
+	e_mail_config_local_accounts_register_types (type_module);
+	e_mail_config_remote_accounts_register_types (type_module);
+}
+
+G_MODULE_EXPORT void
+e_module_unload (GTypeModule *type_module)
+{
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]