commenting in SMTP.java
[org.ibex.mail.git] / src / org / ibex / mail / SMTP.java
index 039b3a7..9ca85c8 100644 (file)
@@ -16,6 +16,9 @@ import javax.naming.directory.*;
 
 // FIXME: inbound throttling/ratelimiting
 
+// "Address enumeration detection" -- notice when it looks like somebody
+// is trying a raft of addresses.
+
 // RFC's implemented
 // RFC2554: SMTP Service Extension for Authentication
 //     - did not implement section 5, though
@@ -46,11 +49,16 @@ public class SMTP {
     public static final int GRAYLIST_MINWAIT =  1000 * 60 * 60;           // one hour
     public static final int GRAYLIST_MAXWAIT =  1000 * 60 * 60 * 24 * 5;  // five days
 
-    public static final Graylist graylist =
-        new Graylist(Mailbox.STORAGE_ROOT+"/db/graylist.sqlite");
-
-    public static final Whitelist whitelist =
-        new Whitelist(Mailbox.STORAGE_ROOT+"/db/whitelist.sqlite");
+    public static final Graylist graylist;
+    public static final Whitelist whitelist;
+    static {
+        try {
+            graylist =  new Graylist(Mailbox.STORAGE_ROOT+"/db/graylist.sqlite");
+            whitelist = new Whitelist(Mailbox.STORAGE_ROOT+"/db/whitelist.sqlite");
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
 
     public static final int MAX_MESSAGE_SIZE =
         Integer.parseInt(System.getProperty("org.ibex.mail.smtp.maxMessageSize", "-1"));