public final String summary() { return "[" + envelopeFrom + " -> " + envelopeTo + "] " + subject; }
public static class Malformed extends MailException { public Malformed(String s) { super(s); } }
+
+ /** reads an SMTP-style dot-escaped message */
+ static Message readDotEncodedMessage(Stream conn) {
+ StringBuffer buf = new StringBuffer();
+ while(true) {
+ String s = conn.readln();
+ if (s == null) throw new RuntimeException("connection closed");
+ if (s.equals(".")) break;
+ if (s.startsWith(".")) s = s.substring(1);
+ buf.append(s);
+ buf.append("\r\n");
+ }
+ return Message.newMessage(new Fountain.StringFountain(buf.toString()));
+ }
}