int end = Integer.parseInt(range.substring(range.indexOf('-') + 1));
Mailbox.Iterator it = api.current.iterator(Query.messagenum(start, end));
while(it.next()) {
- Message m = it.cur();
- println(it.num()+"\t"+m.subject+"\t"+m.from+"\t"+m.date+"\t"+m.messageid+"\t"+
- m.headers.gets("references") + "\t" + m.size() + "\t" + m.lines);
+ try {
+ Message m = Message.newMessage(new Stream(it.head() + "\r\n"));
+ println(it.num()+"\t"+m.subject+"\t"+m.from+"\t"+m.date+"\t"+m.messageid+"\t"+
+ m.headers.gets("references") + "\t" + m.size() + "\t" + m.lines);
+ } catch (Exception e) { Log.error(this, e); }
}
println(".");
} else if (command.equals("LAST")) { Article a = api.last(); println("223 "+a.num+" "+a.messageid+" ok");
//}
} else if (command.equals("LIST")) {
+ if (st.hasMoreTokens()) throw new Bad("LIST " + st.nextToken() + " not supported");
Group[] g = api.list();
println("215 list of groups follows");
for(int i=0; i<g.length; i++)
// FIXME read article here
println("235 Got it");
}
+ } else {
+ throw new Bad("wtf are you talking about?");
}
} catch (No n) { println(n.code + " " + n.getMessage());
} catch (Bad b) { println(b.code + " " + b.getMessage()); Log.warn(this, b); }