aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index c4f472cf8f..66f4ca90a0 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -588,6 +588,13 @@ create_new_composer (const char *subject, const char *fromuri)
if (fromuri)
account = mail_config_get_account_by_source_url(fromuri);
+ /* If the account corresponding to the fromuri is not enabled.
+ * We get the preffered account from the composer and use that
+ * as the account to send the mail.
+ */
+ if (!account)
+ account = e_msg_composer_get_preferred_account (composer);
+
e_msg_composer_set_headers (composer, account?account->name:NULL, NULL, NULL, NULL, subject);
em_composer_utils_setup_default_callbacks (composer);