Hi all,
We're using James 2.3.2 and some users are receiving a timeout error when
their email client sends the STAT command. These user mailboxes typically
have hundreds or thousands of messages in them. We're using MS-SQL 2008 for
all our repositories. 

I'm not a Java developer, but from the look of the source code it seems like
James is selecting a list of messages from the database then selecting each
message individually in order to calculate the size of each message. Am I
reading the code correctly? If so, this seems very inefficient and I suspect
it's the reason the STAT command times out, since it may need to process
thousands of messages. Is there a way to configure James to make this work
more quickly or efficiently? 

The code I'm looking at is from the POP3Handler class (snippet below).

    private void doSTAT(String command,String argument,String argument1) {
        String responseString = null;
        if (state == TRANSACTION) {
            long size = 0;
            int count = 0;
            try {
                for (Iterator i = userMailbox.iterator(); i.hasNext(); ) {
                    Mail mc = (Mail) i.next();
                    if (mc != DELETED) {
                        size += mc.getMessageSize();
                        count++;
                    }
                }

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to