mirror of https://github.com/M66B/FairEmail.git
Handle folder closed during message decode
This commit is contained in:
parent
0f5b07801f
commit
2e6a5591f1
|
@ -46,6 +46,7 @@ import javax.activation.FileTypeMap;
|
||||||
import javax.mail.Address;
|
import javax.mail.Address;
|
||||||
import javax.mail.BodyPart;
|
import javax.mail.BodyPart;
|
||||||
import javax.mail.Flags;
|
import javax.mail.Flags;
|
||||||
|
import javax.mail.FolderClosedException;
|
||||||
import javax.mail.Header;
|
import javax.mail.Header;
|
||||||
import javax.mail.Message;
|
import javax.mail.Message;
|
||||||
import javax.mail.MessagingException;
|
import javax.mail.MessagingException;
|
||||||
|
@ -761,13 +762,13 @@ public class MessageHelper {
|
||||||
Part part;
|
Part part;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageParts getMessageParts() throws IOException {
|
MessageParts getMessageParts() throws IOException, FolderClosedException {
|
||||||
MessageParts parts = new MessageParts();
|
MessageParts parts = new MessageParts();
|
||||||
getMessageParts(imessage, parts, false); // Can throw ParseException
|
getMessageParts(imessage, parts, false); // Can throw ParseException
|
||||||
return parts;
|
return parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getMessageParts(Part part, MessageParts parts, boolean pgp) throws IOException {
|
private void getMessageParts(Part part, MessageParts parts, boolean pgp) throws IOException, FolderClosedException {
|
||||||
try {
|
try {
|
||||||
if (part.isMimeType("multipart/*")) {
|
if (part.isMimeType("multipart/*")) {
|
||||||
Multipart multipart = (Multipart) part.getContent();
|
Multipart multipart = (Multipart) part.getContent();
|
||||||
|
@ -822,6 +823,8 @@ public class MessageHelper {
|
||||||
parts.attachments.add(apart);
|
parts.attachments.add(apart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (FolderClosedException ex) {
|
||||||
|
throw ex;
|
||||||
} catch (MessagingException ex) {
|
} catch (MessagingException ex) {
|
||||||
Log.w(ex);
|
Log.w(ex);
|
||||||
parts.warnings.add(Helper.formatThrowable(ex));
|
parts.warnings.add(Helper.formatThrowable(ex));
|
||||||
|
|
Loading…
Reference in New Issue