Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1782c615 authored by Alexandre Roux's avatar Alexandre Roux
Browse files

do not disconnect with "Too many simultaneous connections"

parent 7b052662
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -397,8 +397,9 @@ class ImapConnection {
            return attemptXOAuth2();
        } catch (NegativeImapResponseException e) {
            //TODO: Check response code so we don't needlessly invalidate the token.
            if(e.getMessage().contains("Too many simultaneous connections"))
                throw new MessagingException("Too many simultaneous connections");
            oauthTokenProvider.invalidateToken(settings.getUsername());

            if (!retryXoauth2WithNewToken) {
                throw handlePermanentXoauth2Failure(e);
            } else {