Added workaround for folder list processing error

pull/214/head
M66B 9 months ago
parent e5f89e4d90
commit 8f84ccd178

@ -930,6 +930,7 @@ public class EmailService implements AutoCloseable {
List<EntityFolder> getFolders() throws MessagingException {
List<EntityFolder> folders = new ArrayList<>();
try {
for (Folder ifolder : getStore().getDefaultFolder().list("*")) {
String fullName = ifolder.getFullName();
String[] attrs = ((IMAPFolder) ifolder).getAttributes();
@ -941,6 +942,14 @@ public class EmailService implements AutoCloseable {
}
EntityFolder.guessTypes(folders);
} catch (MessagingException ex) {
if (ex.getMessage() != null &&
ex.getMessage().contains("LIST processing failed")) {
Log.w(ex);
folders.add(new EntityFolder("Inbox", EntityFolder.INBOX));
} else
throw ex;
}
return folders;
}

Loading…
Cancel
Save