1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the Apache Public Source License 2.0 ("the License").
3 // You may not use this file except in compliance with the License.
6 import org.ibex.util.*;
9 import org.ibex.mail.target.*;
10 import org.ibex.jinetd.*;
15 // FIXME: actually implement this...
16 public interface POP3 {
18 public static interface Server {
19 public void userpass(String user, String pass);
20 public void apop(String user, String digest);
21 public Stream top(int m, int maxlines);
22 public Stream retr(int m);
23 public long stat(); // top 32 bits is number of messages, bottom 32 is total size
24 public long[] list(); // top 32 bits is message number, bottom 32 is size
25 public long list(int m);
26 public void dele(int m);
27 public void noop(int m);
28 public void rset(int m);
29 public String uidl(int m);
30 public String[] uidl(); // FIXME, also needs message number
33 public static class Listener {
35 public void handleRequest(Connection conn) {
36 conn.setTimeout(30 * 60 * 1000);
37 conn.println("+OK " + conn.vhost + " [" + POP3.class.getName() + "] ready");
40 for(String line = conn.readln(); line != null; line = conn.readln()) {
41 StringTokenizer st = new StringTokenizer(line, " ");
42 String command = st.nextToken().toUpperCase();
43 if (command.equals("USER")) {
44 } else if (command.equals("PASS")) {
45 } else if (command.equals("QUIT")) {