You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ji...@apache.org on 2004/02/17 15:49:52 UTC

[jira] Commented: (JAMES-144) POP3Handler breaks with message numbers out of bounds

The following comment has been added to this issue:

     Author: Brill Pappin
    Created: Tue, 17 Feb 2004 6:49 AM
       Body:
I think I've got the same problem, though I haven't been diggin in the code (it just looks tp be the same).

Some config info:
- James 2.1.3
- JDK 1.4.x
- FreeBSD

In case this helps, here is the stack trace (address' hidden) from the pop log (the client simply says the service is not accessable):

17/02/04 20:41:09 INFO  pop3server: Connection from *.*.*.* (*.*.*.*)
17/02/04 20:41:09 ERROR pop3server: Exception during connection from *.*.*.* (*.*.*.*) : Index: 1, Size: 1
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
        at java.util.ArrayList.RangeCheck(ArrayList.java:507)
        at java.util.ArrayList.get(ArrayList.java:324)
        at org.apache.james.pop3server.POP3Handler.doUIDL(POP3Handler.java:770)
        at org.apache.james.pop3server.POP3Handler.parseCommand(POP3Handler.java:517)
        at org.apache.james.pop3server.POP3Handler.handleConnection(POP3Handler.java:307)
        at org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:465)
        at org.apache.james.util.thread.ExecutableRunnable.execute(ExecutableRunnable.java:89)
        at org.apache.james.util.thread.WorkerThread.run(WorkerThread.java:125)
---------------------------------------------------------------------
View this comment:
  http://nagoya.apache.org/jira/secure/ViewIssue.jspa?key=JAMES-144&page=comments#action_16255

---------------------------------------------------------------------
View the issue:
  http://nagoya.apache.org/jira/secure/ViewIssue.jspa?key=JAMES-144

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAMES-144
    Summary: POP3Handler breaks with message numbers out of bounds
       Type: Bug

     Status: Open

    Project: James
 Components: 
             POP3Server
   Versions:
             2.1

   Assignee: James Developers Mailing List
   Reporter: Rich

    Created: Fri, 12 Dec 2003 7:41 PM
    Updated: Tue, 17 Feb 2004 6:49 AM
Environment: Operating System: Other
Platform: All

Description:
When, for instance,
LIST 4
is given as a command when the mailbox contains only two messages, the response 
should be
-ERR Message (4) does not exist.
But instead it exits, breaking the connection ungracefully.

As I see it this is because the code catches ArrayIndexOutOfBoundsException.  
But ArrayList.get() throws IndexOutOfBoundsException.

It appears that I have fixed this, for the most part, in my working copy by 
changing ArrayIndexOutOfBoundsException to IndexOutOfBoundsException in the 
five places where it occurs in POP3Handler.

Another problem, not as bad, is shown by the following sequence:
retr 0
-ERR Message (0) deleted.

I think the correct response should be:
-ERR Message (0) does not exist.

This would be a little more work to fix, and the problem is not as bad as the 
former.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org