diff --git a/lib/mail/mail_account.dart b/lib/mail/mail_account.dart index bef49666..4c6b7df9 100644 --- a/lib/mail/mail_account.dart +++ b/lib/mail/mail_account.dart @@ -75,7 +75,8 @@ class MailAccount extends JsonSerializable { static MailAccount fromDiscoveredSetings( String name, String email, String password, ClientConfig config, {String userName, String outgoingClientDomain}) { - userName ??= config.preferredIncomingImapServer.getUserName(email); + userName ??= config.preferredIncomingServer.getUserName(email); + userName ??= email; var auth = PlainAuthentication(userName, password); var incoming = MailServerConfig() ..authentication = auth