diff options
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index 58bb0f5ce8..0cef4dc0fa 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -2400,12 +2400,24 @@ const MailConfigService * mail_config_get_default_transport (void) { const MailConfigAccount *account; + const GSList *accounts; account = mail_config_get_default_account (); - if (account) + if (account && account->transport && account->transport->url) return account->transport; - else - return NULL; + + /* return the first account with a transport? */ + accounts = config->accounts; + while (accounts) { + account = accounts->data; + + if (account->transport && account->transport->url) + return account->transport; + + accounts = accounts->next; + } + + return NULL; } GSList * |