mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 06:38:29 +02:00
Try original exception after retrying with username
This commit is contained in:
@@ -318,18 +318,22 @@ public class FragmentQuickSetup extends FragmentBase {
|
||||
throw ex;
|
||||
} catch (Throwable ex) {
|
||||
// Why not AuthenticationFailedException?
|
||||
// Some providers refuse connection with an invalid username
|
||||
if (!user.equals(username)) {
|
||||
Log.w(ex);
|
||||
user = username;
|
||||
Log.i("Retry with user=" + user);
|
||||
iservice.connect(
|
||||
provider.imap.host, provider.imap.port,
|
||||
EmailService.AUTH_TYPE_PASSWORD, null,
|
||||
user, password,
|
||||
null, null);
|
||||
} else
|
||||
// Some providers terminate the connection with an invalid username
|
||||
if (user.equals(username))
|
||||
throw ex;
|
||||
else
|
||||
try {
|
||||
user = username;
|
||||
Log.i("Retry with user=" + user);
|
||||
iservice.connect(
|
||||
provider.imap.host, provider.imap.port,
|
||||
EmailService.AUTH_TYPE_PASSWORD, null,
|
||||
user, password,
|
||||
null, null);
|
||||
} catch (Throwable ex1) {
|
||||
Log.w(ex1);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
folders = iservice.getFolders();
|
||||
|
||||
Reference in New Issue
Block a user