Stream stream = in.getStream();
while(true) {
String s = stream.readln();
- if (s == null) break;
- if (to != null && s.toLowerCase().startsWith("envelope-to:")) continue;
- if (s.toLowerCase().startsWith("return-path:")) continue;
- if (s.length() == 0) {
+ if (s == null || s.length() == 0) {
if (to != null) sb.append("Envelope-To: " + to.toString(true) + "\r\n");
sb.append("\r\n");
break;
}
+ if (to != null && s.toLowerCase().startsWith("envelope-to:")) continue;
+ if (s.toLowerCase().startsWith("return-path:")) continue;
sb.append(s);
sb.append("\r\n");
}
public String toString() { throw new RuntimeException("Message.toString() called"); }
public String summary() { return "[" + envelopeFrom + " -> " + envelopeTo + "] " + subject; }
- public static class Malformed extends Exception { public Malformed(String s) { super(s); } }
+ public static class Malformed extends MailException { public Malformed(String s) { super(s); } }
}