FolderClosedIOException while reading mail with Java Mail for attachment > 10MB

Viewed 292

This is happening for the emails having attachment > 10Mb. We are trying to download the attachment and saving it on local. We are getting below error after processing 3/4 mails. We are using Java.Mail.1.3.2 to write the data in file byte by byte.

Caused by: com.sun.mail.util.FolderClosedIOException
        at com.sun.mail.imap.IMAPInputStream.forceCheckExpunged(IMAPInputStream.java:100)
        at com.sun.mail.imap.IMAPInputStream.fill(IMAPInputStream.java:150)
        at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:208)
        at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:234)
        at com.sun.mail.util.BASE64DecoderStream.getByte(BASE64DecoderStream.java:358)
        at com.sun.mail.util.BASE64DecoderStream.decode(BASE64DecoderStream.java:249)
        at com.sun.mail.util.BASE64DecoderStream.read(BASE64DecoderStream.java:144)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
0 Answers
Related