merger
[org.ibex.mail.git] / src / org / ibex / mail / Main.java
index f3465c8..46e4e34 100644 (file)
@@ -13,10 +13,11 @@ import java.io.*;
 import java.net.*;
 import java.util.*;
 import org.ibex.crypto.*;
+import org.ibex.jetty.*;
 
 public class Main implements Listener {
 
-    public void accept(Connection conn) {
+    public boolean accept(Connection conn) {
         try {
             if      (conn.getLocalPort() == 143)  new IMAP.Listener(auth).handleRequest(conn);
             else if (conn.getLocalPort() == 25)   new SMTP.Server().handleRequest(conn);
@@ -24,6 +25,8 @@ public class Main implements Listener {
             else if (conn.getLocalPort() == 8099) GMail.handleRequest(conn);
             else if (conn.getLocalPort() == 8080) Jetty.instance().accept(conn);
             else if (conn.getLocalPort() == 80)   Jetty.instance().accept(conn);
+           else return false;
+           return true;
         } finally {
             conn.close();
         }