Skip folders with a messaging exception

This commit is contained in:
M66B 2018-12-25 14:52:53 +00:00
parent 6328d53215
commit d2961dbf75
1 changed files with 5 additions and 0 deletions

View File

@ -940,6 +940,11 @@ public class ServiceSynchronize extends LifecycleService {
final IMAPFolder ifolder = (IMAPFolder) istore.getFolder(folder.name);
try {
ifolder.open(Folder.READ_WRITE);
} catch (MessagingException ex) {
// Including ReadOnlyFolderException
db.folder().setFolderState(folder.id, null);
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
continue;
} catch (Throwable ex) {
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
throw ex;