package org.ibex.mail;
import org.ibex.util.*;
import org.ibex.io.*;
+import org.ibex.net.*;
import org.ibex.mail.target.*;
import org.ibex.jinetd.*;
import java.io.*;
Mailbox.Iterator it = current.iterator(q);
if (!it.next()) return null;
try {
+ // FIXME: UGLY!
Message m = body ? it.cur() : Message.newMessage(new Fountain.StringFountain(it.head() + "\r\n"));
return new Article(it.nntpNumber(), m);
} catch (Exception e) { return null; }
}
int code = (head && body) ? 220 : head ? 221 : body ? 222 : 223;
println(code + " " + a.num + " <" + a.message.messageid + "> get ready for some stuff...");
- if (head) println(a.message.headers.getString());
+ if (head) { a.message.headers.getStream().transcribe(conn); println(); }
if (head && body) println();
if (body) {
Stream stream = a.message.getBody().getStream();
} else {
println("340 send the article");
StringBuffer buf = new StringBuffer();
+ // FIXME: streaming?
while(true) {
String s = conn.readln();
if (s == null) throw new RuntimeException("connection closed");