public IMAP() { }
public static final float version = (float)0.2;
- // FIXME this is evil
- public static String getBodyString(Message m) {
- StringBuffer sb = new StringBuffer();
- m.getBody().getStream().transcribe(sb);
- return sb.toString();
- }
-
// API Class //////////////////////////////////////////////////////////////////////////////
public static interface Client {
public void delete(Mailbox m) { if (!m.equals(inbox)) m.destroy(false); else throw new Bad("can't delete inbox"); }
public void create(String m) { mailbox(m, true, false); }
public void append(String m,int f,Date a,String b) { try {
+ // FIXME: more efficient streaming here?
mailbox(m,false).insert(Message.newMessage(new Fountain.StringFountain(b)), f | Mailbox.Flag.RECENT);
} catch (Message.Malformed e) { throw new No(e.getMessage()); } }
public void check() { }
for(Mailbox.Iterator it = selected().iterator(q);it.next();) {
// FIXME: what's going on here with the recent flag?
//boolean recent = it.getFlag(Mailbox.Flag.RECENT);
- try { throw new Exception("flags " + flags); } catch (Exception e) { Log.error(this, e); }
+ //try { throw new Exception("flags " + flags); } catch (Exception e) { Log.error(this, e); }
if (style == -1) it.setFlags(it.getFlags() & ~flags);
else if (style == 0) it.setFlags(flags);
else if (style == 1) it.setFlags(it.getFlags() | flags);
Login auth;
public Listener(Login auth) { api = new IMAP.MailboxWrapper(this.auth = auth, this); }
Parser.Token token() { return parser.token(); }
- void println(String s) { conn.println(s); }
+ Parser.Token token(boolean freak) { return parser.token(freak); }
+ void println(String s) {
+ conn.println(s);
+ Log.info("", s);
+ }
void newline() { parser.newline(); }
Query query(int max) { return parser.query(max, maxn(true)); }