|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|