DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25489>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25489

POP3Handler breaks with message numbers out of bounds

           Summary: POP3Handler breaks with message numbers out of bounds
           Product: James
           Version: 2.1
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: POP3Server
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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.

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

Reply via email to