title: FolderClosedIOException while reading mail with Java mail client
body: <p>This is happening for some of the emails which have attachments > 2MB.</p>
  
  <p>The stack trace I am getting is this:</p>
  
  <pre><code>com.sun.mail.util.FolderClosedIOException
  at com.sun.mail.imap.IMAPInputStream.forceCheckExpunged(IMAPInputStream.java:107)
  at com.sun.mail.imap.IMAPInputStream.fill(IMAPInputStream.java:158)
  at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:218)
  at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:244)
  at com.sun.mail.imap.IMAPMessage.writeTo(IMAPMessage.java:849)
  </code></pre>
  
  <p>I looked at the IMAPInputStream code to see why its doing a expunged check, looks like its getting a <code>ProtocolException</code>.</p>
  
  <pre><code>    if (peek)
          b = p.peekBody(seqnum, section, pos, cnt, readbuf);
      else
          b = p.fetchBody(seqnum, section, pos, cnt, readbuf);
      } catch (ProtocolException pex) {
           forceCheckExpunged();
           throw new IOException(pex.getMessage());
      } 
  </code></pre>
  
  <p>Anyone has faced this before? I am using javax.mail-1.5.6</p>