1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-30 19:56:10 +00:00

Disconnect on BYE

This commit is contained in:
M66B 2022-01-28 09:49:25 +01:00
parent 86d655c98e
commit 7f67e79839
3 changed files with 11 additions and 4 deletions

View file

@ -558,9 +558,12 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
Response[] responses = protocol.command("SEARCH", arg);
if (responses.length == 0)
throw new ProtocolException("No response");
if (!responses[responses.length - 1].isOK())
if (!responses[responses.length - 1].isOK()) {
if (responses[responses.length - 1].isBYE())
protocol.disconnect();
throw new ProtocolException(
context.getString(R.string.title_service_auth, responses[responses.length - 1]));
}
List<Integer> msgnums = new ArrayList<>();
for (Response response : responses)

View file

@ -3430,9 +3430,10 @@ class Core {
}
} else {
for (Response response : responses)
if (response.isBYE())
if (response.isBYE()) {
protocol.disconnect();
return new MessagingException("UID FETCH", new IOException(response.toString()));
else if (response.isNO()) {
} else if (response.isNO()) {
Log.e("UID FETCH " + response);
throw new CommandFailedException(response);
} else if (response.isBAD()) {

View file

@ -1712,8 +1712,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (responses.length == 0)
throw new ProtocolException("No response");
if (!responses[responses.length - 1].isOK())
if (!responses[responses.length - 1].isOK()) {
if (responses[responses.length - 1].isBYE())
protocol.disconnect();
throw new ProtocolException(responses[responses.length - 1]);
}
for (int i = 0; i < responses.length - 1; i++) {
EntityLog.log(ServiceSynchronize.this, account.name + " " + responses[i]);