After my mailbox was filled with about 900 emails, I could not get
these emails by pop3.

The reason: Could not open file, because
too many open file descriptors were already opened.
For each email in the users mailbox, two streams were opened
(but not closed) (The streams werde opened for
determining the length of the email).

To fix this problem:

In the source file
src/java/org/apache/james/core/MimeMessageSource.java
replace the method

public long getMessageSize() throws IOException{
.....
}

by

public long getMessageSize() throws IOException {
         int size = 0;
         InputStream in = null;
         try {
             in = getInputStream();
             int read = 0;
             byte[] data = new byte[1024];
             while ((read = in.read(data)) > 0) {
                 size += read;
             }
         } finally {
             if (in != null) in.close();
         }
         return size;
     }

Here the InputStream "in" will be closed. This should fix the problem.

Bye,

Stephan Schiessling


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to