ArrayIndexOutOfBoundsException in Folder.getMessages
C: STAT
S: +OK 671 3625768
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 671
at javax.mail.Folder.getMessages(Folder.java:145)
at javax.mail.Folder.getMessages(Folder.java:136)
The problem seems to be
- that the pop server (gmail) says it holds 671 messages, although there are in fact less than 671 messages ;
- that the Folder class expects the STAT command to return a correct upper bound to iterate through the mails.
Any help would be appreciated.

