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.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index c32b05b402..f503f2d7ed 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1870,7 +1870,22 @@ guess_account (CamelMimeMessage *message, CamelFolder *folder)
&& (account = guess_account_folder(folder)))
return account;
- /* then recipient (to/cc) in account table */
+ /* check for source folder */
+ if (folder) {
+ account = guess_account_folder(folder);
+ if (account)
+ return account;
+ }
+
+ /* then message source */
+ if (account == NULL
+ && (tmp = camel_mime_message_get_source(message))) {
+ account = mail_config_get_account_by_source_url(tmp);
+ if (account)
+ return account;
+ }
+
+ /* finally recipient (to/cc) in account table */
account_hash = generate_account_hash ();
for (j=0;account == NULL && j<2;j++) {
const CamelInternetAddress *to;
@@ -1886,16 +1901,6 @@ guess_account (CamelMimeMessage *message, CamelFolder *folder)
}
g_hash_table_destroy(account_hash);
- /* then message source */
- if (account == NULL
- && (tmp = camel_mime_message_get_source(message)))
- account = mail_config_get_account_by_source_url(tmp);
-
- /* and finally, source folder */
- if (account == NULL
- && folder)
- account = guess_account_folder(folder);
-
return account;
}