be more tolerant of crud lying around in FilebasedMailboxes
[org.ibex.mail.git] / src / org / ibex / mail / FileBasedMailbox.java
index 48e0853..2ba6549 100644 (file)
@@ -102,8 +102,10 @@ public class FileBasedMailbox extends Mailbox.Default implements MailTree {
             try {
                 if (files[i].indexOf('.') <= 0) continue;
                 files[i] = files[i].substring(0, files[i].indexOf('.'));
-                int n = Integer.parseInt(files[i]);
-                if (n>=uidNext) uidNext = n;
+                try {
+                    int n = Integer.parseInt(files[i]);
+                    if (n>=uidNext) uidNext = n;
+                } catch (NumberFormatException nfe) { continue; }
             } catch(Exception e) { Log.error(this, e); }
         }
     }