public void accept(Connection conn) {
try {
- if (conn.getLocalPort() == 25) new SMTP.Server().handleRequest(conn);
- else if (conn.getLocalPort() == 143) new IMAP.Listener(auth).handleRequest(conn);
- else if (conn.getLocalPort() == 119) new NNTP.Listener(auth).handleRequest(conn);
+ if (conn.getLocalPort() == 143) new IMAP.Listener(auth).handleRequest(conn);
+ else if (conn.getLocalPort() == 25) new SMTP.Server().handleRequest(conn);
+ else if (conn.getLocalPort() == 119) new NNTP.Listener(auth).handleRequest(conn);
+ else if (conn.getLocalPort() == 8099) GMail.handleRequest(conn);
} finally {
conn.close();
}
private static class Auth implements Login {
public Account anonymous() { return null; }
public Account login(String user, String pass) {
- if (user.indexOf("@gmail.com") != -1)
- return new GMail(user.substring(0, user.indexOf("@gmail.com")), pass);
+ if (user.indexOf("@gmail.com") != -1) return GMail.getGMail(user, pass);
if (!EtcPasswd.verify(user, pass)) return null;
final Mailbox root = FileBasedMailbox.getFileBasedMailbox(Mailbox.STORAGE_ROOT, true).slash("user", true);
return new Account(user, null, root.slash(user, true)){
"Hi there. Google is lame; please type in the word you see below and " +
"click submit. You might have to click 'get mail' again after that.<br> " +
"<img src=\"https://www.google.com/accounts/"+image+"\">\r\n" +
- "<form method=get action=http://testing.megacz.com:8099/Captcha>\r\n"+
+ "<form method=get action=http://gmail.megacz.com:8099/Captcha>\r\n"+
" <input type=text name=captcha>\r\n"+
" <input type=hidden name=email value=\""+email+"\">\r\n"+
" <input type=hidden name=pass value="+password+">\r\n"+
e.printStackTrace();
}
success = true;
- for(int i=0; i<connections.size(); i++)
- try {
- ((Connection)connections.elementAt(i)).close();
- } catch (Exception e) {
- Log.error(this, e);
- }
return messages;
}