- from_string = modest_account_mgr_get_from_string (account_mgr,
- account_name);
- }
-
- if (from_string && account_name) {
- gchar *name = account_name;
- ModestPair *pair = modest_pair_new ((gpointer) name,
- (gpointer) from_string , TRUE);
- transports = g_slist_prepend (transports, pair);
+
+ gchar *transport_account;
+ gboolean multi_mailbox = FALSE;
+ ModestProtocol *protocol = NULL;
+
+ if (modest_account_mgr_account_is_multimailbox (account_mgr, account_name, &protocol)) {
+
+ transport_account = modest_account_mgr_get_server_account_name
+ (modest_runtime_get_account_mgr (),
+ account_name,
+ TNY_ACCOUNT_TYPE_TRANSPORT);
+ if (protocol && MODEST_IS_ACCOUNT_PROTOCOL (protocol)) {
+ ModestPairList *pair_list;
+ pair_list = modest_account_protocol_get_from_list (MODEST_ACCOUNT_PROTOCOL (protocol),
+ account_name);
+ if (pair_list) {
+ transports = g_slist_concat (transports, pair_list);
+ multi_mailbox = TRUE;
+ }
+ }
+ }
+
+ if (!multi_mailbox) {
+ gchar *from_string = NULL;
+
+ from_string = modest_account_mgr_get_from_string (account_mgr,
+ account_name, NULL);
+ if (from_string && account_name) {
+ gchar *name = account_name;
+ ModestPair *pair = modest_pair_new ((gpointer) name,
+ (gpointer) from_string , TRUE);
+ transports = g_slist_prepend (transports, pair);
+ }
+ }