From b5023d32bdffdeb6cb626e74d0f3e464e66cec1b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 8 Oct 2013 13:22:48 +0200 Subject: Bug #215115 - Per-folder From: email address The change also allows setting accounts for certain recipients (based on a part of the recipient address). The option can be found in Folder Properties and in Edit->Preferences->Composer Preferences->Send Account. --- mail/Makefile.am | 2 + mail/e-mail-backend.c | 34 +- mail/e-mail-backend.h | 4 + mail/e-mail-send-account-override.c | 718 ++++++++++ mail/e-mail-send-account-override.h | 108 ++ mail/em-composer-utils.c | 176 ++- mail/em-composer-utils.h | 8 + mail/em-folder-properties.c | 73 + mail/mail-config.ui | 2513 ++++++++++++++++++++--------------- 9 files changed, 2565 insertions(+), 1071 deletions(-) create mode 100644 mail/e-mail-send-account-override.c create mode 100644 mail/e-mail-send-account-override.h (limited to 'mail') diff --git a/mail/Makefile.am b/mail/Makefile.am index 61dc4c3379..b5a9caa3ea 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -80,6 +80,7 @@ mailinclude_HEADERS = \ e-mail-reader-utils.h \ e-mail-reader.h \ e-mail-request.h \ + e-mail-send-account-override.h \ e-mail-sidebar.h \ e-mail-tag-editor.h \ e-mail-ui-session.h \ @@ -154,6 +155,7 @@ libevolution_mail_la_SOURCES = \ e-mail-reader-utils.c \ e-mail-reader.c \ e-mail-request.c \ + e-mail-send-account-override.c \ e-mail-sidebar.c \ e-mail-tag-editor.c \ e-mail-ui-session.c \ diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c index b7fb84735e..f15e7f8efb 100644 --- a/mail/e-mail-backend.c +++ b/mail/e-mail-backend.c @@ -63,11 +63,13 @@ struct _EMailBackendPrivate { EMailSession *session; GHashTable *jobs; + EMailSendAccountOverride *send_account_override; }; enum { PROP_0, - PROP_SESSION + PROP_SESSION, + PROP_SEND_ACCOUNT_OVERRIDE }; /* FIXME Kill this thing. It's a horrible hack. */ @@ -825,6 +827,13 @@ mail_backend_get_property (GObject *object, e_mail_backend_get_session ( E_MAIL_BACKEND (object))); return; + + case PROP_SEND_ACCOUNT_OVERRIDE: + g_value_set_object ( + value, + e_mail_backend_get_send_account_override ( + E_MAIL_BACKEND (object))); + return; } G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -862,6 +871,7 @@ mail_backend_finalize (GObject *object) priv = E_MAIL_BACKEND_GET_PRIVATE (object); g_hash_table_destroy (priv->jobs); + g_clear_object (&priv->send_account_override); /* Chain up to parent's finalize() method. */ G_OBJECT_CLASS (e_mail_backend_parent_class)->finalize (object); @@ -1016,6 +1026,7 @@ mail_backend_constructed (GObject *object) EShellBackend *shell_backend; MailFolderCache *folder_cache; ESourceRegistry *registry; + gchar *send_overrides_ini; priv = E_MAIL_BACKEND_GET_PRIVATE (object); @@ -1108,6 +1119,10 @@ mail_backend_constructed (GObject *object) /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_mail_backend_parent_class)->constructed (object); + + send_overrides_ini = g_build_filename (e_shell_backend_get_config_dir (shell_backend), "send-overrides.ini", NULL); + priv->send_account_override = e_mail_send_account_override_new (send_overrides_ini); + g_free (send_overrides_ini); } static void @@ -1138,6 +1153,16 @@ e_mail_backend_class_init (EMailBackendClass *class) NULL, E_TYPE_MAIL_SESSION, G_PARAM_READABLE)); + + g_object_class_install_property ( + object_class, + PROP_SEND_ACCOUNT_OVERRIDE, + g_param_spec_object ( + "send-account-override", + NULL, + NULL, + E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE, + G_PARAM_READABLE)); } static void @@ -1229,3 +1254,10 @@ e_mail_backend_empty_trash_policy_decision (EMailBackend *backend) return class->empty_trash_policy_decision (backend); } +EMailSendAccountOverride * +e_mail_backend_get_send_account_override (EMailBackend *backend) +{ + g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL); + + return backend->priv->send_account_override; +} diff --git a/mail/e-mail-backend.h b/mail/e-mail-backend.h index b44b330a9f..0bc94f1318 100644 --- a/mail/e-mail-backend.h +++ b/mail/e-mail-backend.h @@ -28,6 +28,7 @@ #include #include +#include /* Standard GObject macros */ #define E_TYPE_MAIL_BACKEND \ @@ -76,6 +77,9 @@ gboolean e_mail_backend_delete_junk_policy_decision (EMailBackend *backend); gboolean e_mail_backend_empty_trash_policy_decision (EMailBackend *backend); +EMailSendAccountOverride * + e_mail_backend_get_send_account_override + (EMailBackend *backend); G_END_DECLS diff --git a/mail/e-mail-send-account-override.c b/mail/e-mail-send-account-override.c new file mode 100644 index 0000000000..8af7227439 --- /dev/null +++ b/mail/e-mail-send-account-override.c @@ -0,0 +1,718 @@ +/* + * e-mail-send-account-override.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 + * + * + * Copyright (C) 2013 Red Hat, Inc. (www.redhat.com) + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include + +#include "e-mail-send-account-override.h" + +#define FOLDERS_SECTION "Folders" +#define RECIPIENTS_SECTION "Recipients" +#define OPTIONS_SECTION "Options" + +#define OPTION_PREFER_FOLDER "PreferFolder" + +struct _EMailSendAccountOverridePrivate +{ + GKeyFile *key_file; + gchar *config_filename; + gboolean prefer_folder; + + gboolean need_save; + guint save_frozen; + + GMutex property_lock; +}; + +enum { + PROP_0, + PROP_PREFER_FOLDER +}; + +enum { + CHANGED, + LAST_SIGNAL +}; + +static gint signals[LAST_SIGNAL]; + +G_DEFINE_TYPE (EMailSendAccountOverride, e_mail_send_account_override, G_TYPE_OBJECT) + +static void +e_mail_send_account_override_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + EMailSendAccountOverride *account_override = E_MAIL_SEND_ACCOUNT_OVERRIDE (object); + + g_return_if_fail (account_override != NULL); + + switch (property_id) { + case PROP_PREFER_FOLDER: + g_value_set_boolean (value, + e_mail_send_account_override_get_prefer_folder (account_override)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +e_mail_send_account_override_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + EMailSendAccountOverride *account_override = E_MAIL_SEND_ACCOUNT_OVERRIDE (object); + + g_return_if_fail (account_override != NULL); + + switch (property_id) { + case PROP_PREFER_FOLDER: + e_mail_send_account_override_set_prefer_folder (account_override, + g_value_get_boolean (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +e_mail_send_account_override_finalize (GObject *object) +{ + EMailSendAccountOverride *account_override = E_MAIL_SEND_ACCOUNT_OVERRIDE (object); + + g_return_if_fail (account_override != NULL); + + if (account_override->priv->key_file) { + g_key_file_free (account_override->priv->key_file); + account_override->priv->key_file = NULL; + } + + if (account_override->priv->config_filename) { + g_free (account_override->priv->config_filename); + account_override->priv->config_filename = NULL; + } + + g_mutex_clear (&account_override->priv->property_lock); + + G_OBJECT_CLASS (e_mail_send_account_override_parent_class)->finalize (object); +} + +static void +e_mail_send_account_override_class_init (EMailSendAccountOverrideClass *klass) +{ + GObjectClass *object_class; + + g_type_class_add_private (klass, sizeof (EMailSendAccountOverridePrivate)); + + object_class = G_OBJECT_CLASS (klass); + object_class->get_property = e_mail_send_account_override_get_property; + object_class->set_property = e_mail_send_account_override_set_property; + object_class->finalize = e_mail_send_account_override_finalize; + + g_object_class_install_property ( + object_class, + PROP_PREFER_FOLDER, + g_param_spec_boolean ( + "prefer-folder", + "Prefer Folder", + NULL, + TRUE, + G_PARAM_READWRITE)); + + signals[CHANGED] = g_signal_new ( + "changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EMailSendAccountOverrideClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +static void +e_mail_send_account_override_init (EMailSendAccountOverride *account_override) +{ + account_override->priv = G_TYPE_INSTANCE_GET_PRIVATE (account_override, + E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE, EMailSendAccountOverridePrivate); + + g_mutex_init (&account_override->priv->property_lock); + account_override->priv->key_file = g_key_file_new (); + account_override->priv->config_filename = NULL; + account_override->priv->prefer_folder = TRUE; + account_override->priv->need_save = FALSE; + account_override->priv->save_frozen = 0; +} + +static gboolean +e_mail_send_account_override_save_locked (EMailSendAccountOverride *account_override) +{ + gchar *contents; + GError *error = NULL; + + g_return_val_if_fail (account_override->priv->key_file != NULL, FALSE); + + account_override->priv->need_save = FALSE; + + if (!account_override->priv->config_filename) + return FALSE; + + contents = g_key_file_to_data (account_override->priv->key_file, NULL, NULL); + if (!contents) + return FALSE; + + g_file_set_contents (account_override->priv->config_filename, contents, -1, &error); + + if (error) { + g_warning ("%s: %s", G_STRFUNC, error->message); + g_clear_error (&error); + } + + g_free (contents); + + return TRUE; +} + +static gboolean +e_mail_send_account_override_maybe_save_locked (EMailSendAccountOverride *account_override) +{ + if (account_override->priv->save_frozen) + account_override->priv->need_save = TRUE; + else + return e_mail_send_account_override_save_locked (account_override); + + return FALSE; +} + +static gchar * +get_override_for_folder_uri_locked (EMailSendAccountOverride *account_override, + const gchar *folder_uri) +{ + gchar *account_uid; + + if (!folder_uri || !*folder_uri) + return NULL; + + account_uid = g_key_file_get_string (account_override->priv->key_file, FOLDERS_SECTION, folder_uri, NULL); + + if (account_uid) + g_strchomp (account_uid); + + if (account_uid && !*account_uid) { + g_free (account_uid); + account_uid = NULL; + } + + return account_uid; +} + +static gchar * +test_one_recipient (/* const */ gchar **keys, + /* const */ GPtrArray *values, + const gchar *name, + const gchar *address) +{ + gint ii; + + g_return_val_if_fail (keys != NULL, NULL); + g_return_val_if_fail (values != NULL, NULL); + + if ((!name || !*name) && (!address || !*address)) + return NULL; + + for (ii = 0; keys[ii] && ii < values->len; ii++) { + if (name && *name && e_util_utf8_strstrcase (name, keys[ii]) != NULL) { + return g_strdup (values->pdata[ii]); + } + + if (address && *address && e_util_utf8_strstrcase (address, keys[ii]) != NULL) { + return g_strdup (values->pdata[ii]); + } + } + + return NULL; +} + +static gchar * +get_override_for_recipients_locked (EMailSendAccountOverride *account_override, + CamelAddress *recipients) +{ + CamelInternetAddress *iaddress; + gchar *account_uid = NULL; + GPtrArray *values; + gchar **keys; + gint ii, len; + + if (!recipients || !CAMEL_IS_INTERNET_ADDRESS (recipients)) + return NULL; + + keys = g_key_file_get_keys (account_override->priv->key_file, RECIPIENTS_SECTION, NULL, NULL); + if (!keys) + return NULL; + + values = g_ptr_array_new_full (g_strv_length (keys), g_free); + for (ii = 0; keys[ii]; ii++) { + g_ptr_array_add (values, g_key_file_get_string (account_override->priv->key_file, + RECIPIENTS_SECTION, keys[ii], NULL)); + } + + iaddress = CAMEL_INTERNET_ADDRESS (recipients); + len = camel_address_length (recipients); + for (ii = 0; ii < len; ii++) { + const gchar *name, *address; + + if (camel_internet_address_get (iaddress, ii, &name, &address)) { + account_uid = test_one_recipient (keys, values, name, address); + + if (account_uid) + g_strchomp (account_uid); + + if (account_uid && !*account_uid) { + g_free (account_uid); + account_uid = NULL; + } + + if (account_uid) + break; + } + } + + g_ptr_array_free (values, TRUE); + g_strfreev (keys); + + return account_uid; +} + +static void +list_overrides_section_for_account_locked (EMailSendAccountOverride *account_override, + const gchar *account_uid, + const gchar *section, + GSList **overrides) +{ + gchar **keys; + + g_return_if_fail (account_uid != NULL); + g_return_if_fail (section != NULL); + + if (!overrides) + return; + + *overrides = NULL; + + keys = g_key_file_get_keys (account_override->priv->key_file, section, NULL, NULL); + if (keys) { + gint ii; + + for (ii = 0; keys[ii]; ii++) { + const gchar *key = keys[ii]; + gchar *value; + + value = g_key_file_get_string (account_override->priv->key_file, section, key, NULL); + if (g_strcmp0 (value, account_uid) == 0) + *overrides = g_slist_prepend (*overrides, g_strdup (key)); + g_free (value); + } + } + + g_strfreev (keys); + + *overrides = g_slist_reverse (*overrides); +} + +static void +list_overrides_for_account_locked (EMailSendAccountOverride *account_override, + const gchar *account_uid, + GSList **folder_overrides, + GSList **recipient_overrides) +{ + if (!account_uid) + return; + + list_overrides_section_for_account_locked (account_override, account_uid, FOLDERS_SECTION, folder_overrides); + list_overrides_section_for_account_locked (account_override, account_uid, RECIPIENTS_SECTION, recipient_overrides); +} + +EMailSendAccountOverride * +e_mail_send_account_override_new (const gchar *config_filename) +{ + EMailSendAccountOverride *account_override; + + account_override = g_object_new (E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE, NULL); + + if (config_filename) + e_mail_send_account_override_set_config_filename (account_override, config_filename); + + return account_override; +} + +void +e_mail_send_account_override_set_config_filename (EMailSendAccountOverride *account_override, + const gchar *config_filename) +{ + GError *error = NULL; + gboolean old_prefer_folder, prefer_folder_changed; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + g_return_if_fail (config_filename != NULL); + g_return_if_fail (*config_filename); + + g_mutex_lock (&account_override->priv->property_lock); + if (g_strcmp0 (config_filename, account_override->priv->config_filename) == 0) { + g_mutex_unlock (&account_override->priv->property_lock); + return; + } + + g_free (account_override->priv->config_filename); + account_override->priv->config_filename = g_strdup (config_filename); + + g_key_file_load_from_file (account_override->priv->key_file, + account_override->priv->config_filename, G_KEY_FILE_NONE, NULL); + + old_prefer_folder = account_override->priv->prefer_folder; + account_override->priv->prefer_folder = g_key_file_get_boolean (account_override->priv->key_file, + OPTIONS_SECTION, OPTION_PREFER_FOLDER, &error); + + if (error) { + /* default value is to prefer the folder override over the recipients */ + account_override->priv->prefer_folder = TRUE; + g_clear_error (&error); + } + + prefer_folder_changed = (account_override->priv->prefer_folder ? 1 : 0) != (old_prefer_folder ? 1 : 0); + + g_mutex_unlock (&account_override->priv->property_lock); + + if (prefer_folder_changed) + g_object_notify (G_OBJECT (account_override), "prefer-folder"); +} + +gchar * +e_mail_send_account_override_dup_config_filename (EMailSendAccountOverride *account_override) +{ + gchar *config_filename; + + g_return_val_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override), NULL); + + g_mutex_lock (&account_override->priv->property_lock); + config_filename = g_strdup (account_override->priv->config_filename); + g_mutex_unlock (&account_override->priv->property_lock); + + return config_filename; +} + +void +e_mail_send_account_override_set_prefer_folder (EMailSendAccountOverride *account_override, + gboolean prefer_folder) +{ + gboolean changed, saved = FALSE; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + + g_mutex_lock (&account_override->priv->property_lock); + + changed = (account_override->priv->prefer_folder ? 1 : 0) != (prefer_folder ? 1 : 0); + if (changed) { + account_override->priv->prefer_folder = prefer_folder; + + g_key_file_set_boolean (account_override->priv->key_file, + OPTIONS_SECTION, OPTION_PREFER_FOLDER, prefer_folder); + + saved = e_mail_send_account_override_maybe_save_locked (account_override); + } + + g_mutex_unlock (&account_override->priv->property_lock); + + if (changed) + g_object_notify (G_OBJECT (account_override), "prefer-folder"); + if (saved) + g_signal_emit (account_override, signals[CHANGED], 0); +} + +gboolean +e_mail_send_account_override_get_prefer_folder (EMailSendAccountOverride *account_override) +{ + gboolean prefer_folder; + + g_return_val_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override), FALSE); + + g_mutex_lock (&account_override->priv->property_lock); + prefer_folder = account_override->priv->prefer_folder; + g_mutex_unlock (&account_override->priv->property_lock); + + return prefer_folder; +} + +/* free returned pointer with g_free() */ +gchar * +e_mail_send_account_override_get_account_uid (EMailSendAccountOverride *account_override, + const gchar *folder_uri, + const CamelInternetAddress *recipients_to, + const CamelInternetAddress *recipients_cc, + const CamelInternetAddress *recipients_bcc) +{ + gchar *account_uid = NULL; + + g_return_val_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override), NULL); + g_return_val_if_fail (account_override->priv->config_filename != NULL, NULL); + + g_mutex_lock (&account_override->priv->property_lock); + + if (account_override->priv->prefer_folder) + account_uid = get_override_for_folder_uri_locked (account_override, folder_uri); + + if (!account_uid) + account_uid = get_override_for_recipients_locked (account_override, (CamelAddress *) recipients_to); + + if (!account_uid) + account_uid = get_override_for_recipients_locked (account_override, (CamelAddress *) recipients_cc); + + if (!account_uid) + account_uid = get_override_for_recipients_locked (account_override, (CamelAddress *) recipients_bcc); + + if (!account_uid && !account_override->priv->prefer_folder) + account_uid = get_override_for_folder_uri_locked (account_override, folder_uri); + + g_mutex_unlock (&account_override->priv->property_lock); + + return account_uid; +} + +void +e_mail_send_account_override_remove_for_account_uid (EMailSendAccountOverride *account_override, + const gchar *account_uid) +{ + GSList *folders = NULL, *recipients = NULL, *iter; + gboolean saved = FALSE; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + g_return_if_fail (account_uid != NULL); + + g_mutex_lock (&account_override->priv->property_lock); + + list_overrides_for_account_locked (account_override, account_uid, &folders, &recipients); + + if (folders || recipients) { + for (iter = folders; iter; iter = g_slist_next (iter)) { + const gchar *key = iter->data; + + g_key_file_remove_key (account_override->priv->key_file, FOLDERS_SECTION, key, NULL); + } + + for (iter = recipients; iter; iter = g_slist_next (iter)) { + const gchar *key = iter->data; + + g_key_file_remove_key (account_override->priv->key_file, RECIPIENTS_SECTION, key, NULL); + } + + saved = e_mail_send_account_override_maybe_save_locked (account_override); + } + + g_slist_free_full (folders, g_free); + g_slist_free_full (recipients, g_free); + + g_mutex_unlock (&account_override->priv->property_lock); + + if (saved) + g_signal_emit (account_override, signals[CHANGED], 0); +} + +gchar * +e_mail_send_account_override_get_for_folder (EMailSendAccountOverride *account_override, + const gchar *folder_uri) +{ + gchar *account_uid = NULL; + + g_return_val_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override), NULL); + + g_mutex_lock (&account_override->priv->property_lock); + + account_uid = get_override_for_folder_uri_locked (account_override, folder_uri); + + g_mutex_unlock (&account_override->priv->property_lock); + + return account_uid; +} + +void +e_mail_send_account_override_set_for_folder (EMailSendAccountOverride *account_override, + const gchar *folder_uri, + const gchar *account_uid) +{ + gboolean saved; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + g_return_if_fail (folder_uri != NULL); + g_return_if_fail (account_uid != NULL); + + g_mutex_lock (&account_override->priv->property_lock); + + g_key_file_set_string (account_override->priv->key_file, FOLDERS_SECTION, folder_uri, account_uid); + saved = e_mail_send_account_override_maybe_save_locked (account_override); + + g_mutex_unlock (&account_override->priv->property_lock); + + if (saved) + g_signal_emit (account_override, signals[CHANGED], 0); +} + +void +e_mail_send_account_override_remove_for_folder (EMailSendAccountOverride *account_override, + const gchar *folder_uri) +{ + gboolean saved; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + g_return_if_fail (folder_uri != NULL); + + g_mutex_lock (&account_override->priv->property_lock); + + g_key_file_remove_key (account_override->priv->key_file, FOLDERS_SECTION, folder_uri, NULL); + saved = e_mail_send_account_override_maybe_save_locked (account_override); + + g_mutex_unlock (&account_override->priv->property_lock); + + if (saved) + g_signal_emit (account_override, signals[CHANGED], 0); +} + +gchar * +e_mail_send_account_override_get_for_recipient (EMailSendAccountOverride *account_override, + const CamelInternetAddress *recipients) +{ + gchar *account_uid; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + g_return_if_fail (recipients != NULL); + + g_mutex_lock (&account_override->priv->property_lock); + account_uid = get_override_for_recipients_locked (account_override, (CamelAddress *) recipients); + g_mutex_unlock (&account_override->priv->property_lock); + + return account_uid; +} + +void +e_mail_send_account_override_set_for_recipient (EMailSendAccountOverride *account_override, + const gchar *recipient, + const gchar *account_uid) +{ + gboolean saved; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + g_return_if_fail (recipient != NULL); + g_return_if_fail (account_uid != NULL); + + g_mutex_lock (&account_override->priv->property_lock); + + g_key_file_set_string (account_override->priv->key_file, RECIPIENTS_SECTION, recipient, account_uid); + saved = e_mail_send_account_override_maybe_save_locked (account_override); + + g_mutex_unlock (&account_override->priv->property_lock); + + if (saved) + g_signal_emit (account_override, signals[CHANGED], 0); +} + +void +e_mail_send_account_override_remove_for_recipient (EMailSendAccountOverride *account_override, + const gchar *recipient) +{ + gboolean saved; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + g_return_if_fail (recipient != NULL); + + g_mutex_lock (&account_override->priv->property_lock); + + g_key_file_remove_key (account_override->priv->key_file, RECIPIENTS_SECTION, recipient, NULL); + saved = e_mail_send_account_override_maybe_save_locked (account_override); + + g_mutex_unlock (&account_override->priv->property_lock); + + if (saved) + g_signal_emit (account_override, signals[CHANGED], 0); +} + +void +e_mail_send_account_override_list_for_account (EMailSendAccountOverride *account_override, + const gchar *account_uid, + GSList **folder_overrides, + GSList **recipient_overrides) +{ + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + g_return_if_fail (account_uid != NULL); + + g_mutex_lock (&account_override->priv->property_lock); + + list_overrides_for_account_locked (account_override, account_uid, folder_overrides, recipient_overrides); + + g_mutex_unlock (&account_override->priv->property_lock); +} + +void +e_mail_send_account_override_freeze_save (EMailSendAccountOverride *account_override) +{ + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + + g_mutex_lock (&account_override->priv->property_lock); + + account_override->priv->save_frozen++; + if (!account_override->priv->save_frozen) { + g_warn_if_reached (); + } + + g_mutex_unlock (&account_override->priv->property_lock); +} + +void +e_mail_send_account_override_thaw_save (EMailSendAccountOverride *account_override) +{ + gboolean saved = FALSE; + + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + + g_mutex_lock (&account_override->priv->property_lock); + + if (!account_override->priv->save_frozen) { + g_warn_if_reached (); + } else { + account_override->priv->save_frozen--; + if (!account_override->priv->save_frozen && + account_override->priv->need_save) + saved = e_mail_send_account_override_save_locked (account_override); + } + + g_mutex_unlock (&account_override->priv->property_lock); + + if (saved) + g_signal_emit (account_override, signals[CHANGED], 0); +} diff --git a/mail/e-mail-send-account-override.h b/mail/e-mail-send-account-override.h new file mode 100644 index 0000000000..e89d7b657c --- /dev/null +++ b/mail/e-mail-send-account-override.h @@ -0,0 +1,108 @@ +/* + * e-mail-send-account-override.h + * + * 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 + * + * + * Copyright (C) 2013 Red Hat, Inc. (www.redhat.com) + * + */ + +#ifndef E_MAIL_SEND_ACCOUNT_OVERRIDE_H +#define E_MAIL_SEND_ACCOUNT_OVERRIDE_H + +#include +#include + +/* Standard GObject macros */ +#define E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE \ + (e_mail_send_account_override_get_type ()) +#define E_MAIL_SEND_ACCOUNT_OVERRIDE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE, EMailSendAccountOverride)) +#define E_MAIL_SEND_ACCOUNT_OVERRIDE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE, EMailSendAccountOverrideClass)) +#define E_IS_MAIL_SEND_ACCOUNT_OVERRIDE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE)) +#define E_IS_MAIL_SEND_ACCOUNT_OVERRIDE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE)) +#define E_MAIL_SEND_ACCOUNT_OVERRIDE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE, EMailSendAccountOverrideClass)) + +G_BEGIN_DECLS + +typedef struct _EMailSendAccountOverride EMailSendAccountOverride; +typedef struct _EMailSendAccountOverrideClass EMailSendAccountOverrideClass; +typedef struct _EMailSendAccountOverridePrivate EMailSendAccountOverridePrivate; + +struct _EMailSendAccountOverride { + GObject parent; + EMailSendAccountOverridePrivate *priv; +}; + +struct _EMailSendAccountOverrideClass { + GObjectClass parent; + + /* Signals */ + void (* changed) (EMailSendAccountOverride *account_override); +}; + +GType e_mail_send_account_override_get_type (void); +EMailSendAccountOverride * + e_mail_send_account_override_new (const gchar *config_filename); +void e_mail_send_account_override_set_config_filename + (EMailSendAccountOverride *account_override, + const gchar *config_filename); +gchar * e_mail_send_account_override_dup_config_filename + (EMailSendAccountOverride *account_override); +void e_mail_send_account_override_set_prefer_folder (EMailSendAccountOverride *account_override, + gboolean prefer_folder); +gboolean e_mail_send_account_override_get_prefer_folder (EMailSendAccountOverride *account_override); +gchar * e_mail_send_account_override_get_account_uid (EMailSendAccountOverride *account_override, + const gchar *folder_uri, + const CamelInternetAddress *recipients_to, + const CamelInternetAddress *recipients_cc, + const CamelInternetAddress *recipients_bcc); +void e_mail_send_account_override_remove_for_account_uid + (EMailSendAccountOverride *account_override, + const gchar *account_uid); +gchar * e_mail_send_account_override_get_for_folder (EMailSendAccountOverride *account_override, + const gchar *folder_uri); +void e_mail_send_account_override_set_for_folder (EMailSendAccountOverride *account_override, + const gchar *folder_uri, + const gchar *account_uid); +void e_mail_send_account_override_remove_for_folder (EMailSendAccountOverride *account_override, + const gchar *folder_uri); +gchar * e_mail_send_account_override_get_for_recipient (EMailSendAccountOverride *account_override, + const CamelInternetAddress *recipients); +void e_mail_send_account_override_set_for_recipient (EMailSendAccountOverride *account_override, + const gchar *recipient, + const gchar *account_uid); +void e_mail_send_account_override_remove_for_recipient + (EMailSendAccountOverride *account_override, + const gchar *recipient); +void e_mail_send_account_override_list_for_account (EMailSendAccountOverride *account_override, + const gchar *account_uid, + GSList **folder_overrides, + GSList **recipient_overrides); +void e_mail_send_account_override_freeze_save (EMailSendAccountOverride *account_override); +void e_mail_send_account_override_thaw_save (EMailSendAccountOverride *account_override); + +G_END_DECLS + +#endif /* E_MAIL_SEND_ACCOUNT_OVERRIDE_H */ diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 630fe0f77a..44e8619e5d 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1103,6 +1103,8 @@ create_new_composer (EShell *shell, e_composer_header_table_set_subject (table, subject); e_composer_header_table_set_identity_uid (table, identity); + em_utils_apply_send_account_override_to_composer (composer, shell, folder); + g_free (identity); g_object_unref (client_cache); @@ -1140,6 +1142,83 @@ em_utils_compose_new_message (EShell *shell, return composer; } +static CamelMimeMessage * +em_utils_get_composer_recipients_as_message (EMsgComposer *composer) +{ + CamelMimeMessage *message; + EComposerHeaderTable *table; + EComposerHeader *header; + EDestination **destv; + CamelInternetAddress *to_addr, *cc_addr, *bcc_addr, *dest_addr; + const gchar *text_addr; + gint ii; + + g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL); + + table = e_msg_composer_get_header_table (composer); + header = e_composer_header_table_get_header (table, E_COMPOSER_HEADER_TO); + + if (!e_composer_header_get_visible (header)) + return NULL; + + message = camel_mime_message_new (); + + to_addr = camel_internet_address_new (); + cc_addr = camel_internet_address_new (); + bcc_addr = camel_internet_address_new (); + + /* To */ + dest_addr = to_addr; + destv = e_composer_header_table_get_destinations_to (table); + for (ii = 0; destv != NULL && destv[ii] != NULL; ii++) { + text_addr = e_destination_get_address (destv[ii]); + if (text_addr && *text_addr) { + if (camel_address_decode (CAMEL_ADDRESS (dest_addr), text_addr) <= 0) + camel_internet_address_add (dest_addr, "", text_addr); + } + } + e_destination_freev (destv); + + /* CC */ + dest_addr = cc_addr; + destv = e_composer_header_table_get_destinations_cc (table); + for (ii = 0; destv != NULL && destv[ii] != NULL; ii++) { + text_addr = e_destination_get_address (destv[ii]); + if (text_addr && *text_addr) { + if (camel_address_decode (CAMEL_ADDRESS (dest_addr), text_addr) <= 0) + camel_internet_address_add (dest_addr, "", text_addr); + } + } + e_destination_freev (destv); + + /* Bcc */ + dest_addr = bcc_addr; + destv = e_composer_header_table_get_destinations_bcc (table); + for (ii = 0; destv != NULL && destv[ii] != NULL; ii++) { + text_addr = e_destination_get_address (destv[ii]); + if (text_addr && *text_addr) { + if (camel_address_decode (CAMEL_ADDRESS (dest_addr), text_addr) <= 0) + camel_internet_address_add (dest_addr, "", text_addr); + } + } + e_destination_freev (destv); + + if (camel_address_length (CAMEL_ADDRESS (to_addr)) > 0) + camel_mime_message_set_recipients (message, CAMEL_RECIPIENT_TYPE_TO, to_addr); + + if (camel_address_length (CAMEL_ADDRESS (cc_addr)) > 0) + camel_mime_message_set_recipients (message, CAMEL_RECIPIENT_TYPE_CC, cc_addr); + + if (camel_address_length (CAMEL_ADDRESS (bcc_addr)) > 0) + camel_mime_message_set_recipients (message, CAMEL_RECIPIENT_TYPE_BCC, bcc_addr); + + g_object_unref (to_addr); + g_object_unref (cc_addr); + g_object_unref (bcc_addr); + + return message; +} + /** * em_utils_compose_new_message_with_mailto: * @shell: an #EShell @@ -1170,6 +1249,8 @@ em_utils_compose_new_message_with_mailto (EShell *shell, else composer = e_msg_composer_new (shell); + em_utils_apply_send_account_override_to_composer (composer, shell, folder); + table = e_msg_composer_get_header_table (composer); client_cache = e_composer_header_table_ref_client_cache (table); @@ -1459,6 +1540,9 @@ em_utils_edit_message (EShell *shell, } composer = e_msg_composer_new_with_message (shell, message, keep_signature, NULL); + + em_utils_apply_send_account_override_to_composer (composer, shell, folder); + if (!folder_is_templates) { EComposerHeaderTable *table; ESource *source; @@ -1907,8 +1991,10 @@ redirect_get_composer (EShell *shell, registry = e_shell_get_registry (shell); /* This returns a new ESource reference. */ - source = em_utils_guess_mail_identity_with_recipients_and_sort ( - registry, message, NULL, NULL, sort_sources_by_ui, shell); + source = em_utils_check_send_account_override (shell, message, NULL); + if (!source) + source = em_utils_guess_mail_identity_with_recipients_and_sort ( + registry, message, NULL, NULL, sort_sources_by_ui, shell); if (source != NULL) { identity_uid = e_source_dup_uid (source); @@ -2851,8 +2937,10 @@ em_utils_reply_to_message (EShell *shell, registry = e_shell_get_registry (shell); /* This returns a new ESource reference. */ - source = em_utils_guess_mail_identity_with_recipients_and_sort ( - registry, message, folder, message_uid, sort_sources_by_ui, shell); + source = em_utils_check_send_account_override (shell, message, folder); + if (!source) + source = em_utils_guess_mail_identity_with_recipients_and_sort ( + registry, message, folder, message_uid, sort_sources_by_ui, shell); if (source != NULL) { identity_uid = e_source_dup_uid (source); g_object_unref (source); @@ -2920,6 +3008,9 @@ em_utils_reply_to_message (EShell *shell, g_free (tmp_message_uid); } + /* because some reply types can change recipients after the composer is populated */ + em_utils_apply_send_account_override_to_composer (composer, shell, folder); + composer_set_no_change (composer); gtk_widget_show (GTK_WIDGET (composer)); @@ -3058,3 +3149,80 @@ em_configure_new_composer (EMsgComposer *composer, header, "clicked", G_CALLBACK (post_header_clicked_cb), session); } + +/* free returned pointer with g_object_unref(), if not NULL */ +ESource * +em_utils_check_send_account_override (EShell *shell, + CamelMimeMessage *message, + CamelFolder *folder) +{ + EMailBackend *mail_backend; + EMailSendAccountOverride *account_override; + CamelInternetAddress *to = NULL, *cc = NULL, *bcc = NULL; + gchar *folder_uri = NULL, *account_uid; + ESource *account_source = NULL; + ESourceRegistry *source_registry; + + g_return_val_if_fail (E_IS_SHELL (shell), NULL); + + if (!message && !folder) + return NULL; + + if (message) { + to = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); + cc = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC); + bcc = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_BCC); + } + + mail_backend = E_MAIL_BACKEND (e_shell_get_backend_by_name (shell, "mail")); + g_return_val_if_fail (mail_backend != NULL, NULL); + + if (folder) + folder_uri = e_mail_folder_uri_from_folder (folder); + + source_registry = e_shell_get_registry (shell); + account_override = e_mail_backend_get_send_account_override (mail_backend); + account_uid = e_mail_send_account_override_get_account_uid (account_override, folder_uri, to, cc, bcc); + + while (account_uid) { + account_source = e_source_registry_ref_source (source_registry, account_uid); + if (account_source) + break; + + /* stored send account override settings contain a reference + to a dropped account, thus cleanup it now */ + e_mail_send_account_override_remove_for_account_uid (account_override, account_uid); + + g_free (account_uid); + account_uid = e_mail_send_account_override_get_account_uid (account_override, folder_uri, to, cc, bcc); + } + + g_free (folder_uri); + g_free (account_uid); + + return account_source; +} + +void +em_utils_apply_send_account_override_to_composer (EMsgComposer *composer, + EShell *shell, + CamelFolder *folder) +{ + CamelMimeMessage *message; + EComposerHeaderTable *header_table; + ESource *source; + + g_return_if_fail (E_IS_MSG_COMPOSER (composer)); + + message = em_utils_get_composer_recipients_as_message (composer); + source = em_utils_check_send_account_override (shell, message, folder); + g_object_unref (message); + + if (!source) + return; + + header_table = e_msg_composer_get_header_table (composer); + e_composer_header_table_set_identity_uid (header_table, e_source_get_uid (source)); + + g_object_unref (source); +} diff --git a/mail/em-composer-utils.h b/mail/em-composer-utils.h index a99c3c8af2..db7a0c29b3 100644 --- a/mail/em-composer-utils.h +++ b/mail/em-composer-utils.h @@ -85,6 +85,14 @@ void em_utils_get_real_folder_uri_and_message_uid const gchar *uid, gchar **folder_uri, gchar **message_uid); +ESource * em_utils_check_send_account_override + (EShell *shell, + CamelMimeMessage *message, + CamelFolder *folder); +void em_utils_apply_send_account_override_to_composer + (EMsgComposer *composer, + EShell *shell, + CamelFolder *folder); G_END_DECLS diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c index d50888fea9..b56dffb4bf 100644 --- a/mail/em-folder-properties.c +++ b/mail/em-folder-properties.c @@ -31,10 +31,14 @@ #include #include +#include + #include #include #include +#include + #include "e-mail-backend.h" #include "e-mail-ui-session.h" #include "em-config.h" @@ -77,6 +81,25 @@ emfp_free (EConfig *ec, g_slist_free (items); } +static void +mail_identity_combo_box_changed_cb (GtkComboBox *combo_box, + EMailSendAccountOverride *account_override) +{ + const gchar *active_id, *folder_uri; + + g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + g_return_if_fail (E_IS_MAIL_SEND_ACCOUNT_OVERRIDE (account_override)); + + folder_uri = g_object_get_data (G_OBJECT (combo_box), "sao-folder-uri"); + g_return_if_fail (folder_uri != NULL); + + active_id = gtk_combo_box_get_active_id (combo_box); + if (!active_id || !*active_id) + e_mail_send_account_override_remove_for_folder (account_override, folder_uri); + else + e_mail_send_account_override_set_for_folder (account_override, folder_uri, active_id); +} + static gint add_numbered_row (GtkTable *table, gint row, @@ -255,6 +278,56 @@ emfp_get_folder_item (EConfig *ec, g_free (properties); + /* add send-account-override setting widgets */ + if (context->folder != NULL) { + ESourceRegistry *registry; + EShell *shell; + EMailBackend *mail_backend; + EMailSendAccountOverride *account_override; + gchar *folder_uri, *account_uid; + GtkWidget *label; + + registry = e_shell_get_registry (e_shell_get_default ()); + + label = gtk_label_new_with_mnemonic (_("_Send Account Override:")); + gtk_widget_set_halign (label, GTK_ALIGN_START); + gtk_widget_show (label); + gtk_table_attach ( + GTK_TABLE (table), label, + 0, 2, row, row + 1, + GTK_FILL, 0, 0, 0); + row++; + + widget = g_object_new (E_TYPE_MAIL_IDENTITY_COMBO_BOX, + "registry", registry, + "allow-none", TRUE, + NULL); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget); + gtk_widget_set_margin_left (widget, 12); + gtk_widget_show (widget); + gtk_table_attach ( + GTK_TABLE (table), widget, + 0, 2, row, row + 1, + GTK_FILL | GTK_EXPAND, 0, 0, 0); + row++; + + shell = e_shell_get_default (); + mail_backend = E_MAIL_BACKEND (e_shell_get_backend_by_name (shell, "mail")); + g_return_val_if_fail (mail_backend != NULL, table); + + account_override = e_mail_backend_get_send_account_override (mail_backend); + folder_uri = e_mail_folder_uri_from_folder (context->folder); + account_uid = e_mail_send_account_override_get_for_folder (account_override, folder_uri); + + gtk_combo_box_set_active_id (GTK_COMBO_BOX (widget), account_uid ? account_uid : ""); + g_object_set_data_full (G_OBJECT (widget), "sao-folder-uri", folder_uri, g_free); + + g_signal_connect (widget, "changed", + G_CALLBACK (mail_identity_combo_box_changed_cb), account_override); + + g_free (account_uid); + } + return table; } diff --git a/mail/mail-config.ui b/mail/mail-config.ui index a614467150..943945815e 100644 --- a/mail/mail-config.ui +++ b/mail/mail-config.ui @@ -25,7 +25,6 @@ True True False - False True True @@ -41,7 +40,6 @@ True True False - False True True @@ -221,8 +219,8 @@ True True False - False True + 0.5 True @@ -237,8 +235,8 @@ True True False - False True + 0.5 True @@ -253,8 +251,8 @@ True True False - False True + 0.5 True @@ -269,8 +267,8 @@ True True False - False True + 0.5 True @@ -370,7 +368,7 @@ GTK_FILL - + @@ -386,7 +384,7 @@ 1 2 GTK_FILL - + @@ -395,15 +393,15 @@ True True False - False True + 0.5 True 2 2 3 - + @@ -412,15 +410,15 @@ True True False - False True + 0.5 True 2 3 4 - + @@ -429,15 +427,15 @@ True True False - False True + 0.5 True 2 4 5 - + @@ -446,15 +444,15 @@ True True False - False True + 0.5 True 2 5 6 - + @@ -463,15 +461,15 @@ True True False - False True + 0.5 True 2 6 7 - + @@ -483,11 +481,12 @@ True + False - Attachment - Inline (Outlook style) - Quoted - Do Not Quote + Attachment + Inline (Outlook style) + Quoted + Do Not Quote @@ -506,10 +505,11 @@ True + False - Attachment - Inline - Quoted + Attachment + Inline + Quoted @@ -771,8 +771,8 @@ True True False - False True + 0.5 True @@ -806,7 +806,6 @@ True True True - False Pick a color #000000000000 @@ -893,8 +892,8 @@ True True False - False True + 0.5 True @@ -909,8 +908,8 @@ True True False - False True + 0.5 True @@ -925,8 +924,8 @@ True True False - False True + 0.5 True @@ -941,8 +940,8 @@ True True False - False True + 0.5 True @@ -957,8 +956,8 @@ True True False - False True + 0.5 True @@ -973,8 +972,8 @@ True True False - False True + 0.5 True @@ -1008,6 +1007,379 @@ False + + + True + False + 12 + + + True + False + 12 + 6 + 6 + 6 + True + True + 0 + etched-out + + + True + False + 6 + 6 + 6 + 6 + + + True + False + + + True + False + 30 + 30 + 2 + center + + + Add + True + True + True + + + False + True + 0 + + + + + Remove + True + True + True + + + False + True + 1 + + + + + 0 + 1 + 1 + 1 + + + + + True + True + 6 + True + True + + + True + True + True + True + False + + + multiple + + + + + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + Use for Folders + True + + + + + 0 + 4 + 1 + 1 + + + + + True + False + 6 + 6 + 6 + 6 + True + True + 0 + etched-out + + + True + False + 6 + 6 + 6 + 6 + + + True + False + + + True + False + 2 + center + + + Add + True + True + True + + + False + True + 0 + + + + + Edit + True + True + True + + + False + True + 1 + + + + + Remove + True + True + True + + + False + True + 2 + + + + + 0 + 1 + 1 + 1 + + + + + True + True + 6 + True + True + + + True + True + True + True + False + + + multiple + + + + + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + Use for Recipients + True + + + + + 1 + 4 + 1 + 1 + + + + + True + False + 12 + 6 + 6 + 6 + True + True + 0 + + + True + False + 6 + 6 + 6 + 6 + + + True + True + True + True + + + True + True + True + True + False + + + + + + + + + + + + True + False + Account + True + + + + + 0 + 3 + 2 + 1 + + + + + True + False + 6 + 0 + Send account overrides + + + + + + 0 + 0 + 2 + 1 + + + + + True + False + 12 + 6 + 6 + 6 + 0 + Assign which account should be used as a send account for respective folders or recipients, an override for usual send account detection. List of recipients can contain partial addresses or names. The name and the address parts are compared separately. + True + + + 0 + 1 + 2 + 1 + + + + + Folder override has precedence over Recipient override + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + 1 + + + + + 4 + + + + + True + False + Send Account + + + 4 + False + + @@ -1060,26 +1432,27 @@ - + True True + True - + True False 12 12 - + True False 6 - + True False 0 - Proxy Settings + Start up @@ -1091,25 +1464,36 @@ - + True False 12 - + True False 6 - - _Use system defaults + True - True - False - False - True - True - True + False + 4 + + + Check for new _messages on start + True + True + False + True + 0.5 + True + + + False + False + 0 + + False @@ -1118,15 +1502,26 @@ - - _Direct connection to the Internet + True - True - False - False - True - True - rdoSysSettings + False + 4 + + + Check for new messa_ges in all active accounts + True + True + False + True + 0.5 + True + + + False + False + 0 + + False @@ -1134,424 +1529,356 @@ 1 + + + + + False + False + 1 + + + + + False + False + 0 + + + + + True + False + 6 + + + True + False + 0 + Message Display + + + + + + False + False + 0 + + + + + True + False + 12 + + + True + False + 6 - - _Manual proxy configuration: + + _Use the same fonts as other applications True True False - False True + 0.5 True - rdoSysSettings False False - 2 + 0 - + True False 24 - + True False - 6 + 2 + 2 + 6 + 6 - + True False - 4 - 4 - 6 - 6 - - - True - False - 0 - H_TTP Proxy: - True - txtHttpHost - - - GTK_FILL - - - - - - True - False - 0 - _Secure HTTP Proxy: - True - txtHttpsHost - - - 1 - 2 - GTK_FILL - - - - - - True - False - 0 - SOC_KS Proxy: - True - txtSocksHost - - - 2 - 3 - GTK_FILL - - - - - - True - False - 0 - No _Proxy for: - True - txtIgnoreHosts - - - 3 - 4 - GTK_FILL - - - - - - True - True - - - - 1 - 2 - - - - - - True - True - - - - 1 - 2 - 1 - 2 - - - - - - True - True - - - - 1 - 2 - 2 - 3 - - - - - - True - False - 0 - Port: - - - 2 - 3 - GTK_FILL - - - - - - True - False - 0 - Port: - - - 2 - 3 - 1 - 2 - GTK_FILL - - - - - - True - False - 0 - Port: - - - 2 - 3 - 2 - 3 - GTK_FILL - - - - - - True - True - - adjustment4 - 1 - - - 3 - 4 - - - - - - True - True - - adjustment5 - 1 - - - 3 - 4 - 1 - 2 - - - - - - True - True - - adjustment6 - 1 - - - 3 - 4 - 2 - 3 - - - - - - True - True - - - - 1 - 4 - 3 - 4 - - - + 1 + S_tandard Font: + True + right + FontVariable - False - False - 0 + GTK_FILL + - - Use Authe_ntication + True True - False - False - True - True + True + Select HTML fixed width font + - False - False - 1 + 1 + 2 + 1 + 2 + GTK_FILL + - + + True + True + True + Select HTML variable width font + + + + 1 + 2 + GTK_FILL + + + + + True False - 24 - - - True - False - 2 - 2 - 6 - 3 - - - True - False - 0 - Us_ername: - True - txtAuthUser - - - GTK_FILL - - - - - - True - False - 0 - Pass_word: - True - txtAuthPwd - - - 1 - 2 - GTK_FILL - - - - - - True - True - - - - 1 - 2 - GTK_FILL - - - - - True - True - False - - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - + 1 + Fix_ed Width Font: + True + right + FontFixed - False - False - 2 + 1 + 2 + GTK_FILL + + + True + True + 1 + + + + + True + False + 6 + + + _Mark messages as read after + True + True + False + True + 0.5 + True + + + False + False + 0 + + + + + True + True + adjustment1 + 1 + 1 + True + if-valid + + + False + False + 1 + + + + + True + False + seconds + center + + + False + False + 2 + + + False False - 3 + 2 - - - - - False - False - 1 - - - - - False - False - 0 - - - - - True - False - - - - + + + True + False + 6 + + + Highlight _quotations with + True + True + False + True + 0.5 + True + True + + + False + False + 0 + + + + + True + True + True + Pick a color + #000000000000 + + + False + False + 1 + + + + + True + False + color + center + + + False + False + 2 + + + + + True + True + 3 + + + + + True + False + 6 + + + True + False + Default character e_ncoding: + True + center + + + False + False + 0 + + + + + + + + True + True + 4 + + + + + Apply the same _view settings to all folders + True + True + False + True + 0.5 + True + + + True + True + 5 + + + + + F_all back to threading messages by subject + True + True + False + True + 0.5 + True + + + True + True + 6 + + + + + + + True + True + 1 + + + - True - True + False + False 1 - - - - - True - False - General - - - False - - - - - True - True - True - - - True - False - 12 - 12 - + True False 6 - + True False 0 - Start up + Delete Mail @@ -1563,28 +1890,28 @@ - + True False 12 - + True False 6 - + True False 4 - - Check for new _messages on start + + Empty _trash folders True True False - False True + 0.5 True @@ -1593,6 +1920,24 @@ 0 + + + True + False + model1 + + + + 0 + + + + + False + False + 1 + + False @@ -1601,26 +1946,14 @@ - + + Confirm _when expunging a folder True - False - 4 - - - Check for new messa_ges in all active accounts - True - True - False - False - True - True - - - False - False - 0 - - + True + False + True + 0.5 + True False @@ -1632,8 +1965,8 @@ - False - False + True + True 1 @@ -1641,20 +1974,43 @@ False False - 0 + 2 + + + False + + + + + True + False + General + True + center + + + False + + + + + True + False + 12 + 12 - + True False 6 - + True False 0 - Message Display + General @@ -1666,23 +2022,23 @@ - + True False 12 - + True False 6 - - _Use the same fonts as other applications + + _Show animated images True True False - False True + 0.5 True @@ -1692,271 +2048,27 @@ - - True - False - 24 - - - True - False - 2 - 2 - 6 - 6 - - - True - False - 1 - S_tandard Font: - True - right - FontVariable - - - GTK_FILL - - - - - - True - True - True - False - Select HTML fixed width font - - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - - True - True - True - False - Select HTML variable width font - - - - 1 - 2 - GTK_FILL - - - - - - True - False - 1 - Fix_ed Width Font: - True - right - FontFixed - - - 1 - 2 - GTK_FILL - - - - - - - - True - True - 1 - - - - - True - 6 - - - _Mark messages as read after - True - True - False - True - True - - - False - False - 0 - - - - - True - True - adjustment1 - 1 - 1 - True - if-valid - - - False - False - 1 - - - - - True - seconds - center - - - False - False - 2 - - - - - False - False - 2 - - - - - True - False - 6 - - - Highlight _quotations with - True - True - False - False - True - True - True - - - False - False - 0 - - - - - True - True - True - False - Pick a color - #000000000000 - - - False - False - 1 - - - - - True - False - color - center - - - False - False - 2 - - - - - True - True - 3 - - - - - True - False - 6 - - - True - False - Default character e_ncoding: - True - center - - - False - False - 0 - - - - - - - - True - True - 4 - - - - - Apply the same _view settings to all folders - True - True - False - False - True - True - - - True - True - 5 - - - - - F_all back to threading messages by subject + + _Prompt on sending HTML mail to contacts that do not want them True True False - False True + 0.5 True - True - True - 6 + False + False + 1 - True - True + False + False 1 @@ -1964,20 +2076,20 @@ False False - 1 + 0 - + True False 6 - + True False 0 - Delete Mail + Loading Images @@ -1989,218 +2101,7 @@ - - True - False - 12 - - - True - False - 6 - - - True - False - 4 - - - Empty _trash folders - True - True - False - False - True - True - - - False - False - 0 - - - - - True - False - model1 - - - - 0 - - - - - False - False - 1 - - - - - False - False - 0 - - - - - Confirm _when expunging a folder - True - True - False - False - True - True - - - False - False - 1 - - - - - - - True - True - 1 - - - - - False - False - 2 - - - - - False - - - - - True - False - General - True - center - - - False - - - - - True - False - 12 - 12 - - - True - False - 6 - - - True - False - 0 - General - - - - - - False - False - 0 - - - - - True - False - 12 - - - True - False - 6 - - - _Show animated images - True - True - False - False - True - True - - - False - False - 0 - - - - - _Prompt on sending HTML mail to contacts that do not want them - True - True - False - False - True - True - - - False - False - 1 - - - - - - - False - False - 1 - - - - - False - False - 0 - - - - - True - False - 6 - - - True - False - 0 - Loading Images - - - - - - False - False - 0 - - - - + True False 12 @@ -2215,8 +2116,8 @@ True True False - False True + 0.5 True True @@ -2232,8 +2133,8 @@ True True False - False True + 0.5 True True radImagesNever @@ -2250,8 +2151,8 @@ True True False - False True + 0.5 True True radImagesNever @@ -2395,8 +2296,8 @@ True True False - False True + 0.5 True @@ -2517,7 +2418,6 @@ False True True - False True @@ -2532,7 +2432,6 @@ True True True - False True @@ -2606,6 +2505,24 @@ + + + + + + + + + + + + + + + + + + @@ -2690,14 +2607,13 @@ True True False - False True 0 True GTK_FILL - + 4 @@ -2712,7 +2628,6 @@ True True False - False True 0 True @@ -2755,7 +2670,6 @@ True True False - False True 0 True @@ -2764,7 +2678,7 @@ 2 3 GTK_FILL - + 4 @@ -2787,199 +2701,666 @@ - - - True - True - 0 - - - - - True - False - 6 - start + + + True + True + 0 + + + + + True + False + 6 + start + + + gtk-add + True + True + True + True + True + + + False + False + 0 + + + + + gtk-remove + True + True + True + True + True + + + False + False + 1 + + + + + False + True + 1 + + + + + 3 + 4 + 22 + + + + + Do not mar_k messages as junk if sender is in my address book + True + True + False + True + 0 + True + + + 4 + 5 + GTK_FILL + + 4 + + + + + _Lookup in local address book only + True + True + False + True + 0 + True + + + 5 + 6 + GTK_FILL + + 25 + + + + + True + False + 6 + + + True + False + gtk-info + + + False + True + 0 + + + + + True + False + Option is ignored if a match for custom junk headers is found. + + + False + False + 1 + + + + + 6 + 7 + GTK_FILL + + + + + True + False + 12 + 6 + + + + + + + + + + + + + + + + + + 7 + 8 + GTK_FILL + + + + + + + True + True + 1 + + + + + False + False + 0 + + + + + + + 4 + + + + + True + False + Junk + True + + + 4 + False + + + + + True + True + + + True + False + 12 + 12 + + + True + False + 6 + + + True + False + 0 + Proxy Settings + + + + + + False + False + 0 + + + + + True + False + 12 + + + True + False + 6 + + + _Use system defaults + True + True + False + True + 0.5 + True + True + + + False + False + 0 + + + + + _Direct connection to the Internet + True + True + False + True + 0.5 + True + rdoSysSettings + + + False + False + 1 + + + + + _Manual proxy configuration: + True + True + False + True + 0.5 + True + rdoSysSettings + + + False + False + 2 + + + + + True + False + 24 + + + True + False + 6 + + + True + False + 4 + 4 + 6 + 6 + + + True + False + 0 + H_TTP Proxy: + True + txtHttpHost + + + GTK_FILL + + + + + + True + False + 0 + _Secure HTTP Proxy: + True + txtHttpsHost + + + 1 + 2 + GTK_FILL + + + + + + True + False + 0 + SOC_KS Proxy: + True + txtSocksHost + + + 2 + 3 + GTK_FILL + + + + + + True + False + 0 + No _Proxy for: + True + txtIgnoreHosts + + + 3 + 4 + GTK_FILL + + + + + + True + True + + + + 1 + 2 + + + + + + True + True + + + + 1 + 2 + 1 + 2 + + + + + + True + True + + + + 1 + 2 + 2 + 3 + + + + + + True + False + 0 + Port: + + + 2 + 3 + GTK_FILL + + + + + + True + False + 0 + Port: + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + + True + False + 0 + Port: + + + 2 + 3 + 2 + 3 + GTK_FILL + + + + + + True + True + + adjustment4 + 1 + + + 3 + 4 + + + + + + True + True + + adjustment5 + 1 + + + 3 + 4 + 1 + 2 + + + - - gtk-add + True True - True - True - False - True + + adjustment6 + 1 - False - False - 0 + 3 + 4 + 2 + 3 + - - gtk-remove + True True - True - True - False - True + - False - False - 1 + 1 + 4 + 3 + 4 + False - True - 1 + False + 0 - - - 3 - 4 - 22 - - - - - Do not mar_k messages as junk if sender is in my address book - True - True - False - False - True - 0 - True - - - 4 - 5 - GTK_FILL - - 4 - - - - - _Lookup in local address book only - True - True - False - False - True - 0 - True - - - 5 - 6 - GTK_FILL - - 25 - - - - - True - False - 6 - + + Use Authe_ntication True - False - gtk-info + True + False + True + 0.5 + True False - True - 0 + False + 1 - + True False - Option is ignored if a match for custom junk headers is found. + 24 + + + True + False + 2 + 2 + 6 + 3 + + + True + False + 0 + Us_ername: + True + txtAuthUser + + + GTK_FILL + + + + + + True + False + 0 + Pass_word: + True + txtAuthPwd + + + 1 + 2 + GTK_FILL + + + + + + True + True + + + + 1 + 2 + GTK_FILL + + + + + True + True + False + + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + False False - 1 + 2 - - 6 - 7 - GTK_FILL - - - - - True - False - 12 - 6 - - - - - - - - - - - - - - - - - - 7 - 8 - GTK_FILL - + + False + False + 3 + - - True - True - 1 - False False - 0 + 1 + + False + False + 0 + + + + + True + False + + + + + + True + True + 1 + - - 4 - - + True False - Junk - True + General - 4 False -- cgit v1.2.3