fix detection of account in --compose and --compose-from-file where the From value... bugfix-3.9.2
authorPaul <paul@claws-mail.org>
Thu, 6 Jun 2013 13:10:21 +0000 (14:10 +0100)
committerPaul <paul@claws-mail.org>
Sat, 8 Jun 2013 19:58:31 +0000 (20:58 +0100)
(cherry picked from commit 6ae1c2d29624155d085ea213d1a8431981008c76)

src/compose.c

index 6ddbc78fead3b926b1660ce6f961f6cc86a47acd..c88d9b2809bd8de4b8a550c1858ba7b284cee076 100644 (file)
@@ -984,8 +984,15 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                /* mailto defines a from, check if we can get account prefs from it,
                   if not, the account prefs will be guessed using other ways, but we'll keep
                   the from anyway */
-               if (mailto_from)
+               if (mailto_from) {
                        mailto_account = account_find_from_address(mailto_from, TRUE);
+                       if (mailto_account == NULL) {
+                               gchar *tmp_from;
+                               Xstrdup_a(tmp_from, mailto_from, return NULL);
+                               extract_address(tmp_from);
+                               mailto_account = account_find_from_address(tmp_from, TRUE);
+                       }
+               }
                if (mailto_account)
                        account = mailto_account;
        }