1 package org.ibex.mail.protocol;
3 import org.ibex.crypto.*;
4 import org.ibex.jinetd.Listener;
5 import org.ibex.jinetd.Worker;
6 import org.ibex.mail.*;
7 import org.ibex.util.*;
8 import org.ibex.mail.target.*;
14 public class GMail extends Account {
15 public Mailbox getMailbox(Class protocol) { return this.root; }
16 public GMail(String user, String pass) {
17 super(user, Address.parse(user + "@gmail.com"));
18 Log.warn(GMail.class, "logging in " + user + "@gmail.com...");
21 Runtime.getRuntime().exec(new String[] {
23 "/usr/local/libgmail/demos/archive.py",
27 final Mailbox inbox = new MessageArrayMailbox(Mbox.parse(new Stream(p.getInputStream())));
29 new Mailbox.Default() {
30 public void add(Message m) { throw new RuntimeException("not supported"); }
31 public void add(Message m, int i) { throw new RuntimeException("not supported"); }
32 public int uidValidity() { return 1; }
33 public Mailbox.Iterator iterator() { return new Mailbox.Iterator.NullIterator(); }
34 public int uidNext() { return 500; }
35 public String[] children() { return new String[] { "gmail" }; }
36 public Mailbox slash(String name, boolean create) { return inbox; }
39 Log.warn(GMail.class, " succeeded for " + user + "@gmail.com!");
40 } catch (Exception e) {
41 Log.error(GMail.class, e);