X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fmail%2FMain.java;h=cfad5c1a152e0c72e04f29f4d99338409fc9d102;hb=03e064207e936a838a108285b625613460aee829;hp=821bff5cdb85a6301e1a3d52e4ce0027b73ef6df;hpb=4ad869ca65409a2d6a2f3230dfc0405c1b35d5f9;p=org.ibex.mail.git diff --git a/src/org/ibex/mail/Main.java b/src/org/ibex/mail/Main.java index 821bff5..cfad5c1 100644 --- a/src/org/ibex/mail/Main.java +++ b/src/org/ibex/mail/Main.java @@ -1,22 +1,35 @@ +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + package org.ibex.mail; import org.ibex.mail.target.*; import org.ibex.mail.protocol.*; import org.ibex.util.*; import org.ibex.jinetd.*; +import org.ibex.jetty.*; import org.ibex.io.*; 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); + else if (conn.getLocalPort() == 8080) new SMTP.Server().handleRequest(conn); else if (conn.getLocalPort() == 119) new NNTP.Listener(auth).handleRequest(conn); + //else if (conn.getLocalPort() == 110) new POP3.Listener(auth).handleRequest(conn); else if (conn.getLocalPort() == 8099) GMail.handleRequest(conn); + // else if (conn.getLocalPort() == 8080) Jetty.instance().accept(conn); + //else if (conn.getLocalPort() == 443) Jetty.instance().accept(conn); + //else if (conn.getLocalPort() == 80) Jetty.instance().accept(conn); + else return false; + return true; } finally { conn.close(); } @@ -36,6 +49,8 @@ public class Main implements Listener { FileBasedMailbox.getFileBasedMailbox(Mailbox.STORAGE_ROOT + "/user", true); return new Account(user, null, root.slash(user, true)){ public Mailbox getMailbox(Class protocol) { + //if (protocol == IMAP.class) return super.getMailbox(protocol).slash("newmail", false).slash("pending", false); + /* if (protocol == NNTP.class) { final Mailbox arch = new MailmanArchives(); return new Mailbox.Default() { @@ -48,8 +63,9 @@ public class Main implements Listener { public Mailbox slash(String name, boolean create) { return arch; } }; } else { + */ return super.getMailbox(protocol); - } + //} } }; }