- if (from && (strcmp (from_header, from) == 0)) {
- g_free (account);
- account = g_strdup (node->data);
+ from = modest_account_mgr_get_from_string (mgr, node->data);
+ if (from) {
+ from_email = modest_text_utils_get_email_address ((const gchar *) from);
+ if (strcmp (from_header_email, from_email) == 0) {
+ g_free (account);
+ account = g_strdup (node->data);
+ g_free (from);
+ break;
+ }