--- AvalonMailRepository.java	Wed Apr 21 21:36:02 2004
+++ AvalonMailRepository.java
@@ -330,12 +330,26 @@
             MailImpl mc = null;
             try {
                 mc = (MailImpl) or.get(key);
-            } catch (RuntimeException re) {
+            } 
+            /* Theodore Watson */
+            /* 06/21/05 */
+            /* ted@mindbridge.com */
+            /* fix for OutOfMemoryError deleting inbox */
+            catch(OutOfMemoryError oome)
+            {
+                StringBuffer exceptionBuffer =
+                    new StringBuffer(128)
+                            .append("Exception retrieving mail: ")
+                            .append(oome.toString());
+                getLogger().debug(exceptionBuffer.toString());
+                return null;
+            }
+            catch (RuntimeException re) {
                 StringBuffer exceptionBuffer =
                     new StringBuffer(128)
                             .append("Exception retrieving mail: ")
                             .append(re.toString())
-                            .append(", so we're deleting it... good riddance!");
+                            .append(", so we're deleting it.");
                 getLogger().debug(exceptionBuffer.toString());
                 remove(key);
                 return null;
